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.
Python OpenCV – moveWindow() Function If we want to show image windows at a specific position moveWindow() function of OpenCV will do it. Parameters: window_name: name of the window which you want to move at particular position. x: Value of x coordinate.
Alt+Tab: Open task switcher. Windows+P: Will duplicate your screen/extend your desktop to an additional monitor. Windows+Shift+Left or Right Arrow: Move a window from one monitor to another.
Hold down the Shift key, then right-click on the appropriate application icon in the Windows taskbar. On the resulting pop-up, select the Move option. Begin pressing the arrow keys on your keyboard to move the invisible window from off-screen to on-screen.
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 earlierIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With