void CPictureWnd::OnDestroy() { CMagneticApp* pApp = (CMagneticApp*)AfxGetApp(); // Store the position of the top-left corner of the window. CRect rWnd; CPoint& TopLeft = pApp->GetPicTopLeft(); GetWindowRect(rWnd); TopLeft = rWnd.TopLeft(); CWnd::OnDestroy(); }
void CMagneticView::SetPictureWindowState(void) { CMagneticApp* pApp = (CMagneticApp*)AfxGetApp(); if (pApp->GetShowGraphics() == CMagneticApp::ShowGraphics::SeparateWindow) { if ((m_PicWnd.GetSafeHwnd() == NULL) && (m_Picture.IsValid())) { CRect WindowArea(pApp->GetPicTopLeft(),CSize(0,0)); if (m_PicWnd.CreatePicWnd(this,WindowArea)) SetFocus(); } m_PicWnd.Update(); } else { if (m_PicWnd.GetSafeHwnd()) m_PicWnd.SendMessage(WM_CLOSE,0,0); } }