Solved

Save location of view and control bar when closed?

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

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

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 …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

719 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