📄 mfcfrmmain.cpp
字号:
#include "stdafx.h"
#include "ItemKey.h"
#include "MFCINi.h"
#include "SystemConfig.h"
#include "ToolKit.h"
#include "BaseDialog.h"
#include "FrmMain.h"
#include "FrmMainMenu.h"
#include "FrmSearchMenu.h"
#include "LogFile.h"
#include "FrmSearchByFullText.h"
#include "FrmExit.h"
#include "FrmCommonTitle.h"
//HINSTANCE g_hInst;
// 窗体初始化
HWND InitInstance(HINSTANCE hInstance, int nCmdShow);
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int nCmdShow)
{
::SetCursor(::LoadCursor(hInstance, IDC_ARROW));
HWND hWndMain;
HACCEL hAccel = NULL;
MSG msg;
// 窗体初始化
hWndMain = InitInstance(hInstance, nCmdShow);
if (hWndMain == 0)
{
// 初始化失败,显示错误信息
ToolKit::ShowMessageBox("窗体初始化失败");
return 0x10;
}
while(GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(hWndMain, hAccel, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
::DestroyWindow(hWndMain);
return msg.wParam;
}
HWND InitInstance(HINSTANCE hInstance, int nCmdShow)
{
WNDCLASS wc;
//CBaseWnd::g_hInst = hInstance;
wc.style = CS_VREDRAW | CS_HREDRAW;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(hInstance, IDI_APPLICATION);
wc.hCursor = NULL; //LoadCursor(hInstance, IDC_ARROW);
wc.lpszMenuName = NULL;
wc.hbrBackground = CreateSolidBrush(SystemConfig::GetConfig()->m_Color);
FrmMain::RegistClass(wc); // 主界面
FrmCommonTitle::RegistClass(wc);
FrmMainMenu::RegistClass(wc); // 主菜单
FrmSearchMenu::RegistClass(wc); // 查询菜单
FrmSearchByFullText::RegistClass(wc); // 文本查询
FrmExit::RegistClass(wc); // 退出界面
FrmMain::s_FrmMain.OnShow();
return FrmMain::s_FrmMain.m_hWnd;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -