window.h

来自「To review what a metaball is, and how to」· C头文件 代码 · 共 50 行

H
50
字号
//-----------------------------------------------------------------------------
// CWindow
//
// This class is an interface for the operative system's windows.
//
// To compile with this class you must link with:
// user32.lib gdi32.lib
//
// Copyright (c) 2001 Andreas J鰊sson
//-----------------------------------------------------------------------------
#ifndef WINDOW_H
#define WINDOW_H

#define STRICT				// Enable strict type checking
#define WIN32_LEAN_AND_MEAN // Don't include stuff that are rarely used
#include <windows.h>

class CApplication;

class CWindow
{
public:
	struct SParameters
	{
		HINSTANCE m_hInstance;
		bool      m_bFullscreen;
		int       m_nWidth;
		int       m_nHeight;
		char     *m_sTitle;
	};

	CWindow();

	HRESULT Initialize(SParameters &Params);
	bool    CheckMessage(bool bWait);
	void    SetDefault(SParameters *pParams);
	HWND    GetHandle();

protected:
    virtual LRESULT MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);

	HWND          m_hWnd;
	CApplication *m_pApplication;
	bool          m_bFullscreen;

private:
	static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?