Problem getting info from controls (with right button mouse)

Get help with using AutoHotkey and its commands and hotkeys
Tulevik
Posts: 23
Joined: 03 Jul 2015, 11:56

Problem getting info from controls (with right button mouse)

19 Oct 2018, 14:24

Hello everyone! I can get both the names of the variables that stores the images & its respective URLs in the following script with the left button of the mouse, but that info is elusive and do not refresh when I try to get them via right click, if the images are not focused. Every other data collected is ok, even if you click on a image not focused. What's wrong with my code?


#NoEnv
#SingleInstance Force
SetWorkingDir %A_ScriptDir%

Gui, Principal: New
Gui, Principal: Show, w890 h602, Test Window

Gui, secondgui: New, +OwnerPrincipal -Caption, ba01
Gui, secondgui: Add, Picture, vimage01 gmoveWindow x0 y0, 01.gif
Gui, secondgui: Show, w73 h114, ba01
WinSet, Region, w75 h116 2-2, ba01

Gui, thirdgui: New, +OwnerPrincipal -Caption, co01
Gui, thirdgui: Add, Picture, vimage02 gmoveWindow x0 y0, 02.gif
Gui, thirdgui: Show, w73 h114, co01
WinSet, Region, w75 h116 2-2, co01

return

moveWindow:
PostMessage, 0xA1, 2,,, A
MouseGetPos, , , id, control
WinGetTitle, title, ahk_id %id%
WinGetClass, class, ahk_id %id%
GuiControlGet, nameofcontrol, Name, %control%
GuiControlGet, urlcontrol, , %control%
ToolTip, ahk_id %id%`nahk_class %class%`n%title%`nControl: %control%`nName of Control: %nameofcontrol%`nURLControl: %urlcontrol%
return

~RButton::
MouseGetPos, , , id, control
WinGetTitle, title, ahk_id %id%
WinGetClass, class, ahk_id %id%
GuiControlGet, nameofcontrol, Name, %control%
GuiControlGet, urlcontrol, , %control%
ToolTip, ahk_id %id%`nahk_class %class%`n%title%`nControl: %control%`nName of Control: %nameofcontrol%`nURLControl: %urlcontrol%
return

Esc::
PrincipalGuiEscape:
PrincipalGuiClose:
ExitApp


Thanks in advance!

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], danielfgpontes, flyingDman, Google [Bot] and 186 guests