Was in the progress of creating this >>
#include <ButtonConstants.au3>
#include <Constants.au3>
#include <WinAPI.au3>
Example()
Func Example()
Local $hGUI = GUICreate('')
Local $iLabel = GUICtrlCreateButton('', 0, 0, 50, 50)
Local $iCheckbox = GUICtrlCreateCheckbox('', 0, 0, 100, 20) ; This is considered a 'Button' by _WinAPI_GetClassName too.
GUISetState(@SW_SHOW, $hGUI)
MsgBox(4096, '', 'AutoIt Button ID: ' & _IsButton($iLabel) & @CRLF & _
'AutoIt Button Handle: ' & _IsButton(GUICtrlGetHandle($iLabel)) & @CRLF & _
'AutoIt Checkbox ID: ' & _IsButton($iCheckbox) & @CRLF & _
'AutoIt Checkbox Handle: ' & _IsButton(GUICtrlGetHandle($iCheckbox)) & @CRLF)
Return GUIDelete($hGUI)
EndFunc ;==>Example
; Check if a variable is referencing a Button control.
Func _IsButton($hWnd)
If IsHWnd($hWnd) = 0 Then
$hWnd = GUICtrlGetHandle($hWnd)
EndIf
Local $sClassName = _WinAPI_GetClassName($hWnd)
If $sClassName = 'Button' Then
Local $aStyle[5] = [4, $BS_CHECKBOX, $BS_AUTOCHECKBOX, $BS_RADIOBUTTON, $BS_AUTORADIOBUTTON]
Local $iLong = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE)
For $i = 1 To $aStyle[0]
If BitAND($iLong, $aStyle[$i]) = $aStyle[$i] Then
Return False
EndIf
Next
Return True
EndIf
Return False
EndFunc ;==>_IsButton