title: How to undock Game Window for SetParent
body: <p>Hello everyone.</p>
  <pre><code>    [DllImport(&quot;user32.dll&quot;)]
      public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
      
      public void DockAllNote(System.Windows.Forms.Panel panel)
      {
          Process[] MultiClients = Process.GetProcessesByName(&quot;notepad&quot;);
          foreach (Process Client in MultiClients)
          {
              hWndOriginalParent = Client.MainWindowHandle;
              SetParent(Client.MainWindowHandle, panel.Handle);
              panel.Refresh();
          }
      }`enter code here`
  </code></pre>
  <p>worked above code. i want to undock notepad windows.</p>
  <pre><code>    public void UndockNoteAll(System.Windows.Forms.Panel panel)
      {
          Process[] MultiClients = Process.GetProcessesByName(&quot;notepad&quot;);
          foreach (Process Client in MultiClients)
          {
              SetParent(Client.MainWindowHandle, IntPtr.Zero);
              panel.Refresh();
          }
      }
  </code></pre>
  <p>I tried this undock code but Undock did not work. Notepad remained on the panel. How to undock window? tried undock a year ago using IntPtr.Zero. I don't remember what the code is.</p>
  <p>Sorry for Bad English
  Thanks</p>