title: Moving window with SetWindowPos
body: <p>I'm trying to move the window of the program I am building inside of unity. I'm getting it's handle via interating through all processes in Process.GetProcesses(). Then, I'm calling SetWindowPos, but nothing happens. Here's my code.</p>
  
  <pre><code>internal static void CheckHandle()
  {
      Process[] ps = Process.GetProcesses();
      foreach (Process p in ps)
      {
          try
          {
              if (string.Equals(p.ProcessName, "TestBuild0001"))
              {
                  _correctHandle = true;
                  _handle = p.Handle;
              }
          }
          catch
          {
              //no catch, simply exited process
          }
      }
  }
  
  internal static void SetPosition()
  {
      if (!_correctHandle)
          CheckHandle();
      if (_correctHandle)
      {
          NewGUI.SetWarning("Window set!",5,50,900,300,50);
          SetWindowPos(_handle, 0, 0, 0, 0, 0, 0x0001);
      }
  }
  </code></pre>
  
  <p>NewGUI.SetWarning just displays a label and shows up properly. _correctHandle is a simple bool and SetWindowPos is put in as </p>
  
  <pre><code>[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
  private static extern bool SetWindowPos(IntPtr hwnd, int hWndInsertAfter, int x, int Y, int cx, int cy, int wFlags);
  </code></pre>
  
  <p>I've tried moving quite a few things to get it to work but am out of ideas. Trying to get foregroundwindow brings back a entirely incorrect handle, findwindow for name brings back 0, and quite a few other things don't seem to work. Anyone know what my error could be/</p>