CToolBar 浮动时, 标题栏上的关闭 按钮按下时会响应什么消息? 我自定义一个工具条,当这个工具条浮动时,按下关闭按钮,会响应什么消息呢?我想截获这个消息,进行一些处理? 找了一上午资料,还未解决,郁闷中。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 www.codeproject.com/docking/disabletoolbarclose.asp 那个消息不是给toolbar的,而是给mindockframewnd,应该是toolbar的父窗口的父窗口 Yes, The message is being sent to CMiniFrameWnd 但我从CMiniFrameWnd继承了一个类,也没有收到WM_CLOSE WM_DESTROY消息啊 重载WM_PARENTNOTIFY消息,然后取消toolbar的WS_EX_NOPARENTNOTIFY属性(如果有的话),当toolbar建立或关闭时会向拥有toolbar的父窗口发送WM_PARENTNOTIFY消息...试试? 谢谢jiangsheng(蒋晟.Net[MVP])源码,但这是将右上角的关闭按钮Disable了,我是想要拦截该按钮的关闭消息, 谢谢大家的帮助 shl6894试了,也是收不到。我现在很怀疑我继承实现的的CMiniFrameWnd的类, 是不是写的有问题?将代码贴在下面,请大家帮忙看看。能帮忙试验一下最好,不胜感激!头文件:class CMiniFrameOwn : public CMiniFrameWnd{ DECLARE_DYNCREATE(CMiniFrameOwn)protected: CMiniFrameOwn(); // protected constructor used by dynamic creation// Attributespublic:// Operationspublic:// Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMiniFrameOwn) //}}AFX_VIRTUAL// Implementationprotected: virtual ~CMiniFrameOwn(); // Generated message map functions //{{AFX_MSG(CMiniFrameOwn) afx_msg void OnClose(); afx_msg void OnDestroy(); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); afx_msg void OnParentNotify(UINT message, LPARAM lParam); //}}AFX_MSG DECLARE_MESSAGE_MAP()};cppIMPLEMENT_DYNCREATE(CMiniFrameOwn, CMiniFrameWnd)CMiniFrameOwn::CMiniFrameOwn(){}CMiniFrameOwn::~CMiniFrameOwn(){}BEGIN_MESSAGE_MAP(CMiniFrameOwn, CMiniFrameWnd) //{{AFX_MSG_MAP(CMiniFrameOwn) ON_WM_CLOSE() ON_WM_DESTROY() ON_WM_LBUTTONUP() ON_WM_PARENTNOTIFY() //}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CMiniFrameOwn message handlersvoid CMiniFrameOwn::OnClose() { AfxMessageBox("Toolbar close!"); CMiniFrameWnd::OnClose();}void CMiniFrameOwn::OnDestroy() { CMiniFrameWnd::OnDestroy(); AfxMessageBox("Toolbar Destory!"); }void CMiniFrameOwn::OnLButtonUp(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default CMiniFrameWnd::OnLButtonUp(nFlags, point);}void CMiniFrameOwn::OnParentNotify(UINT message, LPARAM lParam){ AfxMessageBox("Toolbar Notify!");} 晕直接重CToolBar里继承呀,响应onclose消息,或者得写一个DockControlBar呀. VC++的进 Atl控件中使用WEBSERVICE技术打包问题 只想发出一个“咚”的一声音,不想用PlaySound播硬盘上的声音文件,能不能实现? toolbar控件只能够定位在四个边上吗? 数据库访问问题 如何对编写的软件进行自我检测 在98下如何编一个程序进入域登陆不显示域登陆对话框,500分相送谢谢 请问,有或者汉字编码的函数吗??? CFormView中如何实现CDialog::NextDlgCtrl()的功能 >>>>有关使用ado的疑问???????????? 同一对话框贴图2张 一张在另一张的区域内 怎么贴才不闪烁 new的问题
试试?
头文件:
class CMiniFrameOwn : public CMiniFrameWnd
{
DECLARE_DYNCREATE(CMiniFrameOwn)
protected:
CMiniFrameOwn(); // protected constructor used by dynamic creation// Attributes
public:// Operations
public:// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMiniFrameOwn)
//}}AFX_VIRTUAL// Implementation
protected:
virtual ~CMiniFrameOwn(); // Generated message map functions
//{{AFX_MSG(CMiniFrameOwn)
afx_msg void OnClose();
afx_msg void OnDestroy();
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnParentNotify(UINT message, LPARAM lParam);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};cppIMPLEMENT_DYNCREATE(CMiniFrameOwn, CMiniFrameWnd)CMiniFrameOwn::CMiniFrameOwn()
{
}CMiniFrameOwn::~CMiniFrameOwn()
{
}
BEGIN_MESSAGE_MAP(CMiniFrameOwn, CMiniFrameWnd)
//{{AFX_MSG_MAP(CMiniFrameOwn)
ON_WM_CLOSE()
ON_WM_DESTROY()
ON_WM_LBUTTONUP()
ON_WM_PARENTNOTIFY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CMiniFrameOwn message handlersvoid CMiniFrameOwn::OnClose()
{
AfxMessageBox("Toolbar close!");
CMiniFrameWnd::OnClose();
}void CMiniFrameOwn::OnDestroy()
{
CMiniFrameWnd::OnDestroy();
AfxMessageBox("Toolbar Destory!");
}void CMiniFrameOwn::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CMiniFrameWnd::OnLButtonUp(nFlags, point);
}
void CMiniFrameOwn::OnParentNotify(UINT message, LPARAM lParam)
{
AfxMessageBox("Toolbar Notify!");
}