回复 2# user3000
P版的代码如下没有include其它啊,难道与au3内置的函数冲突了?#NoTrayIcon
#include <RTApiHook32.au3>
$iPid = ProcessExists("QQ.exe")
$hProcess = _RTOpenProcess($iPid)
$pShell_NotifyIcon = _RTGetProcAddress("Shell32.dll", "Shell_NotifyIcon")
$pShell_NotifyIconA = _RTGetProcAddress("Shell32.dll", "Shell_NotifyIconA")
$pShell_NotifyIconW = _RTGetProcAddress("Shell32.dll", "Shell_NotifyIconW")
$hCallBack = DllCallBackRegister("_Shell_NotifyIcon_CallBack", "dword", "handle;ptr")
$pCallBack = DllCallBackGetPtr($hCallBack)
$tShell_NotifyIcon = _RTApiHookEx($hProcess, $pShell_NotifyIcon, 2, $pCallBack)
$tShell_NotifyIconA = _RTApiHookEx($hProcess, $pShell_NotifyIconA, 2, $pCallBack)
$tShell_NotifyIconW = _RTApiHookEx($hProcess, $pShell_NotifyIconW, 2, $pCallBack)
While _RTWaitForObject($hProcess, 1)
WEnd
DllCallBackFree($hCallBack)
Func _Shell_NotifyIcon_CallBack($hProcess, $pCallInfo)
If (_RTApiHookReadParam($hProcess, $pCallInfo, 1, "dword") = 1) Then
Return $APIHOOK_Flags_Call_Abort
EndIf
EndFunc ;==>_Shell_NotifyIcon_CallBack
|