handling accelerator
-
Hi ! I have a SDI app, where I have defined an accelerator for the F3 key. In this app, I have a dialog window opened all the time, and i need the accelerator to be effective, even when the focus is on the dialog. I have tried to handle the VF_KEY (heu .. i am not sure about the name .. anyway, it is the "key message") in my dialog, and i then send post a message to the mainframe. Is there a better way to do it (because this one does not always work properly, sometimes the function is called twice, sometimes it is not handled by the overrided key function in the dialog). The function is supposed to toggle the dialog (enabling or disabling its being showed). ~RaGE();
-
Hi ! I have a SDI app, where I have defined an accelerator for the F3 key. In this app, I have a dialog window opened all the time, and i need the accelerator to be effective, even when the focus is on the dialog. I have tried to handle the VF_KEY (heu .. i am not sure about the name .. anyway, it is the "key message") in my dialog, and i then send post a message to the mainframe. Is there a better way to do it (because this one does not always work properly, sometimes the function is called twice, sometimes it is not handled by the overrided key function in the dialog). The function is supposed to toggle the dialog (enabling or disabling its being showed). ~RaGE();
-
Hi ! I have a SDI app, where I have defined an accelerator for the F3 key. In this app, I have a dialog window opened all the time, and i need the accelerator to be effective, even when the focus is on the dialog. I have tried to handle the VF_KEY (heu .. i am not sure about the name .. anyway, it is the "key message") in my dialog, and i then send post a message to the mainframe. Is there a better way to do it (because this one does not always work properly, sometimes the function is called twice, sometimes it is not handled by the overrided key function in the dialog). The function is supposed to toggle the dialog (enabling or disabling its being showed). ~RaGE();
i am assuming that the dialog is modeless ? just to give you somewhere to start looking CWinApp::Run() and maybe IsDialogMessage() TranslateMessage produces WM_CHAR messages only for keys that are mapped to ASCII characters by the keyboard driver. If applications process virtual-key messages for some other purpose, they should not call TranslateMessage. For instance, an application should not call TranslateMessage if the TranslateAccelerator function returns a nonzero value.