Using Mouseclick to click a systray icon issue

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
eagerahk
Posts: 122
Joined: 02 Dec 2015, 06:27

Using Mouseclick to click a systray icon issue

04 Nov 2019, 04:03

Code: Select all

F5::
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?

Thanks
Kobaltauge
Posts: 264
Joined: 09 Mar 2019, 01:52
Location: Germany
Contact:

Re: Using Mouseclick to click a systray icon issue

15 Nov 2019, 15:05

I don't get what you are trying to do.
Where do you want the left mouse click to happen?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], gsp001 and 392 guests