Click here to Skip to main content
15,891,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Webbrowser control annoying security alert dialogs Pin
Todd Smith20-Feb-03 8:14
Todd Smith20-Feb-03 8:14 
GeneralRe: Webbrowser control annoying security alert dialogs Pin
GriffonRL20-Feb-03 21:30
GriffonRL20-Feb-03 21:30 
GeneralRe: Webbrowser control annoying security alert dialogs Pin
Todd Smith21-Feb-03 6:21
Todd Smith21-Feb-03 6:21 
GeneralRe: Webbrowser control annoying security alert dialogs Pin
GriffonRL23-Feb-03 20:57
GriffonRL23-Feb-03 20:57 
Generalhotkeys on a dialog Pin
Qadddd20-Feb-03 5:24
Qadddd20-Feb-03 5:24 
GeneralRe: hotkeys on a dialog Pin
Iain Clarke, Warrior Programmer20-Feb-03 6:14
Iain Clarke, Warrior Programmer20-Feb-03 6:14 
GeneralRe: hotkeys on a dialog Pin
Qadddd24-Feb-03 4:34
Qadddd24-Feb-03 4:34 
GeneralRe: hotkeys on a dialog Pin
Qadddd24-Feb-03 6:55
Qadddd24-Feb-03 6:55 
yes, it works but ... what happens when I defined several keys combinations in my accelerator, as it can be considered as a table of keystrokes.
I loaded my accelerator table in the OnInitDialog() :
m_hAccelTable = LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ACCELERATOR1));
These special keystroke can be recognized in the override routine :
BOOL CDialogDlg::PreTranslateMessage(MSG* pMsg)
if (m_hAccelTable) {
if (::TranslateAccelerator(m_hWnd, m_hAccelTable, pMsg)) {
return(TRUE);
}
}
return CDialog::PreTranslateMessage(pMsg);
}
What I understood is that, when ::TranslateAccelerator recognizes a keystroke existing in accelerator, it send a WM_COMMAND message.
Then, using class wizard, I created a routine corresponding to dialog IDR_ACCELERATOR1-WM_COMMAND message:
void CDialogDlg::OnAccelerator1()
{
GetDlgItem(IDC_EDIT3)->SetFocus(); //special keystroke => set focus here
}
It works, but how can I perform different actions depending on keystroke?
Can I get the keystroke or is there any way to distinguish them?
Should I have several Accelerator and load them all and perform the ::TranslateAccelerator on each of them?
Could you still give me some help on this?
Thanks in advance
DD
GeneralRe: hotkeys on a dialog Pin
Iain Clarke, Warrior Programmer25-Feb-03 0:41
Iain Clarke, Warrior Programmer25-Feb-03 0:41 
GeneralRe: hotkeys on a dialog Pin
Qadddd26-Feb-03 23:20
Qadddd26-Feb-03 23:20 
GeneralPort forwarding Pin
User 988520-Feb-03 4:59
User 988520-Feb-03 4:59 
GeneralRe: Port forwarding Pin
User 988520-Feb-03 5:10
User 988520-Feb-03 5:10 
GeneralRe: Port forwarding Pin
Anonymous20-Feb-03 10:01
Anonymous20-Feb-03 10:01 
GeneralRe: Port forwarding Pin
User 988520-Feb-03 10:12
User 988520-Feb-03 10:12 
GeneralRe: Port forwarding Pin
User 988520-Feb-03 10:13
User 988520-Feb-03 10:13 
GeneralSlider control Pin
jimNLX20-Feb-03 4:35
jimNLX20-Feb-03 4:35 
GeneralRe: Slider control Pin
valikac20-Feb-03 7:32
valikac20-Feb-03 7:32 
GeneralDeriving MFC Class for DLL, instantiating in Visual Basic Pin
DigitalSabre20-Feb-03 4:31
DigitalSabre20-Feb-03 4:31 
GeneralRe: Deriving MFC Class for DLL, instantiating in Visual Basic Pin
Anna-Jayne Metcalfe20-Feb-03 4:53
Anna-Jayne Metcalfe20-Feb-03 4:53 
Generalget keyboard events Pin
Willem B20-Feb-03 4:21
Willem B20-Feb-03 4:21 
GeneralRe: get keyboard events Pin
Michael Shuster20-Feb-03 4:50
Michael Shuster20-Feb-03 4:50 
GeneralRe: get keyboard events Pin
HENDRIK R20-Feb-03 4:52
HENDRIK R20-Feb-03 4:52 
GeneralRe: get keyboard events Pin
Willem B20-Feb-03 21:11
Willem B20-Feb-03 21:11 
GeneralGetting focus for modeless dialogs in a controlbar. Pin
Maximilien20-Feb-03 4:17
Maximilien20-Feb-03 4:17 
GeneralProb converting Hex to CString Pin
afender20-Feb-03 4:14
afender20-Feb-03 4:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.