#include <FrameConstants.au3>
#include <GUIConstantsEx.au3>
#include <WinAPI.au3>

; Создаёт GUI
$hGUI = GUICreate("Рисование границ", 400, 300)
GUISetState()

$hDC = _WinAPI_GetWindowDC($hGUI)
$tRect = DllStructCreate($tagRECT)
$ptrRect = DllStructGetPtr($tRect)

; Рисует чекбокс
_SetPosSize($tRect, 20, 45, 22, 22)
_WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_BUTTON, $DFCS_BUTTONCHECK + $DFCS_CHECKED)

; Рисует радиокнопку
_SetPosSize($tRect, 50, 45, 22, 22)
_WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_BUTTON, $DFCS_BUTTONRADIO + $DFCS_CHECKED)

; Рисует кнопку "Закрыть"
_SetPosSize($tRect, 80, 40, 32, 32)
_WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_CAPTION, $DFCS_CAPTIONCLOSE)

; Рисует элементы кнопок
Local $aState[9] = [8, $DFCS_BUTTON3STATE, $DFCS_BUTTON3STATE + $DFCS_INACTIVE, $DFCS_BUTTONCHECK, $DFCS_BUTTONPUSH, $DFCS_BUTTONPUSH + $DFCS_FLAT, $DFCS_BUTTONRADIO, $DFCS_BUTTONRADIOIMAGE, $DFCS_BUTTONRADIOMASK]
For $i = 1 To $aState[0]
	_SetPosSize($tRect, $i * 25, 100, 15, 15)
	_WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_BUTTON, $aState[$i])
Next

; Рисует элементы заголовка
Local $aState[6] = [5, $DFCS_CAPTIONCLOSE + $DFCS_HOT, $DFCS_CAPTIONHELP + $DFCS_PUSHED, $DFCS_CAPTIONMAX, $DFCS_CAPTIONMIN, $DFCS_CAPTIONRESTORE]
For $i = 1 To $aState[0]
	_SetPosSize($tRect, $i * 25, 130, 22, 22)
	_WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_CAPTION, $aState[$i])
Next

; Рисует элементы меню
Local $aState[5] = [4, $DFCS_MENUARROW + $DFCS_TRANSPARENT, $DFCS_MENUARROWRIGHT, $DFCS_MENUBULLET, $DFCS_MENUCHECK]
For $i = 1 To $aState[0]
	_SetPosSize($tRect, $i * 25, 160, 22, 22)
	_WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_MENU, $aState[$i])
Next

; Рисует элементы меню
Local $aState[5] = [4, $DFCS_MENUARROW + $DFCS_TRANSPARENT, $DFCS_MENUARROWRIGHT, $DFCS_MENUBULLET, $DFCS_MENUCHECK]
For $i = 1 To $aState[0]
	_SetPosSize($tRect, $i * 25 + 120, 160, 22, 22)
	_WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_POPUPMENU, $aState[$i])
Next

; Рисует элементы прокрутки
Local $aState[9] = [8, $DFCS_SCROLLCOMBOBOX, $DFCS_SCROLLDOWN, $DFCS_SCROLLLEFT, $DFCS_SCROLLRIGHT, $DFCS_SCROLLSIZEGRIP, $DFCS_SCROLLSIZEGRIPRIGHT, $DFCS_SCROLLUP, $DFCS_ADJUSTRECT]
For $i = 1 To $aState[0]
	_SetPosSize($tRect, $i * 25, 190, 22, 22)
	_WinAPI_DrawFrameControl($hDC, $ptrRect, $DFC_SCROLL, $aState[$i])
Next

_WinAPI_ReleaseDC($hGUI, $hDC) ; Освобождает ресурсы

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Func _SetPosSize($tRect, $x, $y, $w, $h)
	DllStructSetData($tRect, "Left", $x)
	DllStructSetData($tRect, "Top", $y)
	DllStructSetData($tRect, "Right", $x + $w)
	DllStructSetData($tRect, "Bottom", $y + $h)
EndFunc   ;==>_SetPosSize