大家好,我用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。