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 (1) 

Get the position of the Messages window:

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

Possible Issues (1) 

Win32WindowPosition is only supported on Windows operating systems:

In[2]:=
ResourceFunction["Win32WindowPosition"][]
Out[2]=
In[3]:=
$OperatingSystem
Out[3]=

Publisher

Daniel Bigham

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 19 March 2019

Related Resources

License Information