WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Mouse and Cursor Topics

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

MouseMove Example

 Keywords: Relative Windows Desktop 1000x1000 Virtual Screen Calculate WinItemChild WinPositionChild @ZOOMED WinMetrics 4 Title Bar Height 

If WinMetrics(-3) == 5 ;64-bit
   wbdir = RegQueryValue( @REGMACHINE, "SOFTWARE\Wow6432Node\Wilson WindowWare\WinBatch\CurrentSystem64[]"  )
Else ;32-bit
   wbdir = FilePath(FileLocate('winbatch.exe'))
EndIf

wiltypeviewer = wbdir:'Wil Type Viewer.exe'
title= 'WIL Type Viewer'
ShellExecute(wiltypeviewer, '', '', @ZOOMED, '') ;IMPORTANT TO ZOOM WINDOW FOR CALCULATIONS
WinWaitExist(title, 5)

list = WinItemChild( title )
childwin = AskItemlist('Choose [Get Members] Child Window/Control', list, @TAB, @UNSORTED, @SINGLE )
pos = WinPositionChild( title, childwin )
xulc = ItemExtract(1, pos, ",")
yulc = ItemExtract(2, pos, ",")
xbrc = ItemExtract(3, pos, ",")
ybrc = ItemExtract(4, pos, ",")

;Pause( 'WinPositionChild', pos : @lf :@lf :'NOTICE: The coordinates are specified as virtual coordinates within the client area of the parent window, where the parent window is 1000 x 1000.')

;Adjust for titlebar height
titleheight=WinMetrics(4)
ybrc = ybrc+titleheight
yulc = yulc+titleheight

;Calculate middle of control
width = xbrc - xulc
height = ybrc - yulc
x = xulc + (width/2)
y = yulc + (height/2)

MouseMove(x, y, '', '')  ; Relative to the Windows desktop.

Exit

Article ID:   W17989
Filename:   MouseMove Example.txt
File Created: 2013:08:26:09:20:16
Last Updated: 2013:08:26:09:20:16