📄 winapp.h
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
//==========================================================================;
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
//
//--------------------------------------------------------------------------;
#pragma once
#ifndef __WINAPP_H__
#define __WINAPP_H__
class CWindowsModule
{
public:
static CWindowsModule& GetWinModule();
static CWindowsModule* GetWinModulePtr();
CWindowsModule();
virtual ~CWindowsModule();
virtual bool Initialize();
virtual void Shutdown();
# ifdef UNDER_CE
typedef LPWSTR command_line_type;
# else
typedef LPSTR command_line_type;
# endif
const HINSTANCE m_hInstance;
const command_line_type m_pszCommandLine;
HWND m_hWnd;
LPCTSTR m_pszModuleName;
INT m_iAppReturnCode;
protected:
virtual bool InitConsoleOutput();
virtual bool RegisterWindowClass();
virtual void UnregisterWindowClass();
virtual bool CreateMainWindow();
virtual void DestroyMainWindow();
WNDCLASS m_WindowClass;
public:
static BOOL DllMain(HANDLE hInstance, ULONG dwReason, LPVOID lpReserved);
};
class CWindowsApplication : public CWindowsModule
{
public:
static CWindowsApplication& GetWinApp();
static CWindowsApplication* GetWinAppPtr();
CWindowsApplication();
virtual ~CWindowsApplication();
virtual void Run() = 0;
virtual void Shutdown();
public:
static int WinMain(HINSTANCE hInstance, HINSTANCE, command_line_type pszCmdLine, int);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -