我在CRichEdit控件中点击右键时生成了一个菜单,里面有复制和全选,但接下来却实不了不这两个操作,高手们指点下
解决方案 »
- char ans[128]; 被赋值后如何再次初始化?
- 注册表函数ERROR_ACCESS_DENIED很烦人
- 那个朋友可以提供一个画曲线的例子?
- 制作word2000插件的问题,头疼中,在线等待大虾(100分)
- 怎样"同时"将一个Combo Box和List Box加入一个视图中进行操作?
- EXELOCK软件很有趣,如何用VC来实现他呢?能否给些提示?
- 高分请教CPropertySheet中的CTabCtrl问题
- 请问一个Vc++ 下ODBC编程的问题
- *****谁有关于pc机采集数据的驱动程序资料****
- 谁知道任务栏(就是“开始”那一条)的位置和大小如何得到,谢谢!
- 如何存取数据到EXE自身之中?
- 我用VC2005,写了很简单的MFC程序,我怎么在没有装VC电脑上运行呢?
还有就是,当我选中后,按右键时,选中的文本也就没蓝底,这些问题要怎么解决呢
#if !defined(AFX_MYRICHEDIT_H__FCCA69DA_B946_41E2_9D28_FDF410CADD1B__INCLUDED_)
#define AFX_MYRICHEDIT_H__FCCA69DA_B946_41E2_9D28_FDF410CADD1B__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MyRichEdit.h : header file
///////////////////////////////////////////////////////////////////////////////
// CMyRichEdit windowclass CMyRichEdit : public CRichEditCtrl
{
// Construction
public:
CMyRichEdit();// Attributes
public:// Operations
public:// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyRichEdit)
//}}AFX_VIRTUAL// Implementation
public:
virtual ~CMyRichEdit(); // Generated message map functions
protected:
//{{AFX_MSG(CMyRichEdit)
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnCopy() { Copy(); }
afx_msg void OnCut() { Cut(); }
afx_msg void OnPaste() { Paste(); }
afx_msg void OnSelectall() { SetSel(0, -1); }
// afx_msg void OnUndo() { Undo(); }
afx_msg void OnClear() { Clear(); }
afx_msg void OnSelectfont();
//}}AFX_MSG DECLARE_MESSAGE_MAP()
};///////////////////////////////////////////////////////////////////////////////{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_MYRICHEDIT_H__FCCA69DA_B946_41E2_9D28_FDF410CADD1B__INCLUDED_)#if !defined(AFX_MYRICHEDIT_H__FCCA69DA_B946_41E2_9D28_FDF410CADD1B__INCLUDED_)
#define AFX_MYRICHEDIT_H__FCCA69DA_B946_41E2_9D28_FDF410CADD1B__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MyRichEdit.h : header file
///////////////////////////////////////////////////////////////////////////////
// CMyRichEdit windowclass CMyRichEdit : public CRichEditCtrl
{
// Construction
public:
CMyRichEdit();// Attributes
public:// Operations
public:// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyRichEdit)
//}}AFX_VIRTUAL// Implementation
public:
virtual ~CMyRichEdit(); // Generated message map functions
protected:
//{{AFX_MSG(CMyRichEdit)
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnCopy() { Copy(); }
afx_msg void OnCut() { Cut(); }
afx_msg void OnPaste() { Paste(); }
afx_msg void OnSelectall() { SetSel(0, -1); }
// afx_msg void OnUndo() { Undo(); }
afx_msg void OnClear() { Clear(); }
afx_msg void OnSelectfont();
//}}AFX_MSG DECLARE_MESSAGE_MAP()
};///////////////////////////////////////////////////////////////////////////////{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_MYRICHEDIT_H__FCCA69DA_B946_41E2_9D28_FDF410CADD1B__INCLUDED_)
SendMessage(hwnd, WM_COMMAND, IDM_SELECTALL, NULL);
SendMessage(hwnd, WM_COMMAND, IDM_COPY, NULL);
由TrackPopupMenu得到菜单项,发送消息,使用系统消息处理
全选粘贴系统有完善的操作