-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPADFRAME.cpp
67 lines (55 loc) · 1.44 KB
/
PADFRAME.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "stdafx.h"
#include "psx.h"
#include "padframe.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPadFrame
IMPLEMENT_DYNCREATE(CPadFrame, CMDIChildWnd)
int CPadFrame::m_nDefCmdShow = SW_SHOWMAXIMIZED;
int CPadFrame::m_nDefCmdShowOld = SW_SHOWMAXIMIZED;
static char BASED_CODE szSec[] = "Settings";
static char BASED_CODE szShowCmd[] = "ShowCmd";
void CPadFrame::ActivateFrame(int nCmdShow)
{
if (nCmdShow == -1)
nCmdShow = m_nDefCmdShow; // use our default
CMDIChildWnd::ActivateFrame(nCmdShow);
}
void CPadFrame::Initialize()
{
m_nDefCmdShow = AfxGetApp()->GetProfileInt(szSec, szShowCmd, m_nDefCmdShow);
m_nDefCmdShowOld = m_nDefCmdShow;
}
void CPadFrame::Terminate()
{
if (m_nDefCmdShow != m_nDefCmdShowOld)
{
AfxGetApp()->WriteProfileInt(szSec, szShowCmd, m_nDefCmdShow);
m_nDefCmdShowOld = m_nDefCmdShow;
}
}
BEGIN_MESSAGE_MAP(CPadFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CPadFrame)
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPadFrame message handlers
void CPadFrame::OnSize(UINT nType, int cx, int cy)
{
CMDIChildWnd::OnSize(nType, cx, cy);
if (!IsWindowVisible())
return;
switch (nType)
{
case SIZE_MAXIMIZED:
m_nDefCmdShow = SW_SHOWMAXIMIZED;
break;
case SIZE_RESTORED:
m_nDefCmdShow = SW_SHOWNORMAL;
break;
}
}