Click to See Complete Forum and Search --> : MoveWindow


Mark Jones
May 20th, 1999, 01:35 PM
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);
}

nms
May 20th, 1999, 02:12 PM
Why don't u try the CView::InitialUpdate function !!!
It should work...
do let me know....

nms