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);
}
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);
}