Hot Keys Of Menu In A Dialog Box
-
When I add a menu on a Dialog Box....the hot keys of menu did not work although i set the caption of menu item right such as "&Edit...\tCtrl+E". When I do the same work in SDI Appliaction...In single document Application it works fine....but when i made Dialog based application and design menu manually...here it not works..... I have checked the .rc file in SDI and here class wizard added more lines for Hot Keys like IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE BEGIN "N", ID_FILE_NEW, VIRTKEY, CONTROL END I added these lines in .rc of Dialog application but all in vain....any help Have a nice wishes for Helper:-O
-
When I add a menu on a Dialog Box....the hot keys of menu did not work although i set the caption of menu item right such as "&Edit...\tCtrl+E". When I do the same work in SDI Appliaction...In single document Application it works fine....but when i made Dialog based application and design menu manually...here it not works..... I have checked the .rc file in SDI and here class wizard added more lines for Hot Keys like IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE BEGIN "N", ID_FILE_NEW, VIRTKEY, CONTROL END I added these lines in .rc of Dialog application but all in vain....any help Have a nice wishes for Helper:-O
You'll have to override PreTranslateMessage in CYourDlg. Inside the function, call ::TranslateAccelerator.
BOOL CYourDlg::PreTranslateMessage(MSG* pMsg)
{
if (::TranslateAccelerator(m_hWnd, m_hAccelTable, pMsg))
{
return TRUE;
}return CDialog::PreTranslateMessage(pMsg);
}
Init m_hAccelTable in OnInitDialog - call LoadAccelerators. Tomasz Sowinski -- http://www.shooltz.com
-
You'll have to override PreTranslateMessage in CYourDlg. Inside the function, call ::TranslateAccelerator.
BOOL CYourDlg::PreTranslateMessage(MSG* pMsg)
{
if (::TranslateAccelerator(m_hWnd, m_hAccelTable, pMsg))
{
return TRUE;
}return CDialog::PreTranslateMessage(pMsg);
}
Init m_hAccelTable in OnInitDialog - call LoadAccelerators. Tomasz Sowinski -- http://www.shooltz.com
HACCEL LoadAccelerators( HINSTANCE hInstance, // handle to module LPCTSTR lpTableName // accelerator table name ); the prototype of LoadAccelerators is like how i can get lpTableName value....I dont know what to pass in 2nd parametre of function...Thanks foe early help. if u have any chat contact...i want to chat with u ...thanks.
-
You'll have to override PreTranslateMessage in CYourDlg. Inside the function, call ::TranslateAccelerator.
BOOL CYourDlg::PreTranslateMessage(MSG* pMsg)
{
if (::TranslateAccelerator(m_hWnd, m_hAccelTable, pMsg))
{
return TRUE;
}return CDialog::PreTranslateMessage(pMsg);
}
Init m_hAccelTable in OnInitDialog - call LoadAccelerators. Tomasz Sowinski -- http://www.shooltz.com
HACCEL LoadAccelerators( HINSTANCE hInstance, // handle to module LPCTSTR lpTableName // accelerator table name ); the prototype of LoadAccelerators is like how i can get lpTableName value....I dont know what to pass in 2nd parametre of function...Thanks foe early help.
-
You'll have to override PreTranslateMessage in CYourDlg. Inside the function, call ::TranslateAccelerator.
BOOL CYourDlg::PreTranslateMessage(MSG* pMsg)
{
if (::TranslateAccelerator(m_hWnd, m_hAccelTable, pMsg))
{
return TRUE;
}return CDialog::PreTranslateMessage(pMsg);
}
Init m_hAccelTable in OnInitDialog - call LoadAccelerators. Tomasz Sowinski -- http://www.shooltz.com