回复 4# Ycxw2008
看错问题了
再补充吧:
#include <WinAPIEx.au3>
#include <APIConstants.au3>
Global $bTrack
Global $m_hWnd = GUICreate('',200,200,400,400,$WS_VISIBLE+$WS_POPUP)
GUISetState()
GUIRegisterMsg($WM_MOUSEMOVE, "OnMouseMove")
GUIRegisterMsg($WM_MOUSELEAVE, "OnMouseLeave")
While GUIGetMsg() <> -3
Sleep(10)
WEnd
Func OnMouseMove($hWnd, $Msg, $wParam, $lParam)
If Not $bTrack Then
$bTrack = True
_WinAPI_TrackMouseEvent($hWnd, $TME_LEAVE)
EndIf
Return 0
EndFunc ;==>OnMouseMove
Func OnMouseLeave($hWnd, $Msg, $wParam, $lParam)
$bTrack = False
For $I = 5 To 1 Step -1
ToolTip($I & "秒后关闭窗口",400,400)
Sleep(1000)
Next
GUIDelete($hWnd)
Return 0
EndFunc ;==>OnMouseLeave
|