WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: MAlvis on March 25, 2016, 09:09:00 AM

Title: Save "Track Mouse Coordinates" in "WinBatch Navigator"
Post by: MAlvis on March 25, 2016, 09:09:00 AM
Some tools in WinBatch Navigator, such as "Window Information" include the capability to save the data revealed by the tool as a WinBatch entry. However the "Track Mouse Coordinates" tool does not offer this capability, routinely an obstacle to capturing the information for use in WinBatch scripts.

Please add to the "WinBatch Navigator" > "Track Mouse Coordinates" tool , the capability to save the data identified either to the Windows clipboard.
Title: Re: Save "Track Mouse Coordinates" in "WinBatch Navigator"
Post by: td on March 25, 2016, 11:08:55 AM
Please see the MouseCoords button in the Consolidate WIL Help file.  Also  the WinBatch Navigator source script in the WinBatch System directory.  The file is called 'default.wbt'.   You can either modify it directly or copy the relevant section to make your own version.  Search on 'Track Mouse Coordinates' to find the relevant section in default.wbt.
Title: Re: Save "Track Mouse Coordinates" in "WinBatch Navigator"
Post by: td on March 25, 2016, 01:23:06 PM
From default.wbt

Code (winbatch) Select
      Message("Mouse Tracker","This selection shows current mouse co-ordinates")
      BoxOpen("Mouse Tracker","")
      WinPlace(100,700,900,900,"Mouse Tracker")
      While 1
         ;debug(1)
         childwin = MouseInfo(0)
         parentwin = MouseInfo(1)
         If childwin == parentwin Then childwin = ""
         If childwin != ""
            If !WinExistchild(parentwin,childwin) Then childwin = ""
         EndIf
         xy = MouseCoords(parentwin,childwin)
         a = MouseInfo(2)
         x = ItemExtract(1,xy," ")
         y = ItemExtract(2,xy," ")
         mmove = StrCat('MouseMove( ',x,', ',y,', "',parentwin,'", "',childwin,'")')
         BoxText(StrCat("MouseMove Info",@CRLF,mmove,@CRLF,@CRLF,"Hold shift key down to exit"))
         ;TimeDelay(0.5)
         If IsKeyDown(@SHIFT) Then Break
      End While
      BoxShut()