闪烁指定的窗口
#Include <WinAPI.au3>
_WinAPI_FlashWindowEx($hWnd [, $iFlags = 3 [, $iCount = 3 [, $iTimeout = 0]]])
$hWnd | 窗口句柄.窗口可以是打开的或最小化的 |
$iFlags | [可选参数] 闪烁状态.可以是一或多个下列值: 0 - 停止闪烁.系统恢复其原始状态窗口. 1 - 闪烁窗口标题 2 - 闪烁任务栏按钮 4 - 连续闪烁,直到停止 8 - 连续闪烁, 直至窗口出现在前台 |
$iCount | [可选参数] 窗口闪烁次数 |
$iTimeout | [可选参数] 闪烁速度得毫秒值.如果为 0, 函数使用默认闪烁速率 |
成功: | 返回 True |
失败: | 返回 False |
在MSDN中搜索
#include <WinAPI.au3>
#include <GUIConstantsEx.au3>
_Main()
Func _Main()
Local $hwnd, $Flash, $Timeout, $btnFlash, $msg, $flashrate, $timeoutrate, $flashing = False
$hwnd = GUICreate("Form1", 229, 170, 193, 125)
$Flash = GUICtrlCreateInput("20", 80, 72, 121, 21)
$Timeout = GUICtrlCreateInput("500", 80, 103, 121, 21)
GUICtrlCreateLabel("Please input the flash rate, and the time between flashes", 8, 24, 214, 41)
GUICtrlCreateLabel("Flash Rate:", 16, 72, 58, 17)
GUICtrlCreateLabel("Timeout (ms)", 16, 104, 64, 17)
$btnFlash = GUICtrlCreateButton("Flash Window", 80, 136, 75, 25, 0)
GUISetState(@SW_SHOW)
#endregion
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
Case $btnFlash
If $flashing Then
_WinAPI_FlashWindowEx($hwnd, 0)
$flashing = False
Else
$flashrate = GUICtrlRead($Flash)
$timeoutrate = GUICtrlRead($Timeout)
_WinAPI_FlashWindowEx($hwnd, 2, $flashrate, $timeoutrate)
GUICtrlSetData($btnFlash, "Stop Flashing")
$flashing = True
EndIf
EndSwitch
WEnd
EndFunc ;==>_Main