I'm writing a control panel that uses a modeless dialog box as its main
window. Somehow I can't seem to trap the accelerator keys. Here's the
beginning part:
case CPL_DBLCLK:
CreateDialog(hinst, MAKEINTRESOURCE(IDD_MAIN), hwndCPl,
(DLGPROC)DialogProc);
hAccelTable = LoadAccelerators(hinst, MAKEINTRESOURCE(IDR_ACCELERATOR));
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
break;
Then in the DialogProc, I try to get the message:
switch(uMsg)
{
.
.
case WM_COMMAND:
switch(LOWORD(wParam))
{
.
.
case IDM_MYMENUITEM:
MessageBox(GetFocus(), "Hello", "Test", MB_OK);
break;
}
break;
It doesn't work, though. What am I missing?Quote:}
Thanks,
Dave Herman
http://www.microcosm.com/~dave
To e-mail me, delete the underscore
at the end of my e-mail address.