Tony Cappellini wrote: > Does anyone know how to detect if a system has multiple monitors > (desktops) through Python? > > I've written a program which allows the user to open multiple > stand-alone windows. > When I run this program I usually drag these windows to my secondary monitor. > > I was to save the screen coordinates of the window locations so they > can be restored. > > First, the program must detect the multiple desktops and then > understand if the screen coordinates of those > windows are related to the primary or secondary desktop.
For the task you have described, that's not necessary at all. On a multi-monitor system, an application that is not multi-monitor aware will simply see one large desktop. If you save the coordinates and restore them later, it will pop up on the same monitor as when you saved. For example, I run two 1280x1024 monitors side by side, with the primary monitor on the right. If I move a window to the left monitor and then fetch the screen coordinates, the X coordinate is negative (because (0,0) is the upper left of the "primary" monitor). If I kill the app, bring it back up, and position it to (-900, 100), it is placed on the left-hand monitor. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32