Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Since the window is not yours, you can only move it by invoking the Windows API. You will have to do this:</p> <ul> <li><p>Launch the process.</p></li> <li><p>Use <a href="http://msdn.microsoft.com/en-us/library/ms633499%28VS.85%29.asp" rel="noreferrer"><code>FindWindow</code></a> to retrieve the handle to the window. If the window doesn’t exist yet, the process hasn’t created it yet; sleep for 500ms and then try again. (But don’t go into an infinite loop; stop if you can’t find the window after a reasonable timeout.)</p></li> <li><p>Use <a href="http://msdn.microsoft.com/en-us/library/ms633545%28VS.85%29.aspx" rel="noreferrer"><code>SetWindowPos</code></a> to change the position of the window.</p></li> </ul> <p>If you don’t know the title of the window, you can’t use <code>FindWindow</code>. In that case,</p> <ul> <li><p>Launch the process and get the process handle by retrieving <code>Process.Handle</code>.</p></li> <li><p>Use <a href="http://msdn.microsoft.com/en-us/library/ms633497%28VS.85%29.aspx" rel="noreferrer"><code>EnumWindows</code></a> to retrieve all the windows. For each window, use <a href="http://msdn.microsoft.com/en-us/library/ms633522%28VS.85%29.aspx" rel="noreferrer"><code>GetWindowThreadProcessId</code></a> to check whether it belongs to your process. If no window belongs to your process, wait and keep trying.</p></li> <li><p>Use <a href="http://msdn.microsoft.com/en-us/library/ms633545%28VS.85%29.aspx" rel="noreferrer"><code>SetWindowPos</code></a> to change the position of the window.</p></li> </ul> <p>Of course, you can use <code>Screen.AllScreens[n].WorkingArea</code> to retrieve the position and size of the screen you want, and then you can position the window relative to that.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload