AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Retrive control ID

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Phoenix



Joined: 23 Sep 2005
Posts: 39

PostPosted: Fri Feb 08, 2008 12:06 pm    Post subject: Retrive control ID Reply with quote

Is there a way to retrive the ID (the ID of window properties for the control in Winspector)?
Back to top
View user's profile Send private message
BoBoĻ
Guest





PostPosted: Fri Feb 08, 2008 2:05 pm    Post subject: Reply with quote

WinGet ?
Back to top
Phoenix



Joined: 23 Sep 2005
Posts: 39

PostPosted: Sat Feb 09, 2008 10:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Leroxy



Joined: 06 Dec 2007
Posts: 37

PostPosted: Sat Feb 09, 2008 10:35 pm    Post subject: Reply with quote

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%

Laughing

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
View user's profile Send private message
Phoenix



Joined: 23 Sep 2005
Posts: 39

PostPosted: Sun Feb 10, 2008 11:17 pm    Post subject: Reply with quote



This is the value I am interested in.
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Feb 11, 2008 8:31 am    Post subject: Reply with quote

ClassNN of the close button ?
Back to top
Phoenix



Joined: 23 Sep 2005
Posts: 39

PostPosted: Tue Feb 12, 2008 8:11 pm    Post subject: Reply with quote

No that's the name of the control what I want is the ID.
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 5880

PostPosted: Tue Feb 12, 2008 8:57 pm    Post subject: Reply with quote

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.

Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group