What is stumping me is that this works using mediaportal as the target for the window but it is meant for PowerDVD10 in Theatre Mode, and it is failing to work when that program is the target for the find window action. Script follows:
Code: Select all
from win32gui import GetWindowPlacement
from eg.WinApi import GetCursorPos
hwnd = eg.lastFoundWindows[0]
wp = GetWindowPlacement(hwnd)
mousePoint = GetCursorPos()
eg.plugins.Mouse.MoveAbsolute(wp[4][0]+100, wp[4][1]+100)
eg.plugins.Mouse.RightButton()
#eg.Wait(2.0)
# move mouse back to original position
#eg.plugins.Mouse.MoveAbsolute(mousePoint[0],mousePoint[1])If I de-comment the 3rd last line (the "eg.Wait(2.0)") then I can see the mouse moves to where it should, does nothing for 2 seconds then moves back, and If I comment out the last line but keep the Wait command, the mouse moves then executes the right click after 2 seconds, even though the Wait is after the right click ?? - Like I said having trouble understanding this behaviour, is it what should be happening ? i.e. the Wait applying to the previous command ? any advice would be appreciated, This is the first time I've tried any type of Python scripting, so there could be a huge number of things I don't understand/realise with regard to how Python works.