回复 2# xms77
论坛上有过示例:
;http://msdn.microsoft.com/en-us/ ... lags
);
#ce
;(v=vs.85).aspx
;http://msdn.microsoft.com/en-us/library/aa376890(v=vs.85).aspx
GUIRegisterMsg(0x0011, "WindowProc") ; WM_QUERYENDSESSION
GUIRegisterMsg(0x0016, "WindowProc") ; WM_ENDSESSION
#cs
#define WM_QUERYENDSESSION 0x0011
#define WM_ENDSESSION 0x0016
#ce
#cs
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // not used
LPARAM lParam // logoff option
);
#ce
GUICreate("test")
$Edit = GUICtrlCreateEdit("", 50, 35, 300, 330)
GUISetSTate()
Do
Until GUIGetMsg() = -3
Func WindowProc($hWnd, $MsgID, $WParam, $LParam)
GUICtrlSetData($Edit,GUICtrlRead($Edit) & "Time: " & StringFormat("%2d:%2d:%2d",@HOUR,@MIN,@SEC) & @CRLF& "Msg: 0x" & Hex($MsgID) & @CRLF& "LParam: 0x" & Hex($LParam) & @CRLF)
Return False
EndFunc
|