Re: REPOST: Proper way to code Accelerators
On Tue, 28 Nov 2006 00:35:39 +0000, David Lowndes
<DavidL@example.invalid> wrote:
I have an Accelerator Table and none of the keys are working... Its
an old program being ported upwards.
I've tried most every combination above and none of them are
working...
if( (_hAccel = LoadAccelerators(_hInst, "PROGRAM_NAME")) == NULL)
{
MsgBox(_hInst, NULL, IDS_ERR_ACCEL, _szAppName,
MB_ICONEXCLAMATION | MB_OK | MB_TASKMODAL);
return(FALSE);
}
Again, no error is reported on LoadAccelerator(), no message is
display... just the keys are not working... I figured I must be
missing something on configuring the Ctrl+Key combination.
Phil,
Presumably the code worked before the port (to 32-bit)? If so, what
else has changed that might be affecting the keyboard handling?
What do you do with the _hAccel variable after loading the table?
Have you added any new code, or deleted any old code?
Have you had to subtly (or not so subtly) alter code? Are those
changes working correctly?
Dave
Hi Dave!
Rearranged some menu items, added a few new pulldowns, added a toolbar
things of that nature... all changes are working fine just the
Accelerators.
_hAccel is a global and is used as:
while(GetMessage(&msg, NULL, 0, 0))
{
if(TranslateAccelerator(_hWndMain, _hAccel, &msg))
continue;
[snip]
}
===============================================
half frog half prince at oohay dot com
===============================================