code:
var WM_USER = 0x0400;
var HK_GETKEY = (WM_USER+2);
var HK_SETKEY = (WM_USER+1);
function OnEvent_Initalize(bMessengerStart){
WndSubclass = MsgPlus.CreateWnd('myWindow.xml', 'myWindow', 2 /* Used to not activate the window */);
WndSubclass.RegisterMessageNotification(WM_HOTKEY); /* Register the hotkey message */
var lRet = Interop.Call('user32', 'RegisterHotKey', WndSubclass, 0x001, hibyte(dHotKey), lobyte(dHotKey));
}
function OnWndSubclassEvent_MessageNotification(pPlusWnd, nMessage, wParam, lParam){
switch(nMessage){
case WM_HOTKEY:
//Do whatever
break;
}
}
function lobyte(w){ return w & 0xff; }
function hibyte(w){ return w >> 8; }
This is the basics, now when you are setting the hotkey to the HotkeyControl you use HK_SetKey and to get the key you use HK_GetKey along with SendMessageW.