Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: mousemove mouseinfo
If I record the position of mouse on the screen and don't move anything why doesn't the mouse move back to the coordinates that it gets from the INI file?
Basically MouseInfo and MouseMove do not use the same system.
MouseInfo(5) gives a result based on the upper left corner of the Client Area, whileas MouseMove uses the upper left corner of the entire window.
To make them compatible you have to add stuff like title bar height to the MouseInfo return value.
Ummm, WinMetrics(4) (I think) gives you the title bar height.
Try...
DB_WIN="Winbatch Studio" :start_cal Pause("AutoImporter - Mouse Calibration","Click ""OK"" to calibrate yourmouse.") lval=10 BoxOpen("Mouse Calibrator","Move mouse to IMPORT BUTTON") for xx=5 to 1 by -1 BoxText(strcat("Move Mouse to import button",@crlf,"then wait ",xx," seconds")) TimeDelay(1) next MousePos=MouseInfo(5) ;debug(1) titleheight=WinMetrics(4) menuheight=WinMetrics(15) buttonbarheight=32 X_pos=ItemExtract(1,MousePos," ") Y_pos=ItemExtract(2,MousePos," ") y_Pos=Y_pos+titleheight +menuheight+buttonbarheight Delay(1) MouseMove(0,0,"%DB_Win%","") Delay(2) MouseMove(X_pos,Y_pos,"%DB_Win%","") ; *** debug test m5a=mouseinfo(5) m6a=mouseinfo(6) message("M5","%m5% %m5a%") message("M6","%m6% %m6a%") message("X/Y","%X_pos% %Y_pos%") ; * NOTE M5 or M6 do not equal X/X ????? val=AskYesNo("AutoImporter - Mouse Calibration","Is the mouse pointing at the ""Import"" button?") if val==@NO then start_cal
Article ID: W13298
Filename: MoveMove and MouseInfo Discrepancies.txt
File Created: 2001:01:08:12:13:24
Last Updated: 2001:01:08:12:13:24