请问在CEdit中只按下Ctrl,会有什么事件? rt 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 县派生CEdit类然后在派生类处理WM_KEYDOWN消息函数判断当按键式 CTRL的时候是干啥 #if !defined(AFX_MYEDIT_H__AA01B7BD_793C_4757_AF32_0624AFAB3DF8__INCLUDED_)#define AFX_MYEDIT_H__AA01B7BD_793C_4757_AF32_0624AFAB3DF8__INCLUDED_#if _MSC_VER > 1000#pragma once#endif // _MSC_VER > 1000// Myedit.h : header file///////////////////////////////////////////////////////////////////////////////// Myedit windowclass Myedit : public CEdit{// Constructionpublic: Myedit();// Attributespublic:// Operationspublic:// Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(Myedit) public: virtual BOOL PreTranslateMessage(MSG* pMsg); //}}AFX_VIRTUAL// Implementationpublic: virtual ~Myedit(); // Generated message map functionsprotected: //{{AFX_MSG(Myedit) afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); //}}AFX_MSG DECLARE_MESSAGE_MAP()};///////////////////////////////////////////////////////////////////////////////{{AFX_INSERT_LOCATION}}// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_MYEDIT_H__AA01B7BD_793C_4757_AF32_0624AFAB3DF8__INCLUDED_) // Myedit.cpp : implementation file//#include "stdafx.h"#include "dlg.h"#include "Myedit.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// MyeditMyedit::Myedit(){}Myedit::~Myedit(){}BEGIN_MESSAGE_MAP(Myedit, CEdit) //{{AFX_MSG_MAP(Myedit) ON_WM_KEYDOWN() ON_WM_KEYUP() //}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// Myedit message handlersvoid Myedit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { //if(nChar==VK_CONTROL) //MessageBox("OnKeyDown--VK_CONTROL",0,MB_OK); CEdit::OnKeyDown(nChar, nRepCnt, nFlags);}void Myedit::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) { //if(nChar==VK_CONTROL) //MessageBox("OnKeyUp--VK_CONTROL",0,MB_OK); CEdit::OnKeyUp(nChar, nRepCnt, nFlags);}BOOL Myedit::PreTranslateMessage(MSG* pMsg) {if(pMsg->wParam==VK_CONTROL )MessageBox("PreTranslateMessage--VK_CONTROL",0,MB_OK); return CEdit::PreTranslateMessage(pMsg);} VC如何实现网页自动填表 暑假想找兼职或者实习,大家看看。 30号晚上回家堵车,原来是因为收费站!!! VC-MFC下如何使用水晶报表,以及关于水晶报表的概念问题,谢谢! dll里面如何初始化ado阿? 请问是否有一种方法,让我的程序一有异常对话框弹出就让我的程序自动重新启动呢?! 如果找到LISTCTRL中的一行呢? 据说是国内最权威的职业测评,你也来测试一下吧 vs2008开发wince平台程序 建立VC的CLI工程,能否生成静态库? 翻译了5篇---Doxygen使用教程,欢迎大家阅读并提出修改建议 现时图片?
#define AFX_MYEDIT_H__AA01B7BD_793C_4757_AF32_0624AFAB3DF8__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Myedit.h : header file
///////////////////////////////////////////////////////////////////////////////
// Myedit windowclass Myedit : public CEdit
{
// Construction
public:
Myedit();// Attributes
public:// Operations
public:// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(Myedit)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
//}}AFX_VIRTUAL// Implementation
public:
virtual ~Myedit(); // Generated message map functions
protected:
//{{AFX_MSG(Myedit)
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
//}}AFX_MSG DECLARE_MESSAGE_MAP()
};///////////////////////////////////////////////////////////////////////////////{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_MYEDIT_H__AA01B7BD_793C_4757_AF32_0624AFAB3DF8__INCLUDED_)
//#include "stdafx.h"
#include "dlg.h"
#include "Myedit.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// MyeditMyedit::Myedit()
{
}Myedit::~Myedit()
{
}
BEGIN_MESSAGE_MAP(Myedit, CEdit)
//{{AFX_MSG_MAP(Myedit)
ON_WM_KEYDOWN()
ON_WM_KEYUP()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// Myedit message handlersvoid Myedit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
//if(nChar==VK_CONTROL)
//MessageBox("OnKeyDown--VK_CONTROL",0,MB_OK);
CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
}void Myedit::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{ //if(nChar==VK_CONTROL)
//MessageBox("OnKeyUp--VK_CONTROL",0,MB_OK);
CEdit::OnKeyUp(nChar, nRepCnt, nFlags);
}BOOL Myedit::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->wParam==VK_CONTROL )
MessageBox("PreTranslateMessage--VK_CONTROL",0,MB_OK);
return CEdit::PreTranslateMessage(pMsg);
}