Thread: hot keys in C++
View Single Post
  #4 (permalink)  
Old January 5th, 2006, 02:28 AM
Ankur_Verma Ankur_Verma is offline
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

U can catch WM_HOTKEY just like you did BN_CLICKED.
The WPARAM with WM_HOTKEY contains the id of hotkey
(the second parameter of RegisterHotKey, while
registring the hotkey) with which you can idenfiy
it and process it

    int Id = (int)wp;

    if (Id != KEYID)
    {
        AfxMessageBox("Not Caught");
        return 1;
    }
    AfxMessageBox("Caught");
    return 0;

Regards
Ankur Verma
Reply With Quote