title: Move the window of another program and remove the borders
body: <p>I'm working on a project to embed another program inside a Panel.  I got this to work but I can't seem to place the window right inside the form.</p>
  
  <p>Picture:</p>
  
  <p><img src="https://i.stack.imgur.com/U7P7q.png" alt="enter image description here"></p>
  
  <p>I'm using MoveWindow and SetWindowLong with no luck so far.. this is my Onload event;</p>
  
  <pre><code>Dim proc As Process = Process.Start("C:\Nexon\MapleStory\MapleStory.exe", "GameLaunching")
  proc.WaitForInputIdle()
  SendMessage(proc.MainWindowHandle, WM_SYSCOMMAND2, SC_CLOSE, 0)
  
  System.Threading.Thread.Sleep(5000)
  Do
    System.Threading.Thread.Sleep(5000)
  Loop Until FindWindow("MaplestoryClass", Nothing)
  System.Threading.Thread.Sleep(500)
  
  SetWindowLong(Processes(0).MainWindowHandle, GWL_STYLE, WS_VISIBLE)
  
  MoveWindow(Processes(0).MainWindowHandle, Panel1.Left, Panel1.Top, Panel1.Right, Panel1.Bottom, True)
  
  Dim FHandle As IntPtr
  FHandle = FindWindow("MaplestoryClass", Nothing)
  SetParent(FHandle, Panel1.Handle)
  </code></pre>
  
  <p>I need to find a way to wait till the Window of the program has shown and then execute the MoveWindow and SetWindowLong event.. </p>