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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the pywin32 module to access the native Win32 API. The functions you’ll need to use are:
EnumWindowsto enumerate all of the top-level windows in the system; search for the one you want and save off the window handleEnumDisplayMonitorsto enumerate all of the monitors in the systemGetMonitorInfoto get the virtual display coordinates of a monitor and to determine whether or not each monitor is the primary monitorMoveWindowto move the window to the desired virtual display coordinates, using the window handle you found earlier