📄 playmain.cpp
字号:
// PlayMain.cpp : implementation file
//
#include "stdafx.h"
#include "SH.h"
#include "PlayMain.h"
// CPlayMain
IMPLEMENT_DYNAMIC(CPlayMain, CWnd)
CPlayMain::CPlayMain()
{
}
CPlayMain::~CPlayMain()
{
}
BEGIN_MESSAGE_MAP(CPlayMain, CWnd)
ON_WM_ACTIVATEAPP()
END_MESSAGE_MAP()
// CPlayMain message handlers
BOOL CPlayMain::Create()
{
LPCTSTR strClass = AfxRegisterWndClass(CS_DBLCLKS,
::LoadCursor(NULL, IDC_ARROW),
(HBRUSH)GetStockObject(BLACK_BRUSH),
theApp.LoadIcon(IDR_MAINFRAME));
theApp.m_rectWindow.left=0;
theApp.m_rectWindow.top=0;
theApp.m_rectWindow.right=theApp.m_iScreenWidth;
theApp.m_rectWindow.bottom=theApp.m_iScreenHeight;
AdjustWindowRect(&theApp.m_rectWindow, WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX, false);
int w = theApp.m_rectWindow.right-theApp.m_rectWindow.left;
int h = theApp.m_rectWindow.bottom-theApp.m_rectWindow.top;
theApp.m_RectScreen = theApp.m_rectWindow;
if (theApp.m_iWindowMode == 1)
{
if(CreateEx(0, strClass, AfxGetAppName(), WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX,
CW_USEDEFAULT, 0, theApp.m_iScreenWidth, theApp.m_iScreenHeight, NULL, NULL, 0) == FALSE)
return FALSE;
////窗口居中
//int W=GetSystemMetrics(SM_CXSCREEN);
//int H=GetSystemMetrics(SM_CYSCREEN);
//int x1=(W-w)/2;
//int y1=(H-h)/2;
//::SetWindowPos(this->m_hWnd,HWND_NOTOPMOST, x1, y1, w, h, SWP_SHOWWINDOW );
}
else
{
if(CreateEx(WS_EX_TOPMOST, strClass, AfxGetAppName(), WS_POPUP,
0, 0, theApp.m_iScreenWidth, theApp.m_iScreenHeight, NULL, NULL, 0) == FALSE)
return FALSE;
}
return TRUE;
}
void CPlayMain::OnActivateApp(BOOL bActive, DWORD dwThreadID)
{
CWnd::OnActivateApp(bActive, dwThreadID);
theApp.SetActive(bActive);
}
void CPlayMain::PostNcDestroy()
{
CWnd::PostNcDestroy();
theApp.ShutDown();
delete this;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -