Menu

How to trap WM_KEYDOWN in MDIFrame or MDIClient

2023-03-06
2023-03-07
  • Gianni Rossi

    Gianni Rossi - 2023-03-06

    Hello everyone,
    I'm still maintaining an old BC++ 5.02 - OWL MDI application and want to manage the WM_KEYDOWN Windows message as soon as the application starts in order to get the F1 key opening the user's guide. Unfortunately both TDecoratedFrame and TMDIClient don't receive the message in their event trapping function EvKeyDown.
    Any help will be greatly apprecieted.
    Thank in advance.

    Gianni

     
  • Vidar Hasfjord

    Vidar Hasfjord - 2023-03-06

    Hi Gianni,

    If you already have a menu command for opening the user guide, then adding a keyboard accelerator for that command is probably the easiest way to go — see my posts about this in [discussion:9c4e63e6c5].

    Alternatively, then handling the WM_HELP message is a better option than low-level keyboard message handling, I guess. For example, see THelpFileManager and THelpFileManager::EvHelp.

     

    Related

    Discussion: 9c4e63e6c5

  • Gianni Rossi

    Gianni Rossi - 2023-03-07

    Hi Vidar,
    Yes, simply adding the menu command with the F1 keyboard accelerator solved the problem.
    Many thanks for your always great help.

     
    👍
    1

Anonymous
Anonymous

Add attachments
Cancel