Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Problems with SavePlacement/LoadPlacement
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problems with SavePlacement/LoadPlacement

 Post Reply Post Reply
Author
Message
Staffan V View Drop Down
Newbie
Newbie
Avatar

Joined: 29 March 2007
Location: Sweden
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Staffan V Quote  Post ReplyReply Direct Link To This Post Topic: Problems with SavePlacement/LoadPlacement
    Posted: 24 April 2007 at 8:55am
I'm using SavePlacement and LoadPlacement to save (and load) the window placements and I have two problems.

1) hidden windows become visible when I do LoadPlacement, but that's easy to handle (just hide them again after LoadPlacement)
2) the main menu has a menu bar and it seem the size of the window is saved including the height of the menu, but then it's loaded and then extra space is added for the menu even if it already has the space. Very annoying.
Back to Top
Staffan V View Drop Down
Newbie
Newbie
Avatar

Joined: 29 March 2007
Location: Sweden
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Staffan V Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2007 at 3:57am
Ok, I solved it by doing
    CRect rectOldWin;
    CRect rectNewWin;

    GetWindowRect(rectOldWin);
    LoadPlacement(_T("MyWin"));
    GetWindowRect(rectNewWin);

    rectNewWin.bottom = rectNewWin.top + rectOldWin.Height();
    rectNewWin.right = rectNewWin.left + rectOldWin.Width();
    MoveWindow(rectNewWin, true);

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.