📄 mainfrm.cpp
字号:
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "GPSSim.h"
#include "MainFrm.h"
#include ".\mainfrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
const RECT g_rectTrack = {10,10, 490, 370};
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
ON_WM_CREATE()
//}}AFX_MSG_MAP
ON_WM_MOVE()
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
m_dlgFloat.Create(IDD_DIALOGBAR, this);
RECT rect;
GetWindowRect(&rect);
rect.left += g_rectTrack.left;
rect.top += g_rectTrack.top;
rect.right = rect.left + g_rectTrack.right - g_rectTrack.left;
rect.bottom = rect.top + g_rectTrack.bottom - g_rectTrack.top;
m_dlgFloat.MoveWindow(&rect, FALSE);
m_dlgFloat.ShowWindow(SW_SHOW);
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE
| WS_SYSMENU | WS_MINIMIZEBOX | WS_SIZEBOX;
cs.x = 80;
cs.y = 80;
cs.cx = 1024;
cs.cy = 768;
cs.dwExStyle = 0;
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers
void CMainFrame::OnMove(int x, int y)
{
CFrameWnd::OnMove(x, y);
RECT rect;
GetActiveView()->GetWindowRect(&rect);
rect.left += g_rectTrack.left;
rect.top += g_rectTrack.top;
rect.right = rect.left + g_rectTrack.right - g_rectTrack.left;
rect.bottom = rect.top + g_rectTrack.bottom - g_rectTrack.top;
m_dlgFloat.MoveWindow(&rect, FALSE);
m_dlgFloat.ShowWindow(SW_SHOW);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -