Solved

Save location of view and control bar when closed?

Posted on 1998-10-23
2
210 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Creating Labels and Frequency list style reports in SAS code 9 105
Tab names are off by one 5 54
EvenOdd challenge 10 127
how to split multiple lines delimiter : 8 110
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.

837 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