#include <Array.au3>
#include <WinAPIEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
$hForm = GUICreate('MyGUI', 310, 360)
GUISetFont(8.5, 400, 0, 'MS Shell Dlg', $hForm)
GUICtrlCreateGroup('Group', 10, 10, 140, 95)
GUICtrlCreateCheckbox('Check1', 22, 26, 120, 23)
GUICtrlCreateCheckbox('Check2', 22, 49, 120, 23)
GUICtrlCreateCheckbox('Check3', 22, 72, 120, 23)
GUICtrlCreateGroup('Group', 160, 10, 140, 95)
GUICtrlCreateRadio('Radio1', 172, 26, 120, 23)
GUICtrlCreateRadio('Radio2', 172, 49, 120, 23)
GUICtrlCreateRadio('Radio3', 172, 72, 120, 23)
GUICtrlCreateButton('OK', 120, 330, 70, 23)
GUICtrlCreateTab(10, 118, 292, 206)
GUICtrlCreateTabItem('Tab1')
GUICtrlCreateTabItem('Tab2')
GUICtrlCreateTabItem('')
GUISetState()
$Data = _WinAPI_EnumChildWindows($hForm)
Dim $aA[UBound($Data) - 1][2]
Local $j = 1
For $i = 1 To $Data[0][0]
If $Data[$i][1] = 'button' Then
$aA[$j - 1][0] = ControlGetText('', '', $Data[$i][0])
$long = _WinAPI_GetWindowLong($Data[$i][0], 0xFFFFFFF0)
If BitAND($long, $BS_AUTORADIOBUTTON) = $BS_AUTORADIOBUTTON Then
$aA[$j - 1][1] = '单选框'
ElseIf BitAND($long, $WS_GROUP) = $WS_GROUP Then
$aA[$j - 1][1] = '分组框'
ElseIf BitAND($long, $BS_AUTOCHECKBOX) = $BS_AUTOCHECKBOX Then
$aA[$j - 1][1] = '复选框'
Else
$aA[$j - 1][1] = '按钮'
EndIf
$j += 1
EndIf
Next
ReDim $aA[$j - 1][2]
_ArrayDisplay($aA, '_WinAPI_EnumChildWindows')
Do
Until GUIGetMsg() = -3