Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mouseclick issue
#1
Hello there,

I was wondering if its possible to click a certain place on your screen without moving your mouse. i wrote a program to automaticly click a cerain spot on my screen. The issue is that my mousepointer switches just a split of a second and if i use another macro to click in another window it messes up stuff even if i restore the mousepointer as soon i clicked (that split second is enough to make it happen). The only way to fix this i think is to send directly the click command with coordinates to click on a certain spot without moving the mouse, setting spe to max doesn't do the job. Is this possible and if so how?

Kind regards

ps Gintaras your program is pure gold it has made my life alot easier and i think every company should teach people how to use it would increase workspeed by at least 20% lol
#2
Something from floating toolbar -> windows,controls menu should work.

Or try this function.

Function SendClickMessage
Code:
Copy      Help
;/
function x y hwnd [flags] [button] ;;flags: 1 client area.  button: 0,1 left, 2 right, 3 middle, 4 left double

;Sends mouse click message to the window without moving the mouse.
;This works not with all windows.
;The window can be inactive. However the function activates some windows.
;In most cases works synchronously, ie waits while the window is processing the messages.
;No errors, no return value, no autodelay.
;To insert code with this function, use the Mouse dialog and then replace 'lef' to 'SendClickMessage'.

;x y - mouse coordinates relative to hwnd. If flag 1 used - relative to client area of hwnd.
;hwnd - handle of window or child window.

;EXAMPLE
;SendClickMessage 17 15 id(129 win("Calculator" "SciCalc"))


if(!(flags&1)) RECT r; GetWindowRect(hwnd &r); x+=r.left; y+=r.top; ScreenToClient(hwnd +&x) ;;window to client
int w1=child(x y hwnd 8); err
if(w1)
,MapWindowPoints(hwnd w1 +&x 1)
,hwnd=w1

int m1 m2 mk m11
sel button
,case 2 m1=WM_RBUTTONDOWN; m2=WM_RBUTTONUP; mk=MK_RBUTTON
,case 3 m1=WM_MBUTTONDOWN; m2=WM_MBUTTONUP; mk=MK_MBUTTON
,case else m1=WM_LBUTTONDOWN; m2=WM_LBUTTONUP; mk=MK_LBUTTON
m11=m1

int xy=y<<16|x
;g1
SendMessage(hwnd WM_SETCURSOR hwnd m1<<16|HTCLIENT)
SendMessage(hwnd m11 mk xy)

SendMessage(hwnd WM_SETCURSOR hwnd m2<<16|HTCLIENT)
SendMessage(hwnd m2 0 xy)

if(button=4) button=0; m11=WM_LBUTTONDBLCLK; goto g1
#3
Thx alot, you ROCK!

This should replace lef tbh its alot better, i have some sync issues but i managed to fix them myself by working around it.

Really very fast reply and coded that function so fast its insane you should consider applying to work for google Smile

Kind regards and thx again if you need anything just let me know,

Satisfied user
#4
Awesome!


Forum Jump:


Users browsing this thread: 1 Guest(s)