[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

saving location of CToolbarCtrl

Posted on 2007-03-29
1
Medium Priority
?
439 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: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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 video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

650 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