Print Page | Close Window

How to save CXTPTabClientWnd state?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=3864
Printed Date: 08 September 2025 at 8:01pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to save CXTPTabClientWnd state?
Posted By: sion
Subject: How to save CXTPTabClientWnd state?
Date Posted: 24 March 2006 at 11:10am
HI~
When the application to be closed,How to save CXTPTabClientWnd state.
CXTPTabClientWnd::SaveState()?




Replies:
Posted By: sion
Date Posted: 02 April 2006 at 12:16pm

Help me please~


Posted By: Oleg
Date Posted: 03 April 2006 at 7:42am

SaveState saves only positon og Tabs. Where is no way for CXTPTabClientWnd  to save/restore actual window childs.

You must manually save childs and reopen in startup, CXTPTabClientWnd  will automatically create tabs for them.

Hint code:

 

void CMainFrame::OnClose()
{

 

  CWnd* pMDIClient = CWnd::FromHandle(m_hWndMDIClient);
  CChildFrame* pWnd = (CChildFrame*) pMDIClient->GetDlgItem(nIndex);

  while (pWnd)
  {
   CStylerView* pView = (CStylerView*)pWnd->GetActiveView();
   ASSERT(pView);   

   if (pView) strPopups += pView->GetDocument()->GetCurrentUrl() + ";";
   
   pWnd = (CChildFrame*) pMDIClient->GetDlgItem(++nIndex);
  }
  
  AfxGetApp()->WriteProfileString(_T("MainFrame "), _T("LastVisited"), strPopups);
  
 }

 CMDIFrameWnd::OnClose();
}

 

void CMainFrame::OpenLastVisited()
{
 CString strBuffer = AfxGetApp()->GetProfileString(_T("MainFrame"), _T("LastVisited"));
 
 if (!strBuffer.IsEmpty())
 {
  LPTSTR pBuffer = strBuffer.GetBuffer(0);
  
  TCHAR* token = _tcstok(pBuffer, _T(";"));  
  while (token)
  {
   OpenWindow(token);
   token = _tcstok( NULL, _T(";"));
  }  
 } 
}

 



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net