You can register hotkeys like this:
jscript code:
Interop.Call("user32", "RegisterHotKey", _hotkey.Handle, ID, Mods, Key);
...where ID is a number relating to the action (so you can tell what combination was pressed later), Mods is the numerical representation of all modifiers you wish to use (in your case, Alt = 1), and Key is the code for the keys you wish to use (Q = 81, W = 87 - see my function below for generating key codes for letters).
Process key combinations using the message notification:
jscript code:
function OnWndHotkeyEvent_MessageNotification(PlusWnd, Message, wParam, lParam)
{
switch (wParam)
{
case 1:
// ...
break;
}
}
The wParam holds the ID you set when you registered the hotkey.
You will also need to unregister hotkeys (i.e. when the user signs out, or when Messenger is closed - whichever is more appropriate), otherwise they will not register next time.
jscript code:
Interop.Call("user32", "UnregisterHotKey", _hotkey.Handle, ID);
Use the same ID as when you registered them.
Also, is WM_HOTKEY (= 0x312) defined?
You can use this to convert letters and numbers to codes, and back again:
jscript code:
var Letters = "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");
var Count = 0x30;
var Codes = [];
for (var Letter in Letters)
{
if (Letters[Letter] !== " ")
{
Codes[Count] = Letters[Letter].toString();
Codes[Letters[Letter]] = Count;
}
Count++;
}
Use Codes['A'] or Codes['1'] to generate codes, or Codes[70] to convert back.