Triton Posted September 11, 2008 Share Posted September 11, 2008 Is there a way to find out the type of gui control from its variable? I have an array of gui controls and I want to be able to discover which ones are checkboxes vs inputs. Any suggestions would be appreciated! Triton Link to comment Share on other sites More sharing options...
wraithdu Posted September 11, 2008 Share Posted September 11, 2008 You could try GuiCtrlRead(). The return from a checkbox will be the state info, while the return from an input will be text. Link to comment Share on other sites More sharing options...
Triton Posted September 11, 2008 Author Share Posted September 11, 2008 Thanks That was too easy! Int vs String Triton Link to comment Share on other sites More sharing options...
meokey Posted January 12, 2009 Share Posted January 12, 2009 what's about returning 0 and I'm sure it's not a checkbox? I got the following info from Auto3Info: Class: AfxFrameOrView42u ClassnameNN: AfxFrameOrView42u2 Advanced (Class): [CLASS:AfxFrameOrView42u; INSTANCE:2] ID: 119 Style: 0x50000000 ExStyle: 0x00000000 Link to comment Share on other sites More sharing options...
rasim Posted January 13, 2009 Share Posted January 13, 2009 TritonExample:#include <GuiConstantsEx.au3> Opt("GuiOnEventMode", 1) $hGUI = GUICreate("GetClassName Demo", 200, 100) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $cButton = GUICtrlCreateButton("Button", 11, 11, 75, 23) $cCheckbox = GUICtrlCreateCheckbox("CheckBox", 11, 51, 80, 16) $cInput = GUICtrlCreateInput("Hello", 91, 12, 100, 20) GUISetState() MsgBox(0, "ClassName", "Button: " & _GetClassName(GUICtrlGetHandle($cButton))) MsgBox(0, "ClassName", "CheckBox: " & _GetClassName(GUICtrlGetHandle($cCheckbox))) MsgBox(0, "ClassName", "Input: " & _GetClassName(GUICtrlGetHandle($cInput))) While 1 Sleep(100) WEnd Func _GetClassName($hWnd) Local $aRet = DllCall("User32.dll", "int", "GetClassName", _ "hwnd", $hWnd, _ "str", "", _ "int", 256) If $aRet[0] Then Return $aRet[2] EndFunc ;==>_GetClassName Func _Exit() GUIDelete($hGUI) Exit EndFunc ;==>_Exit Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now