the RegisterHotKey() is limited?
everytime that i create a button control the RegisterHotKey() id isn't the same.
//on constructor:
++ButtonCount;
altmessage=ButtonCount;
now the hotkey message:
case WM_HOTKEY:
{
if (wParam==inst->altmessage)
{
SendMessage(inst->hwnd,WM_COMMAND,BN_CLICKED,lParam);
}
}
break;
and now how i regist the hot key:
case WM_DRAWITEM:
{
DRAWITEMSTRUCT *test=(DRAWITEMSTRUCT*) lParam;
UnregisterHotKey(inst->hwnd,inst->altmessage);
RegisterHotKey(inst->hwnd,inst->altmessage,MOD_ALT,inst->altkey);
inst is the button object pointer.
the 1st button that it's created, the alt+altkey is working fine. but the 2nd button is ignored, why?