Wolfram Research

Function Repository Resource:

Win32MoveWindow

Source Notebook

Move a window on a Windows machine

Contributed by: Daniel Bigham

ResourceFunction["Win32MoveWindow"][hwnd,{x,y}]

moves a window to the given coordinates.

ResourceFunction["Win32MoveWindow"][func,{x,y}]

finds the window for which the given function returns True when passed the window’s title and moves it to the given coordinates.

Details and Options

ResourceFunction["Win32MoveWindow"] is only supported on Windows machines.
Window coordinates are relative to the top-left corner of the leftmost screen.

Examples

Basic Examples

Move the Messages window to the top-left corner of the leftmost screen:

In[1]:=
ResourceFunction["Win32MoveWindow"][
 StringStartsQ["Messages - "], {0, 0}]

Possible Issues

Win32MoveWindow is only supported on Windows operating systems:

Out[2]=
In[3]:=
$OperatingSystem
Out[3]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

See Also

License Information