Solved

edit box problem

Posted on 2004-04-17
7
213 Views
Last Modified: 2013-11-20
while editing something in edit box, if I press "F5" key then I want to display another dialog box. how to get F5 is pressed while entering text in edit box?
0
Comment
Question by:rpatna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 6

Assisted Solution

by:joghurt
joghurt earned 20 total points
ID: 10848882
You'll need to subclass the edit control, or implement the PreTranslateMessage method.
0
 

Author Comment

by:rpatna
ID: 10849023
what to do in sub class?

I tryed in PreTranslateMessage, but not working.
0
 
LVL 4

Expert Comment

by:bkfirebird
ID: 10850112
derive a new CEdit class .... say CMyEdit ..... override the WM_KEYDOWN message and capture the F5
make your edit control a object of this new class ie CMyEdit m_editCtrl
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Accepted Solution

by:
Nass89 earned 30 total points
ID: 10851918
Hi,
You may use the following code to capture th F5 Key in EditBox:
//Use AppWizard and add PreTranslateMessage to Your Dialog.

BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
      // TODO: Add your specialized code here and/or call the base class
if(pMsg->message == WM_KEYDOWN)
     {
      long nID = ::GetDlgCtrlID(pMsg->hwnd);
      if(nID== IDC_EDIT1 && pMsg->wParam == VK_F5)
                    AfxMessageBox("F5 pressed");
  }
      
      return CDialog::PreTranslateMessage(pMsg);
}

Good Luck!
0
 
LVL 5

Expert Comment

by:Nass89
ID: 11131996
Hi,
My answer to the question works fine.
0
 
LVL 6

Expert Comment

by:joghurt
ID: 11132485
Just as ours.
0

Featured Post

Do you have a plan for Continuity?

It's inevitable. People leave organizations creating a gap in your service. That's where Percona comes in.

See how Pepper.com relies on Percona to:
-Manage their database
-Guarantee data safety and protection
-Provide database expertise that is available for any situation

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question