Page 1 of 1

Using Mouseclick to click a systray icon issue

Posted: 04 Nov 2019, 04:03
by eagerahk

Code: Select all

CoordMode, mouse, screen
MouseGetPos, x_absolute, y_absolute 
CoordMode, mouse, relative
MouseGetPos, x_relative, y_relative 
CoordMode, mouse, window
MouseGetPos, x_window, y_window 
msgbox %x_absolute%, %y_absolute%, %x_relative%, %y_relative%, %x_window%, %y_window%
Pointing to any icon in systray, then press F5, we shall see three pairs of x, y coordinates.
Then I can use

Code: Select all

Mouseclick L, %x_window%, %y_window%
for those applications(ex: calc.exe, windows media player,..etc) that do not have enlarged its window to maximum size. This works fine.

The trouble is since these non-enlarged window can be dragged to anywhere in the screen; once the user does the dragging,
%x_window%, %y_window% soon dysfunctional. To fix this, I have to use %x_absolute%, %y_absolute% as follows:

Code: Select all

; the next 2 commands will move mouse to desktop upper left corner
CoordMode, mouse, screen
mousemove 0,0  
Mouseclick L, %x_absolute%, %y_absolute%
Does anyone have better approach without issuing the first 2 commands above?


Re: Using Mouseclick to click a systray icon issue

Posted: 15 Nov 2019, 15:05
by Kobaltauge
I don't get what you are trying to do.
Where do you want the left mouse click to happen?