Print Page | Close Window

Problems with SavePlacement/LoadPlacement

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6965
Printed Date: 12 November 2025 at 5:45pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problems with SavePlacement/LoadPlacement
Posted By: Staffan V
Subject: Problems with SavePlacement/LoadPlacement
Date 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.



Replies:
Posted By: Staffan V
Date 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);




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net