[Tutor] Moving a window... on windows?

Tim Golden mail at timgolden.me.uk
Mon Jun 16 18:00:56 CEST 2008


W W wrote:
> I'm not even sure if this is possible... and so far a google search of
> "python move windows xp" has failed to yield any helpful looking
> results.
> 
> I'm trying to create a script that will move a program window around
> on the desktop, and other than that search I'm not sure where to look.
> 
> What we have is a digital signage program that is ridiculously old,
> and we're trying to squeeze a bit more life out of it, until we have
> more money to spend on a better solution. It runs on a system with two
> video cards, because it requires an 640x480 output (regular coax...
> the system is ~10 yrs old), but the silly programmers did some things
> so the window will spawn in the same place on the wrong monitor.
> 
> Currently I move it manually, but I want to automate the movement. If
> there's a way to move the program window by a specific X, Y value, I
> could make it work no problem. Does anyone have any experience with
> this sort of task? Or can someone point me towards a solution?

My guess is that you want the "MoveWindow" API from the pywin32
extensions win32gui module.

http://timgolden.me.uk/pywin32-docs/win32gui__MoveWindow_meth.html

TJG


More information about the Tutor mailing list