Solved

Save location of view and control bar when closed?

Posted on 1998-10-23
2
207 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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now