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

_Main()

Func _Main()
	Local $hGUI, $hBrush, $hDC
	Local $hBrush, $hDC, $hGUI, $ptrRect, $tRect

	; Создаёт GUI
	$hGUI = GUICreate("WinAPI", 400, 300)
	$hDC = _WinAPI_GetWindowDC($hGUI)
	GUISetState()

	$hBrush = _WinAPI_CreateSolidBrush(0x0000FF)
	$tRect = DllStructCreate($tagRECT)
	DllStructSetData($tRect, "Left", 20)
	DllStructSetData($tRect, "Top", 50)
	DllStructSetData($tRect, "Right", 200)
	DllStructSetData($tRect, "Bottom", 200)
	$ptrRect = DllStructGetPtr($tRect)
	_WinAPI_FrameRect($hDC, $ptrRect, $hBrush)

	; Цикл выполняется, пока окно не будет закрыто
	Do
	Until GUIGetMsg() = $GUI_EVENT_CLOSE

	; Очищает ресурсы
	_WinAPI_DeleteObject($hBrush)
	_WinAPI_ReleaseDC($hGUI, $hDC)

EndFunc