Problem with Win32 Accelerators

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Problem with Win32 Accelerators

 
0
  #1
Jun 22nd, 2005
Hello,
I am developing an application in Win32, ( No MFC at all ). It is an MDI application, and I am using Keyboard accelerators. The Keys that I have assigned for accelerators are working properly, but when I press something that is not an accelerator, such as Ctrl + F ( which is not an accelerator in my program ), the application freezes. Also I am using the tab key to move between child windows in the MDI child documents, and these are also working properly.

Any idea why this can happen? The code is a bit lengthy so i will not post it. If you can give me any suggestion, that alone will help.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: Problem with Win32 Accelerators

 
0
  #2
Jun 22nd, 2005
It seems that the problem was with the use of IsDialogMessage( ) in the following loop.

  1. while(GetMessage(&Msg, NULL, 0, 0) > 0)
  2. {
  3. if (!TranslateMDISysAccel(hwndClient, &Msg) &&
  4. !TranslateAccelerator (hwndFrame, hAccel, &Msg) &&
  5. !IsDialogMessage( hwndClient, &Msg ))
  6. {
  7. TranslateMessage(&Msg);
  8. DispatchMessage(&Msg);
  9. }
  10. }
After I commented it out, the problem with accelerators was gone. But then obviously, I cant move among the child windows of an MDI Child Window without the IsDialogMessage() function. Any recommendations on how to solve this?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC