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 

using ControlGet

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



Joined: 01 May 2005
Posts: 1

PostPosted: Sun May 01, 2005 11:43 am    Post subject: using ControlGet Reply with quote

Hello, I am having trouble using ControlGet. Some of the basic forms work well, but I am trying to see whether a control is visible or not. Normally I would just use something like this:

ControlGet,OutPutVar1,Visible,,Run,WindowName (with Run being the name of the control)

However I believe that I have at least two controls in the window that start with the word 'Run', so I am always getting to status of the other control. I am trying to use the ClassNN to specify the exact control that I want, but OutPutVar1 always returns null. This is how I tried to use it:

ControlGet,OutPutVar1,Visible,,AfxWnd42s 0x097F3032F,WindowName

This does not populate OutPutVar either. Any help appreciated.

thanks
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2436

PostPosted: Sun May 01, 2005 2:18 pm    Post subject: Reply with quote

Window Spy can be used to retrieve the ClassNN. This should be the classname of the control + the instance number of the control.

Example:
Code:
Gui, Add, Button, x6 y10 w160 h120 gTest1, Run
Gui, Add, Button, x176 y10 w160 h120 gTest2, Run
Gui, Show, x398 y302 h142 w349, Test
Return

Test1:
ControlGet, OutputVar1, Visible,, Button1, Test
If OutputVar1 = 1
  MsgBox, Run button 1 is visible
Return

Test2:
ControlGet, OutputVar1, Visible,, Button2, Test
If OutputVar1 = 1
  MsgBox, Run button 2 is visible
Return

GuiClose:
ExitApp
Back to top
View user's profile Send private message Visit poster's website
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