![]() |
Accelerators within a dialog |
Post Reply ![]() |
Author | |
Uwe Keim ![]() Newbie ![]() Joined: 01 November 2004 Location: Germany Status: Offline Points: 29 |
![]() ![]() ![]() ![]() ![]() Posted: 29 June 2005 at 4:33am |
Scenario: A SDI application, having several modal dialog boxes with local CodeJock menubars, toolbars, statusbars. No I want to add accelerators to the menu items in the dialog. I managed to do it the way I found it in the "DialogSample" in the "%PROGRAM_FILES\Codejock Software\MFC\Xtreme Toolkit Pro v9.60\Samples\CommandBars\DialogSample" folder. What I am missing: In the main window of my SDI application, the CodeJock library automatically writes the actual shortcuts beside the menu items. Whereas in the "DialogSample" application they are hardcoded in the IDR_MAINFRAME resource. Question: Is it possible to "tell" a menubar which accelerator-resource to use and let the menubar do all the accelerator-handling (include writing to the menu items and command routing) from within a child dialog box? Thanks |
|
![]() |
|
bevpet ![]() Newbie ![]() ![]() Joined: 01 April 2005 Location: Canada Status: Offline Points: 39 |
![]() ![]() ![]() ![]() ![]() |
try this declare oin .h HACCEL m_hAccel; add your your dlg.cpp: CMyDlg::CMyDlg() : CDialog(CMyDlg::IDD, 0) { //{{AFX_DATA_INIT(CMyDlg) ... ... m_hAccel = ::LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_MY_DLG_ACCELERATORS)); ... } where: IDR_MY_DLG_ACCELERATORS = your accelerator table you wish to associate with the dlg. HTH
|
|
![]() |
|
Uwe Keim ![]() Newbie ![]() Joined: 01 November 2004 Location: Germany Status: Offline Points: 29 |
![]() ![]() ![]() ![]() ![]() |
bevpet, thank you, but this is from the example as I'm already doing. |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |