Using Mouseclick to click a systray icon issue

Get help with using AutoHotkey and its commands and hotkeys
Posts: 90
Joined: 02 Dec 2015, 06:27

Using Mouseclick to click a systray icon issue

04 Nov 2019, 04:03

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?

Posts: 260
Joined: 09 Mar 2019, 01:52
GitHub: MassimoCastell
Location: Germany

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”

Who is online

Users browsing this forum: Bad husband, Bing [Bot], LeFunk, mikeyww, neo256, scriptor2016 and 45 guests