Solved

Save location of view and control bar when closed?

Posted on 1998-10-23
2
208 Views
Last Modified: 2013-11-20
Hi there,
My application uses MDI and some Control bars dockable in one mainframe. I try to save the location of each object in the registry when I close the app. I used WriteProfileInt() on OnClose() and GetProfileInt() in PreCreateWindow() in MainFrame to save the TopLeft() of the WindowRect, but it doesn't work. I just get the TopLeft of the last Rect written to profile. How can save all the location of controlbar and view after I move them around?
If you have any hint or answer for this question, please let me know. Thank you for your time.
0
Comment
Question by:tamngo
2 Comments
 
LVL 3

Accepted Solution

by:
plaroche earned 100 total points
ID: 1323779
You will have to iterate through the views and control bars, save them in a certain order under different registry entries.

for example:

ControlBar1
ControlBar2
View1
View2

Under each you could save name of the window, position and a lot of other things.

To iterate through the views check GetFirstViewPosition() and GetNextView().

0
 

Author Comment

by:tamngo
ID: 1323780
Hi plaroche,

   Can you give me some detail about your answer?
   I can't get it. Right now under each control or view I have window name, topleft and width and height.  When I call GetProfileInt() from OnCreate() of Mainframe  I use MoveWindow() to the new position but it doesn't work.
Maybe some more hints will be a big help. Thank you.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Define unique primary key 9 92
sumDigits challenge 9 150
Window placement 17 83
sumHeights2  challenge 7 105
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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.

809 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