for the accelerator business, why not just do it at runtime? thats the way i always do it. then you really know what's going on in your code. here's an example:
Code:
ACCEL acc;
HACCEL accTable;
acc.cmd=ID_ACCEL; //whatever ID you want, #define it in header
acc.fVirt=FCONTROL | FVIRTKEY; //FVIRTKEY must be included
acc.key=65; //ASCII code for 'A'
accTable=CreateAcceleratorTable((LPACCEL)&acc,1);
while(GetMessage(&Msg, NULL, 0, 0) > 0)
{
if(!TranslateAccelerator(hwndMain, accTable, &Msg))
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
}
in my opinion its a better way to do it, and then you can also add more accelerators at runtime. keep in mind that the message is sent to whatever window has focus at the time, so you'll have to subclass any window that you want to be able to receive the message. a good idea is to forward all messages from child windows to the parent window, so that you only have to make the code once.