大家好,我用PreTranslateMessage(MSG* pMsg)去实现一个button按下和弹起(WM_LBUTTONDOWN和WM_LBUTTONUP)的功能,代码如下:
BOOL CZM30XDemoApp::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
int buID;
buID= GetWindowLong(pMsg->hwnd,GWL_ID);//ÓÉ´°¿Ú¾ä±ú»ñµÃIDºÅ£¬GetWindowLongΪ»ñµÃ´°¿ÚµÄIDºÅ¡£ if(pMsg->message==WM_LBUTTONDOWN)
{
if(buID==IDC_BUTTON_TEST_BUTTON)
{
//**************************************
}
}
if(pMsg->message==WM_LBUTTONUP)
{
if(buID==IDC_BUTTON_TEST_BUTTON)
{
//**************************************
}
}
return CWinApp::PreTranslateMessage(pMsg);
}
我想在//**************************************行调用CZM30XDemoDlg类的成员,如何去做呢,在线等待,不甚感激!
注:创建的工程是MFC AppWizard(exe)->Dialog based。
BOOL CZM30XDemoApp::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
int buID;
buID= GetWindowLong(pMsg->hwnd,GWL_ID);//ÓÉ´°¿Ú¾ä±ú»ñµÃIDºÅ£¬GetWindowLongΪ»ñµÃ´°¿ÚµÄIDºÅ¡£ if(pMsg->message==WM_LBUTTONDOWN)
{
if(buID==IDC_BUTTON_TEST_BUTTON)
{
//**************************************
}
}
if(pMsg->message==WM_LBUTTONUP)
{
if(buID==IDC_BUTTON_TEST_BUTTON)
{
//**************************************
}
}
return CWinApp::PreTranslateMessage(pMsg);
}
我想在//**************************************行调用CZM30XDemoDlg类的成员,如何去做呢,在线等待,不甚感激!
注:创建的工程是MFC AppWizard(exe)->Dialog based。
解决方案 »
- 用IWebBrowser2获取网址,会多次调用Invoke得到多个网址
- 给个方向
- 打开别人VC2005源码,发现注解是乱码。繁体的。。怎么解决?
- 如何动态改变视类背景图片
- 如果你是新手,高手,穷者,富者。对你绝对有益,超值下载
- web应用服务器组件资源如何释放
- 如何用VC调用其它EXE文件(函数是什么?)
- ******* 有关短消息的, 有经验的请进. 高分回报 ******
- 有能力用VC++编写点云三角剖分建模的高手请进。
- 在SDI中不能引用ActiveX控件的事件处理句柄吗?
- 用vs2008编译成的dll在xp上调用会出现应用程序初始化失败
- 用import来引入一个dll的话,为什么没有产生.h/.cpp文件?
BOOL CZM30XDemoDlg::PreTranslateMessage(MSG* pMsg)
m_pMainWnd = &dlg;
dlg.DoMoal();因此可以使用 ((CXXXYouDlgClass *)m_pMainWnd)-> 来访问
原CWinApp::中的删除。