Quote:
Originally posted by bytz
If the Accelerator keys are being sent to the dialog you can either handle them there, or Send them to the mainframe.
Generally, if the dialog is modal, it should not allow (handle) any commands that are not relavant to it, in other words, if you have a modal dialog getting information from the user, you do not want it to Send the message to the mainframe.
If the dialog is modaless, Sending the command to the mainframe may be a good solution IF it makes sense.
How do i send the command to the mainframe? I tried using the PreTranslateMessage() function to handle the message and then call the correct functions in mainframe from the window in focus. However this solution have a problem because some functions called by the window (using the accelerator keys and handled in PreTranslateMessage) will need to close all windows using CDialog::OnOK. This will cause the application to crash since the function call is made in the PreTanslateMessage function of the window in focus.