Print Page | Close Window

CXTWindowPos

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=2677
Printed Date: 18 September 2025 at 9:32pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTWindowPos
Posted By: dennisV
Subject: CXTWindowPos
Date Posted: 03 August 2005 at 6:48am

Hi,

Just wondering has something changed about the usage of CXTWindowPos from 9.6 to 9.7? It doesn't seem to work anymore

Could you please give me a sample usage of it, so that my main window's position is stored/loaded correctly?

Thank you!



-------------
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)



Replies:
Posted By: bevpet
Date Posted: 03 August 2005 at 12:11pm

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)

{

CXTWindowPos wndPosition;

wndPosition.LoadWindowPos(this);

}

void CMainFrame::OnClose()

{

#ifdef _XTP_INCLUDE_CONTROLS

CXTWindowPos wndPosition;

wndPosition.SaveWindowPos(this);

#endif

CMDIFrameWnd::OnClose();

}



Posted By: dennisV
Date Posted: 03 August 2005 at 5:42pm

Thank you, that did the trick, but there's one remaining issue - when the window was maximized, it's not restored as maximized, but is actually of a maximized size with the "maximize" button enabled in the title bar. After you click it, the window doesn't change size (stays covering the whole screen), but the button becomes what you'd expect - "restore".

Make sense? Hope so (it's early morning here )

Do I need to use ShowWindow() for the main frame in InitInstance() if I'm using CXTWindowPos? Maybe they're conflicting with each other?

Thanks!



-------------
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)


Posted By: bevpet
Date Posted: 03 August 2005 at 8:11pm

Hi,

try the following..

CMyApp::InitInstance()

{

....code

pMainFrame->UpdateWindow();

pMainFrame->ShowWindow(SW_SHOW);

....

}

The [SW_SHOW] value activates the window and displays it in its current size and position, so in essence it SHOULD leave the window the way you left it last.

HTH

Peter

 



Posted By: dennisV
Date Posted: 03 August 2005 at 10:19pm
Yes, that's the one  Thanks!

-------------
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)



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