![]() |
How to save the layout to a specific reg. location |
Post Reply ![]() |
Author | |
Sergio ![]() Senior Member ![]() ![]() Joined: 18 September 2006 Status: Offline Points: 216 |
![]() ![]() ![]() ![]() ![]() Posted: 28 November 2006 at 12:56pm |
Hello,
Do you know how we could save the docking pane layout to a specific registry key ? (Codejock V.10.3.1, MFC)
( CXTPDockingPaneLayout* pPaneLayout; )
pPaneLayout->Save(_T("HKEY_CURRENT_USER\\Software\\Company\\SpecificApp\\LayoutBars\\MainFrameLayout"));
We really need to store it at a specific location, because we have many softwares using the same core...
Please help !
Regards,
|
|
Sergio
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello, See in Help CXTPPropExchangeRegistry class and CXTPDockingPaneLayout::DoPropExchange
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Sergio ![]() Senior Member ![]() ![]() Joined: 18 September 2006 Status: Offline Points: 216 |
![]() ![]() ![]() ![]() ![]() |
Hello,
I understood what to do. For your information, here's my final code :
HKEY CMainFrame::GetRegistryLayoutKey()
{ CString sKeyName; sKeyName.Format(_T("Software\\CompanyName\\%s"), GetSpecificApplicationName()); HKEY hKeyLayout = NULL;
::RegCreateKeyEx(HKEY_CURRENT_USER, sKeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKeyLayout, NULL); return hKeyLayout;
} BOOL CMainFrame::LoadOrSaveLayout(BOOL bLoad, CXTPDockingPaneManager* pPaneManager, CXTPDockingPaneLayout* pPaneLayout, CString sLayoutName)
{ if (pPaneManager && pPaneLayout) { ASSERT(!sLayoutName.IsEmpty()); HKEY hKey = GetRegistryLayoutKey();
ASSERT(hKey); if (hKey) { if (!bLoad) pPaneManager->GetLayout(pPaneLayout); CXTPPropExchangeRegistry px(bLoad, hKey, sLayoutName);
pPaneLayout->DoPropExchange(&px); RegCloseKey(hKey); if (bLoad)
pPaneManager->SetLayout(pPaneLayout); return TRUE;
} } return FALSE;
} Thanks a lot !
Best Regards,
|
|
Sergio
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Thanks you for sharing. All look right. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |