Jump to content

Type of GUI control


Triton
 Share

Recommended Posts

  • 4 months later...

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

Triton

Example:

#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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...