![]() |
CXTWindowPos |
Post Reply ![]() |
Author | |
dennisV ![]() Senior Member ![]() ![]() Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
![]() ![]() ![]() ![]() ![]() 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) |
|
![]() |
|
bevpet ![]() Newbie ![]() ![]() Joined: 01 April 2005 Location: Canada Status: Offline Points: 39 |
![]() ![]() ![]() ![]() ![]() |
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct){ CXTWindowPos wndPosition; wndPosition.LoadWindowPos( this);} void CMainFrame::OnClose() { #ifdef _XTP_INCLUDE_CONTROLSCXTWindowPos wndPosition; wndPosition.SaveWindowPos( this);#endif CMDIFrameWnd::OnClose(); } |
|
![]() |
|
dennisV ![]() Senior Member ![]() ![]() Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
![]() ![]() ![]() ![]() ![]() |
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) |
|
![]() |
|
bevpet ![]() Newbie ![]() ![]() Joined: 01 April 2005 Location: Canada Status: Offline Points: 39 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
dennisV ![]() Senior Member ![]() ![]() Joined: 07 October 2004 Location: Australia Status: Offline Points: 242 |
![]() ![]() ![]() ![]() ![]() |
Yes, that's the one
![]() |
|
// W7 64 Ultimate SP1
// VS 2008 // CodeJock 16.2.3 (MFC) |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |