|
-
July 13th, 2004, 03:46 PM
#1
Accelerator causing conflict
Hi,
I have a WIN32 dialog based application with Accelerator for Menu & short cut key. My App have an amodal popup dialog with an Editbox control. When I do CTRL+C in the EditBox, the Accelerator trap the event and my main dialog receive the command
I know that I can right-click in my Editbox to display the Cut&Paste menu but I absolutetly need that short-key work for EditBox.
Any idea to solve the problem?
Thanks,
Michel.
-
July 13th, 2004, 04:33 PM
#2
Hi Michel,
PreTranslateMessage(...) may help. Here's a sample that hooks up F5 to a refresh function.
Jeff
Code:
////////////////////////////////////////////////////////
//
// Hook up F5 to Refresh
//
BOOL CDlg::PreTranslateMessage( MSG* pMsg ) {
if( pMsg->message == WM_KEYDOWN ) {
if( pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE ) {
// Do something
////////////////////////////////////////////////////////
//
// Any Non-Zero will do
//
return TRUE;
} else if( pMsg->wParam == VK_F5 ) {
////////////////////////////////////////////////////////
//
// Call our Refresh
//
RefreshListView();
////////////////////////////////////////////////////////
//
// Any Non-Zero will do
//
return TRUE;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|