?
Solved

get paste and cut event in CEditView

Posted on 2003-04-01
4
Medium Priority
?
283 Views
Last Modified: 2013-11-20
In my program I must do something when do paste or cut in Editview.

But I found When Right mouse click in the view, it will show a pop menu which is not my menu. In the pop menu,it can paste and cut too! I can not detect the paste and cut event from the menu.

How can I get the event from the pop menu.
0
Comment
Question by:dead_fish
[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
  • 2
4 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 8244117
Try to handle WM_COPY and WM_PASTE messages in CEditView.
0
 

Author Comment

by:dead_fish
ID: 8244157
how?
0
 
LVL 12

Accepted Solution

by:
williamcampbell earned 375 total points
ID: 8248718
Use pretranslate message

BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
   if ((GetDlgItem(IDC_EDIT1)->GetSafeHwnd() == pMsg->hwnd) &&     
        ((pMsg->message == WM_COPY) || (pMsg->message == WM_PASTE) )
   {
         // Do you stuff here
         return TRUE; //don't process
   }
   else
   {
        // it's either not our box or another message...
        return CDialog::PreTranslateMessage(pMsg);
   }
}
0
 

Author Comment

by:dead_fish
ID: 8259099
I could not hands WM_CUT,WM_PASTE messages in PreTranslateMessage(MSG* pMsg) or


but I hands these in LRESULT CDsbView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam).
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

752 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