Path: blob/main/crypto/krb5/src/windows/leash/LeashFrame.cpp
34914 views
// **************************************************************************************1// File: LeashFrame.cpp2// By: Arthur David Leather3// Created: 12/02/984// Copyright @1998 Massachusetts Institute of Technology - All rights reserved.5// Description: CPP file for LeashFrame.h. Contains variables and functions6// for Leash7//8// History:9//10// MM/DD/YY Inits Description of Change11// 12/02/98 ADL Original12// **************************************************************************************131415#include "stdafx.h"16#include "LeashFrame.h"1718#ifdef _DEBUG19#undef THIS_FILE20static char BASED_CODE THIS_FILE[] = __FILE__;21#endif22///////////////////////////////////////////////////////////////23// CLeashFrame2425const CRect CLeashFrame::s_rectDefault(0, 0, 740, 400); // static public (l,t,r,b)26const char CLeashFrame::s_profileHeading[] = "Window size";27const char CLeashFrame::s_profileRect[] = "Rect";28const char CLeashFrame::s_profileIcon[] = "icon";29const char CLeashFrame::s_profileMax[] = "max";30const char CLeashFrame::s_profileTool[] = "tool";31const char CLeashFrame::s_profileStatus[] = "status";3233IMPLEMENT_DYNAMIC(CLeashFrame, CFrameWndEx)3435BEGIN_MESSAGE_MAP(CLeashFrame, CFrameWndEx)36//{{AFX_MSG_MAP(CLeashFrame)37ON_WM_DESTROY()38//}}AFX_MSG_MAP39END_MESSAGE_MAP()4041///////////////////////////////////////////////////////////////42CLeashFrame::CLeashFrame()43{44m_bFirstTime = TRUE;45}4647///////////////////////////////////////////////////////////////48CLeashFrame::~CLeashFrame()49{50}5152///////////////////////////////////////////////////////////////53void CLeashFrame::OnDestroy()54{55CString strText;56BOOL bIconic, bMaximized;5758WINDOWPLACEMENT wndpl;59wndpl.length = sizeof(WINDOWPLACEMENT);60// gets current window position and61// iconized/maximized status62BOOL bRet = GetWindowPlacement(&wndpl);63if (wndpl.showCmd == SW_SHOWNORMAL)64{65bIconic = FALSE;66bMaximized = FALSE;67}68else if (wndpl.showCmd == SW_SHOWMAXIMIZED)69{70bIconic = FALSE;71bMaximized = TRUE;72}73else if (wndpl.showCmd == SW_SHOWMINIMIZED)74{75bIconic = TRUE;76if (wndpl.flags)77{78bMaximized = TRUE;79}80else81{82bMaximized = FALSE;83}84}8586strText.Format("%04d %04d %04d %04d",87wndpl.rcNormalPosition.left,88wndpl.rcNormalPosition.top,89wndpl.rcNormalPosition.right,90wndpl.rcNormalPosition.bottom);9192AfxGetApp()->WriteProfileString(s_profileHeading,93s_profileRect, strText);9495AfxGetApp()->WriteProfileInt(s_profileHeading,96s_profileIcon, bIconic);9798AfxGetApp()->WriteProfileInt(s_profileHeading,99s_profileMax, bMaximized);100101SaveBarState(AfxGetApp()->m_pszProfileName);102103CFrameWndEx::OnDestroy();104}105106///////////////////////////////////////////////////////////////107void CLeashFrame::ActivateFrame(int nCmdShow)108{109110if (m_bFirstTime)111{112m_bFirstTime = FALSE;113114}115116CFrameWndEx::ActivateFrame(nCmdShow);117}118119120