CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: MoveWindow

  1. #1
    Join Date
    May 1999
    Posts
    2

    MoveWindow

    I use the following code (from a toolbar button) to move a child window using saved coordinates. I would like to automatically move the window (after it is created) without having to use a button.
    Where in CPadView could I put this code???
    or is there a better way???

    CPadView in using CEditView as its base class.

    CWinApp* pApp = AfxGetApp();
    iWinHeight = pApp->GetProfileInt("DisplayWin", szWinHeight, 0);
    iWinWidth = pApp->GetProfileInt("DisplayWin", szWinWidth, 0);
    iWinTop = pApp->GetProfileInt("DisplayWin", szWinTop, 0);
    iWinLeft = pApp->GetProfileInt("DisplayWin", szWinLeft, 0);
    if (iWinHeight != 0) {
    CFrameWnd* pFrame = GetParentFrame();
    ASSERT_VALID(pFrame);
    pFrame->MoveWindow(iWinLeft, iWinTop, iWinWidth, iWinHeight, TRUE);
    }





  2. #2
    Join Date
    May 1999
    Posts
    9

    Re: MoveWindow

    Why don't u try the CView::InitialUpdate function !!!
    It should work...
    do let me know....

    nms

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured