//In class declaration (.H file ).private :CButton* m _pButton ;//In class implementation (.cpp file ) .m_pButton =new CButton ;ASSERT_VALID (m_pButton);m_pButton —>Create (_T ("Button Title ") , WS_CHILD |WS_VISIBLE |BS_PUSHBUTTON.Crect ( 0, 0, 100 , 24) , this , IDC _MYBUTTON )
解决方案 »
- 请帮我用VS2005(c++)做一个登录界面能够连MYSQL数据库
- 如何用MFC编程图像压缩的实现
- 程序运行时内存越来越大,关闭程序内存恢复原来大小
- 请问如何显示接收到的一贞jpg数据,不解码能否直接显示出来,或者用什么库能直接从数据显示?
- 寻求<用下载电缆实现AT89S5X的ISP编程>这文章的源代码~~~
- 求助,如何在界面上显示一张图片。
- 请问应该选择MSMQ还是Socket???????????????
- 新手请教:如何在SDI中创建子窗口的问题(急)
- 新手请教ActiveX问题。
- 如何判断SOCKADDR结构和SOCKADDR_IN结构的内容是否一样
- 关于picture控件的使用问题
- 请问如何拦截IP包,如果哪位大虾能指点在下,全部分(2000多)奉上
{
// TODO: Add your specialized code here and/or call the base class
//m_pButton 为按钮CButton实例变量。
if(pMsg->hwnd==m_pButton.m_hWnd){
if(pMsg->message==WM_LBUTTONUP){
CRect rect;
m_pButton.GetWindowRect(&rect);
if(rect.PtInRect(pMsg->pt)){ // add you code here
return true;
}
}
if(pMsg->message==WM_KEYDOWN){
// add you code here
return true;
}
}
//
//
return CDialog::PreTranslateMessage(pMsg);
}