Reputation: 330922
I need to get a handle to a Window and then move it to my secondary monitor. Is this doable with python 2.6, preferably using the standard libraries.
Upvotes: 8
Views: 8765
Reputation: 400204
Use the pywin32 module to access the native Win32 API. The functions you'll need to use are:
EnumWindows
to enumerate all of the top-level windows in the system; search for the one you want and save off the window handleEnumDisplayMonitors
to enumerate all of the monitors in the systemGetMonitorInfo
to get the virtual display coordinates of a monitor and to determine whether or not each monitor is the primary monitorMoveWindow
to move the window to the desired virtual display coordinates, using the window handle you found earlierUpvotes: 15