Solved

saving location of CToolbarCtrl

Posted on 2007-03-29
1
423 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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
repeatEnd java challenge 42 85
Change owner from userA to server Local Administrators 7 71
Path of Workbook 3 87
Making an alias 7 115
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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