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

_Main()

Func _Main()
	Local $hGUI, $inpFlash, $inpTimeout, $btnFlash, $FlashRate, $TimeoutRate, $bFlashing = False
	$hGUI = GUICreate("_WinAPI_FlashWindowEx", 300, 120)
	GUICtrlCreateLabel("Заказные параметры мигания", 10, 10, 280, 17)
	GUICtrlCreateLabel("Количество раз:", 10, 42, 99, 17)
	$inpFlash = GUICtrlCreateInput("20", 110, 42, 70, 20)
	GUICtrlCreateLabel("Интервал (мс)", 10, 74, 99, 17)
	$inpTimeout = GUICtrlCreateInput("500", 110, 73, 70, 20)
	$btnFlash = GUICtrlCreateButton("Мигать", 190, 60, 99, 34, 0)
	GUISetState()

	While 1
		Switch GUIGetMsg()
			Case $GUI_EVENT_CLOSE
				Exit
			Case $btnFlash
				If $bFlashing Then
					_WinAPI_FlashWindowEx($hGUI, 0)
					$bFlashing = False
					GUICtrlSetData($btnFlash, "Мигать")
				Else
					$FlashRate = GUICtrlRead($inpFlash)
					$TimeoutRate = GUICtrlRead($inpTimeout)
					_WinAPI_FlashWindowEx($hGUI, 2, $FlashRate, $TimeoutRate)
					GUICtrlSetData($btnFlash, "Остановить")
					$bFlashing = True
				EndIf
		EndSwitch
	WEnd
EndFunc   ;==>_Main