📄 winapp.cpp
字号:
#include "stdafx.h"
#include "winapp.h"
#include "dialog.h"
#include "formdlg.h"
CWinApp g_theApp;
int APIENTRY _tWinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nShowCmd)
{
g_hInstance = hInstance;
g_theApp.m_hInst = hInstance;
if(g_theApp.InitInstance())
{
return g_theApp.Run();
}
return g_theApp.ExitInstance();
}
CWinApp::CWinApp() : m_hInst(NULL), m_nRetCode(0)
{
}
CWinApp::~CWinApp()
{
}
bool CWinApp::InitInstance()
{
CFormDlg dlg;
dlg.DoModal();
return false;
}
int CWinApp::Run()
{
MSG msg;
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
m_nRetCode = msg.wParam;
return ExitInstance();
}
int CWinApp::ExitInstance()
{
return m_nRetCode;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -