I seem to be asking lots of questions recently, i am looking through Petzold and MSDN, so it's not like i'm totally slacking off
Anyway, I'm trying to use accelerators for menu hotkeys but for some reason I can't get it to work.
I added in:
at the beginning of WinMain(), and at the end I have:
Code:
hAccel = LoadAccelerators (hInst, TEXT("ACCEL"));
while( GetMessage( &lpMsg, NULL, 0, 0 ) ) /* begin the message loop */
{
if (!TranslateAccelerator (hWnd, (HACCEL)hAccel, &lpMsg))
{
TranslateMessage( &lpMsg );
DispatchMessage( &lpMsg );
}
}
return( lpMsg.wParam);
I made the accerlerator in MSVC++ and named it ACCEL, (in the same way I named my menu), i have several lines in the accelerator table each with an ID from my menu resource, but when i run the program none of the keys in the accelerator table do anything. What am I doing wrong?