Hi各位,我自定义了toolbar并在menu里自建菜单项与之关联,通过响应菜单的Click和UPDATE_UI我现在可以在click菜单项的时候隐藏/显示工具条并且更新菜单的check状态. 但是反过来如果我手动关闭toolbar的时候怎么来把菜单项变成unchecked? 需要用到toolbar的什么消息吗?

解决方案 »

  1.   

    浮动工具栏关闭会有这个消息WM_RECALCPARENT
      

  2.   

    多谢提示! 我先try try see
      

  3.   

    [
    WM_RECALCPARENT This message is sent by a view to its parent window (obtained via GetParent) to force a layout recalculation (usually, the parent will call RecalcLayout). This is used in OLE server applications where it is necessary for the frame to grow in size as the view's total size grows.If the parent window processes this message it should return TRUE and fill the RECT passed in lParam with the new size of the client area. This is used in CScrollView to properly handle scrollbars (place then on the outside of the window when they are added) when a server object is in-place activated.
    ]貌似很复杂啊, WM_RECALCPARENT需要处理些什么, Elysium可不可以介绍下经验.
      

  4.   

    我在MainFrame里加上
    ON_MESSAGE(WM_RECALCPARENT, &CMainFrame::OnReCalcParent)但是似乎关浮动条的时候拦不到什么消息, 是否还有其他的办法?
      

  5.   

    http://download.csdn.net/source/777899