| View previous topic :: View next topic |
| Author |
Message |
Phoenix
Joined: 23 Sep 2005 Posts: 39
|
Posted: Fri Feb 08, 2008 12:06 pm Post subject: Retrive control ID |
|
|
| Is there a way to retrive the ID (the ID of window properties for the control in Winspector)? |
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Fri Feb 08, 2008 2:05 pm Post subject: |
|
|
| WinGet ? |
|
| Back to top |
|
 |
Phoenix
Joined: 23 Sep 2005 Posts: 39
|
Posted: Sat Feb 09, 2008 10:13 pm Post subject: |
|
|
| No that retrives the HWND of a window. A need the ID of a control, this is not the same as the HWND wich can be obeserved in winspector. |
|
| Back to top |
|
 |
Leroxy
Joined: 06 Dec 2007 Posts: 37
|
Posted: Sat Feb 09, 2008 10:35 pm Post subject: |
|
|
| Code: | run calc
WinGet, active_id, ID, A
WinGet, this_id, id, Calculator
WinGet, this_pid, pid, ahk_id %this_id%
msgbox this_id := %this_id%`nthis_pid := %this_pid% |
| Quote: |
If the target control has an associated variable, specify the variable's name as the ControlID (this method takes precedence over the ones described next). For this reason, it is usually best to assign a variable to any control that will later be accessed via GuiControl or GuiControlGet, even if that control is not an input-capable type (such as GroupBox or Text).
Otherwise, ControlID can be either ClassNN (the classname and instance number of the control) or the name/text of the control, both of which can be determined via Window Spy. When using name/text, the matching behavior is determined by SetTitleMatchMode. Note: a picture control's file name (as it was specified at the time the control was created) may be used as its ControlID. |
|
|
| Back to top |
|
 |
Phoenix
Joined: 23 Sep 2005 Posts: 39
|
Posted: Sun Feb 10, 2008 11:17 pm Post subject: |
|
|
This is the value I am interested in. |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Feb 11, 2008 8:31 am Post subject: |
|
|
| ClassNN of the close button ? |
|
| Back to top |
|
 |
Phoenix
Joined: 23 Sep 2005 Posts: 39
|
Posted: Tue Feb 12, 2008 8:11 pm Post subject: |
|
|
| No that's the name of the control what I want is the ID. |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5880
|
Posted: Tue Feb 12, 2008 8:57 pm Post subject: |
|
|
Should be something like this:
| Code: | ControlGet, ID, Hwnd,, Button1, Advanced Settings ahk_class #32770
MsgBox, % ID + 0 |
Use the correct ClassNN instead of the Button1 in above code.
You may find the ClassNN by using AU3 spy that is available in AutoHotkey install folder.
 |
|
| Back to top |
|
 |
|