Wolfram Research

Function Repository Resource:

Win32WindowPosition

Source Notebook

Get the position of a window

Contributed by: Daniel Bigham

ResourceFunction["Win32WindowPosition"][hwnd]

returns the position of the window with the given window handle (HWND).

ResourceFunction["Win32WindowPosition"][func]

returns the position of the window for which the given function returns True when passed the window’s title.

Details and Options

ResourceFunction["Win32WindowPosition"] is only supported on Windows machines.
If multiple windows match the given criteria, the position of the first is returned.
If no windows match the given criteria, a Failure object is returned.

Examples

Basic Examples

Get the position of the Messages window:

In[1]:=
ResourceFunction["Win32WindowPosition"][StringStartsQ["Messages - "]]
Out[1]=

Possible Issues

Win32WindowPosition 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