📄 memo.cpp
字号:
#include"memo.h"
TCHAR szClassName[50];
TCHAR szAppTitle[50];
ATOM MyRegisterClass( HINSTANCE );
BOOL InitInstance( HINSTANCE, int);
int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdline, int nCmdShow)
{
HACCEL hAccTable;
MSG msg;
LoadString( hInstance, IDS_APP_TITLE, szAppTitle, 50);
LoadString( hInstance, IDC_MEMO, szClassName, 50);
MyRegisterClass( hInstance );
if(!InitInstance( hInstance, nCmdShow))
{
return FALSE;
}
hAccTable=LoadAccelerators( hInstance, (LPCTSTR)IDC_MEMO);
while(GetMessage( &msg, NULL, 0, 0))
{
if(!TranslateAccelerator( msg.hwnd, hAccTable, &msg))
{
TranslateMessage( &msg);
DispatchMessage( &msg );
}
}
return msg.wParam;
}
ATOM MyRegisterClass( HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize=sizeof(WNDCLASSEX);
wcex.style= CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc=WndProc;
wcex.cbWndExtra=0;
wcex.cbClsExtra=0;
wcex.hInstance=hInstance;
wcex.hIcon=LoadIcon( hInstance, (LPCTSTR)IDI_MEMO);
wcex.hbrBackground=(HBRUSH)GetStockObject( WHITE_BRUSH);
wcex.hIconSm=LoadIcon( hInstance,(LPCTSTR)IDI_MEMO);
wcex.hCursor=LoadCursor( hInstance, IDC_ARROW);
wcex.lpszClassName=szClassName;
wcex.lpszMenuName=(LPCTSTR)IDC_MEMO;
return RegisterClassEx( &wcex);
}
BOOL InitInstance( HINSTANCE hInstance, int nCmdShow)
{
HWND hwnd;
hwnd=CreateWindow( szClassName, szAppTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL,NULL, hInstance,
NULL);
if(!hwnd)
{
return FALSE;
}
ShowWindow( hwnd, nCmdShow);
UpdateWindow( hwnd );
return true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -