我在一个多文档的工程中有点问题。
解决方案 »
- wlan wpa(wep)验证
- 线程退出时绑定的socket端口号不释放
- 求助:VC++如何把截取图象输入Excel里呢
- 傻傻的问:一个连接成功的套节字能够使用多长时间?空闲上n长时间,能不能继续使用?
- --------------------------------------该如何跨类调用一个类实例-----(简单)----(急)--(优先级:0)--------------------
- CSplitterWnd:如何使分割条固定不动?
- vc快捷键
- 有关ADO, 快急死了!!!
- 明知道错了,却不知道怎样改,我好急!!!
- 求救!!!如何将char ch[m]转换为char ch[n],(m>=n)
- 主程序创建新的进程后失去焦点
- OnRButtonDown
static_cast<WPARAM>(文档索引), 0);
和大家分享
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