member is offline
"If something should, then it doesn't, isn't, can't, hasn't or won't"
Auto mouse click...
« Thread started on: Nov 18th, 2016, 05:36am »
Not sure if this will be useful but I wrote it to run a microcontroller emulator to step through the code.
The emulator will either run at full speed or execute single instructions so that the code can be followed, by clicking the "step through" button.
However, if there are a lot of steps to go through, e.g. performing a calculation with a lot of instructions, the finger gets very tired with all that clicking of the mouse button, and on top of that it is time consuming and boring, when other work can be done, hence this program.
Place the crosshairs over the button to operate, enter a number of operations of the button and sit back and relax. No more sore fingers.
style=WS.EX.LAYERED or _WS_EX_TOPMOST
open "MouseClickSim" for window_nf as #1
calldll #user32,"SetLayeredWindowAttributes",hMain As ulong,COLORREF As ulong,bAlpha As ulong,1 As ulong,ret As ulong
if ret=0 then [quit]
#1.gb,"down;fill 1 1 1;size 1;home"
#1.gb,"color black;line 24 12 24 35"
#1.gb,"line 12 23 35 23"
if start=0 then wait
struct point,x as ulong,y as ulong
calldll #user32, "ClientToScreen",h As ulong,point as struct,r as ulong
clientX = point.x.struct
clientY = point.y.struct
calldll #user32,"SetCursorPos",clientX as ulong,clientY as ulong,r as boolean
dwFlagsDn=_MOUSEEVENTF_ABSOLUTE or _MOUSEEVENTF_LEFTDOWN
dwFlagsUp=_MOUSEEVENTF_ABSOLUTE or _MOUSEEVENTF_LEFTUP
calldll #user32,"mouse_event",dwFlagsDn as ulong,0 as ulong,0 as ulong,0 as ulong,0 as ulong, re as void
calldll #kernel32,"Sleep",100 as ulong,r as void
calldll #user32,"mouse_event",dwFlagsUp as ulong,0 as ulong,0 as ulong,0 as ulong,0 as ulong, re as void
calldll #kernel32,"Sleep",800 as ulong,r as void
if count=0 then [start]
start=start xor 1
if count=0 then start=start xor 1
if start=1 then