搜索了一下这个lParam:
http://www.kmonos.net/repos/qbga32/ci/c2b7a98c21?sbs=0 wrote:+// #if (_WIN32_IE >= 0x0501)
+enum : uint { NIN_BALLOONSHOW = WM_USER + 2 }
+enum : uint { NIN_BALLOONHIDE = WM_USER + 3 }
+enum : uint { NIN_BALLOONTIMEOUT = WM_USER + 4 }
+enum : uint { NIN_BALLOONUSERCLICK = WM_USER + 5 }
+// #endif
加个 ToolTip 可以看到其他有意思的 lParam 参数:
Code: Select all
TrayTip, AutoHotkey, Click Me, 10
Return
; 检测托盘气泡的点击
TB_HIDEBUTTON(wParam, lParam, msg, hwnd) {
static WM_USER := 0x400
static _______ := OnMessage(WM_USER + 4, "TB_HIDEBUTTON")
static log
ToolTip, % ( log .= lParam "`n" )
If (lParam = 1029)
{
MsgBox TrayTip Click`, AutoHotkey will now exit
ExitApp
}
}
http://bbs.csdn.net/topics/90141544#post-62799961 wrote:Integer WM_LBUTTONDOWN = 513 // 在托盘图标点击左键
Integer WM_RBUTTONDOWN = 516 // 在托盘图标点击右键
Integer WM_MBUTTONDOWN = 519 // 在托盘图标点击中键
Integer NIN_BALLOONSHOW = 1026 //当 Balloon Tips 弹出
Integer NIN_BALLOONHIDE = 1027 //当 Balloon Tips 消失(如 SysTrayIcon 被删除),但指定的 TimeOut 时间到或鼠标点击 Balloon Tips 后的消失不发送此消息
Integer NIN_BALLOONTIMEOUT = 1028 // 当 Balloon Tips 的 TimeOut 时间到
Integer NIN_BALLOONUSERCLICK = 1029 //当鼠标点击 Balloon Tips
//注意:在XP下执行时 Balloon Tips 上有个关闭按钮,
//如果鼠标点在按钮上将接收到 NIN_BALLOONTIMEOUT 消息。
static _______ := OnMessage(WM_USER + 4, "TB_HIDEBUTTON") 这样的写法方便多了,OnMessage 跟函数分两个地方写太麻烦。