Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTWindowPos
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTWindowPos

 Post Reply Post Reply
Author
Message
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Topic: CXTWindowPos
    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)
Back to Top
bevpet View Drop Down
Newbie
Newbie
Avatar

Joined: 01 April 2005
Location: Canada
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote bevpet Quote  Post ReplyReply Direct Link To This Post 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();

}

Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
bevpet View Drop Down
Newbie
Newbie
Avatar

Joined: 01 April 2005
Location: Canada
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote bevpet Quote  Post ReplyReply Direct Link To This Post 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

 

Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Posted: 03 August 2005 at 10:19pm
Yes, that's the one  Thanks!
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)
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.