1
// **************************************************************************************
2
// File: LeashFrame.cpp
3
// By: Arthur David Leather
5
// Copyright @1998 Massachusetts Institute of Technology - All rights reserved.
6
// Description: CPP file for LeashFrame.h. Contains variables and functions
11
// MM/DD/YY Inits Description of Change
12
// 12/02/98 ADL Original
13
// **************************************************************************************
17
#include "LeashFrame.h"
21
static char BASED_CODE THIS_FILE[] = __FILE__;
23
///////////////////////////////////////////////////////////////
26
const CRect CLeashFrame::s_rectDefault(0, 0, 740, 400); // static public (l,t,r,b)
27
const char CLeashFrame::s_profileHeading[] = "Window size";
28
const char CLeashFrame::s_profileRect[] = "Rect";
29
const char CLeashFrame::s_profileIcon[] = "icon";
30
const char CLeashFrame::s_profileMax[] = "max";
31
const char CLeashFrame::s_profileTool[] = "tool";
32
const char CLeashFrame::s_profileStatus[] = "status";
34
IMPLEMENT_DYNAMIC(CLeashFrame, CFrameWnd)
36
BEGIN_MESSAGE_MAP(CLeashFrame, CFrameWnd)
37
//{{AFX_MSG_MAP(CLeashFrame)
42
///////////////////////////////////////////////////////////////
43
CLeashFrame::CLeashFrame()
48
///////////////////////////////////////////////////////////////
49
CLeashFrame::~CLeashFrame()
53
///////////////////////////////////////////////////////////////
54
void CLeashFrame::OnDestroy()
57
BOOL bIconic, bMaximized;
59
WINDOWPLACEMENT wndpl;
60
wndpl.length = sizeof(WINDOWPLACEMENT);
61
// gets current window position and
62
// iconized/maximized status
63
BOOL bRet = GetWindowPlacement(&wndpl);
64
if (wndpl.showCmd == SW_SHOWNORMAL)
69
else if (wndpl.showCmd == SW_SHOWMAXIMIZED)
74
else if (wndpl.showCmd == SW_SHOWMINIMIZED)
87
strText.Format("%04d %04d %04d %04d",
88
wndpl.rcNormalPosition.left,
89
wndpl.rcNormalPosition.top,
90
wndpl.rcNormalPosition.right,
91
wndpl.rcNormalPosition.bottom);
93
AfxGetApp()->WriteProfileString(s_profileHeading,
94
s_profileRect, strText);
96
AfxGetApp()->WriteProfileInt(s_profileHeading,
97
s_profileIcon, bIconic);
99
AfxGetApp()->WriteProfileInt(s_profileHeading,
100
s_profileMax, bMaximized);
102
SaveBarState(AfxGetApp()->m_pszProfileName);
104
CFrameWnd::OnDestroy();
107
///////////////////////////////////////////////////////////////
108
void CLeashFrame::ActivateFrame(int nCmdShow)
113
m_bFirstTime = FALSE;
115
LoadBarState(AfxGetApp()->m_pszProfileName);
118
CFrameWnd::ActivateFrame(nCmdShow);