Hi, I am trying to put a double mouseclick with SendKey("{LEFTBTN2,180,640,}") on a specific place on the screen of an external window. But depending of the used monitor and screen resolution, this fixed place can be somewhere else on the screen. I can identify the two monitors using "Syslistscreen". I can also split them into two variables, so I have also the resolution ("SysscreenResolution") of both monitors. But I do not know on which monitor the active window is, so I cannot calculate the correct position I need to the different resolutions. This is the part of my test code:
PROCEDURE test() sVideo, sCreen is string Y_res, X_res, Pixel is int ResString, sCreen1, sCreen2 is string GsScherm=EDT_Wings_screen ResHandle = SysWinHandle(GsScherm) nResFocus = SysSetFocus(ResHandle) IF ResHandle = Null THEN Info("Window not found") ReturnToCapture(EDT_Wings_screen) ELSE sCreen=SysListScreen() sCreen1=ExtractString(sCreen,1,CR) sCreen2=ExtractString(sCreen,2,CR) ResString = SysScreenResolution(sCreen2) //sCreen2 must be repaced by the active screen which I cannot identify. IF ResString="" THEN info(ErrorInfo()) ReturnToCapture(EDT_Wings_screen) END X_res = ExtractString(ResString, 1) // This information will be used to calculate the correct position on the screen Y_res = ExtractString(ResString, 2) Pixel = ExtractString(ResString, 3) Multitask(10) SendKey("{LEFTBTN2,180,640,}") //This is the correct position for screen 1, but not for screen two, with a different resolution.
-- Peter Adema WINDEV programmer since 2012 |