?
Solved

saving location of CToolbarCtrl

Posted on 2007-03-29
1
Medium Priority
?
432 Views
Last Modified: 2013-11-20
Hi,

I have a toolbar ctrl. I'd like to save its position on the toolbar (or if the user decided to float it, it's position in space) to file or registry so I can restore its position next time the user starts up the application.

Do SaveState() and RestoreState() do that, or do I have to use GetWindowRect() / SetWindowRect() for that?

thanks
0
Comment
Question by:DJ_AM_Juicebox
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
Priyesh earned 2000 total points
ID: 18820978
In your CMainFrame class, in the OnCreate, right before the return, do this,

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
....
                     LoadBarState(_T("DockState")) ;
      return 0;
}

and to save, map the OnClose
//
void CMainFrame::OnClose()
{
      SaveBarState(_T("DockState")) ;
      __super::OnClose() ;
}

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question