本帖最后由 jiarqq 于 2021-5-13 17:05 编辑 #include <WinAPI.au3>
Opt("TrayMenuMode", 1) ;1 = 没有默认菜单; 0 =(默认值)脚本暂停/退出菜单
Opt("TrayIconDebug", 1) ;1 = 显示调试信息; 0 = (默认值)不显示调试信息
OnAutoItExitRegister('OnAutoItExit')
$hEventProc = DllCallbackRegister('_WinEventHook_Proc', 'none', 'ptr;dword;hwnd;long;long;dword;dword')
$hEventHook = _WinAPI_SetWinEventHook($EVENT_OBJECT_CREATE, $EVENT_OBJECT_CREATE, DllCallbackGetPtr($hEventProc))
TraySetClick(8)
Local $Exit = TrayCreateItem("退出(&T)")
While 1
Switch TrayGetMsg()
Case $Exit
Exit
EndSwitch
WEnd
Func OnAutoItExit()
_WinAPI_UnhookWinEvent($hEventHook)
DllCallbackFree($hEventProc)
EndFunc ;==>OnAutoItExit
Func _WinEventHook_Proc($h_Hook, $iEvent, $hWnd, $idObject, $idChild, $iEventThread, $iEventTime)
<blockquote><span style="white-space:pre"> </span>$hWnd_ViewFolder = WinWait('浏览文件夹','',1)
|