﻿;-- TIME_STAMP   2021-02-13 12:16:22

#include 'GuiCtrlInfo.au3'
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>

$hGui = GUICreate('Test Ctrl', 800, 600)

; class: Button                                                                                     ID
$button = GUICtrlCreateButton('Button', 10, 40)                                                    ; 3
$check = GUICtrlCreateCheckbox('check', 100, 40)                                                   ; 4
$group = GUICtrlCreateGroup('group', 370, 70, 120, 60)                                             ; 5
$radio = GUICtrlCreateRadio('radio', 390, 310, 60)                                                 ; 6

; class: Edit
$edit = GUICtrlCreateEdit('Edit', 200, 70, 150, 50)                                                ; 7
$input = GUICtrlCreateInput('input', 640, 70, 100, 25)                                             ; 8

; class: Static
$graphic = GUICtrlCreateGraphic(510, 70, 60, 60)                                                   ; 9
GUICtrlSetBkColor(-1, 0x0000ff)
$icon = GUICtrlCreateIcon("shell32.dll", 10, 590, 70)                                              ;10
$label = GUICtrlCreateLabel('', 10, 140, 60)                                                       ;11
$pic = GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg", 10, 310, 200, 50);12

$avi  = GUICtrlCreateAvi(@SystemDir & "\shell32.dll", 165, 250, 450, 300)                           ;13
GUICtrlSetState($avi, $GUI_AVISTART)
$combo = GUICtrlCreateCombo('combo', 200, 40, 150)                                                 ;14
$date = GUICtrlCreateDate("1953/04/25", 10, 70, 185, 20)                                           ;15
$list = GUICtrlCreateList('list', 100, 140, 120, 30)                                               ;16
$lv = GuiCtrlCreateListView('list|view', 250, 140, 200, 50)                                        ;17
$monthCal = GUICtrlCreateMonthCal("1953/03/25", 610, 140, 180, 165)                                ;18
$oIE = ObjCreate("Shell.Explorer.2")                                                               ;KEINE ID - aber IsObj() = 1
$gcObj = GUICtrlCreateObj($oIE, 10, 200, 590, 100)                                                 ;19, ID - keine Class - aber IsObj() = 0
$progress = GUICtrlCreateProgress(250, 310, 120, 25)                                               ;20
GUICtrlSetData(-1, 35)
$slider = GUICtrlCreateSlider(460, 310, 100, 25)                                                   ;21
GUICtrlSetData(-1, 75)
$tab = GUICtrlCreateTab(10, 450, 200, 60)                                                          ;22
$tv = GUICtrlCreateTreeView(610, 310, 180, 150, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
                                                                                                   ;23
$inputUD = GUICtrlCreateInput("2", 10, 610, 50, 20)                                                ;24
$ud = GUICtrlCreateUpdown($inputUD)                                                                ;25

GUISetState()

Local $t, $aPre[] = ['>> ', '+> '], $ip = 1, $classLast = ''
ConsoleWrite(StringFormat('->  ID    HWND         CLASSNAME              AU3NAME       AU3TYPE  STYLE        EXSTYLE') & @CRLF)
For $i = $button To $ud
	$t = _GuiCtrlGetInfo($i)
	If $t.Class <> $classLast Then
		$ip = Abs($ip-1)
		$classLast = $t.Class
	EndIf
	ConsoleWrite(StringFormat('%s %-6s%-13s%-23s%-14s%-9s0x%-11s0x%s\n', $aPre[$ip], $t.ID, $t.hWnd, $t.Class, $t.Au3Name, $t.Au3Type, Hex($t.Style,8), Hex($t.ExStyle,8)))
Next

Do
Until GUIGetMsg() = -3