我在一个多文档的工程中有点问题。

解决方案 »

  1.   

    我有多文档的程序上面有标签显示,类似于IE7的效果,我想在双击右边的treectrl(里面有文档的列表)的时候使标签做相应的变化。怎吗办,有谁用过guitoolkit么?
      

  2.   

    ::SendMessage(m_pMDIFrame->m_hWndMDIClient, WM_MDIACTIVATE, 
    static_cast<WPARAM>(文档索引), 0);
      

  3.   

    楼上的我想做的是点击某个文档,标签做变化。我现在实现的是点标签文档可以变化了。但是在点文档的时候,文档的view变化了但是标签没有相应得变化
      

  4.   

    终于搞定了。在codeproject上找到了解决办法。
    和大家分享
    I found the same problem and solved it like this. (I am not an expert, but this works for me!)1. Add code to the CGuiTabWnd::PreTranslateMessage function to intercept a WM_TIMER message (A timer is set by the author in the GuiMDITabbed.cpp file).2. Call the SetCurtab function to correctly set the active tab. I get the MainFrame's text and call SetCurtab to update the MDI tab.3. I have also added a string version of the SetCurtab function.BOOL CGuiTabWnd::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if (pMsg->message == WM_MOUSEMOVE)
    CToolTip.RelayEvent(pMsg);
    else if (pMsg->message == WM_TIMER)
    {
    //Custom code to catch WM_TIMER
    // and update the active tab
    CString strTitle;
    if (m_Numtabs > 1)
    {
    CWnd* pWnd = GetParent();
    if(pWnd != NULL && pWnd->GetSafeHwnd () != NULL)
    pWnd->GetWindowText(strTitle);
    //Change strTitle according to your application's main window frame's title
    //Now, update the MDI tab
    SetCurtab(strTitle);
    }
    }return CWnd::PreTranslateMessage(pMsg);
    }void CGuiTabWnd::SetCurtab(CString strTitle)
    {
    int nActiveTab = -1;
    for(int i = 0;i < m_Numtabs;i++)
    {
    CGuiTab* ctn=(CGuiTab*) m_pArray[i];
    if (ctn->lpMsg.CompareNoCase(strTitle) == 0)
    {
    nActiveTab = i;
    break;
    }
    }
    if (nActiveTab != -1)
    SetCurtab(nActiveTab);
    } Balaji Shankar