windows應用開發由淺入深(四)創建熱鍵消息

相關API:BOOL RegisterHotKey(   HWND hWnd,   int id,   UINT fsModifiers,   UINT vk );

MSDN描述:This function defines a system-wide hot key.  定義一個系統級的熱鍵。


相關消息:WM_HOTKEY

MSDN描述:This message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key.

                        當用戶按下熱鍵--用RegisterHotKey()註冊過的--時,會產生WM_HOTKEY消息。這個消息會放在註冊這個熱鍵的線程的消息隊列的頂端。


相關消息宏:ON_WM_HOTKEY()

相關消息函數:void OnHotKey(UINT nHotKeyId, UINT nKey1, UINT nKey2);


註冊熱鍵後,當用戶按下這一熱鍵,系統產生WM_HOTKEY消息給註冊熱鍵的窗口,窗口執行ONHotKey()響應。

發佈了32 篇原創文章 · 獲贊 14 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章