{"id":5080,"date":"2014-03-30T18:42:09","date_gmt":"2014-03-30T18:42:09","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/vb-net-example-code-for-calling-other-exe-to-act-like-as-mdi-child-form-is-it-possible-collection-of-common-programming-errors\/"},"modified":"2014-03-30T18:42:09","modified_gmt":"2014-03-30T18:42:09","slug":"vb-net-example-code-for-calling-other-exe-to-act-like-as-mdi-child-form-is-it-possible-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/vb-net-example-code-for-calling-other-exe-to-act-like-as-mdi-child-form-is-it-possible-collection-of-common-programming-errors\/","title":{"rendered":"VB.NET example code for calling other exe to act like as MDI child form? is it possible?-Collection of common programming errors"},"content":{"rendered":"<p>ok here is the scenario. 1. i&#8217;ve create a project that has 1 form named form1.exe 2. i&#8217;ve also create a project that has 1 MDI form.<\/p>\n<p>in this MDI Form. i&#8217;would like to call &#8220;form1.exe&#8221; act like \/ behave like MDI Form child. i&#8217;ve tried using this code :<\/p>\n<pre><code>Public Shared Function SetParent(ByVal hWndChild As IntPtr, ByVal hWndParent As IntPtr) As IntPtr\nEnd Function\n\n\nPrivate Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs) Handles NewToolStripMenuItem.Click, NewToolStripButton.Click, NewWindowToolStripMenuItem.Click\n    Dim myProcess As Process = New Process()\n    myProcess.StartInfo.FileName = \"D:\\tesVB.exe\"\n    myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal\n    myProcess.Start()\n    myProcess.WaitForInputIdle()\n    SetParent(myProcess.MainWindowHandle, Me.Handle)\n    myProcess.WaitForExit()\nEnd Sub\n<\/code><\/pre>\n<p>Above code is worked but that new child form(form1.exe) doesn&#8217;t act like it should be! When i maximized or minimized it. it don&#8217;t act like MDI Child Form.<br \/>\nCan anyone give me another better example code ? thx before.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ok here is the scenario. 1. i&#8217;ve create a project that has 1 form named form1.exe 2. i&#8217;ve also create a project that has 1 MDI form. in this MDI Form. i&#8217;would like to call &#8220;form1.exe&#8221; act like \/ behave like MDI Form child. i&#8217;ve tried using this code : Public Shared Function SetParent(ByVal hWndChild [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5080","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5080"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5080\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}