PDA

View Full Version : Moving Zoom Player window between monitors



leohuf
January 20th, 2008, 11:23 PM
Hi,

I'm trying to move the ZoomPlayer window to my secondary monitor, but I'm getting no changes...

Here's my lua code:

p = win.FindProcess ("zplayer.exe")
monitor.CenterWindowToMonitor (2,win.FindProcessWindow (proc),nil)

I think my problem is in fiding the window handle... any suggestions?

Thanks,
Leo.

Rob H
January 21st, 2008, 06:04 AM
Are you using that exact code?

If so then the call to win.FindProcessWindow(proc) should be win.FindProcessWindow(p) shouldn't it?

leohuf
January 21st, 2008, 09:04 AM
Sorry about that, I was doing a lot of experimenting with the code, and when I finally gave up and came here to post it, I forgot to change everything back... ;)

The code that I was testing is in fact:

proc = win.FindProcess ("zplayer.exe")
monitor.CenterWindowToMonitor (2,win.FindProcessWindow (proc),nil)


On the meantime, I came up with another solution... I'm focusing the Zoom Player window with the Focus action and then I use this line of script:

monitor.CenterWindowToMonitor (2,win.GetForegroundWindow (),nil)

This IS WORKING. So my problem is solved... but I still don't understand why the previous code didn't...

Thanks,
Leo.

Rob H
January 21st, 2008, 09:26 AM
It looks to me as though ZoomPlayer is written in Delphi - e.g. if you bring up Girder's Window picker you may well see 2 or 3 windows related to zplayer.exe - with classes TApplication, TMainForm and TControlForm.UnicodeClass (if you have the control bar visible). Not sure which of these is the window that you see on screen, but I suspect that it's TMainForm. TApplication is the process window and will probably be of zero size or positioned off screen.