?? fake.cpp
字號(hào):
//-------------------------------------------------------------------------
// File: Fake.cpp
//
// Desc: Example code showing how to create a minimal Windows skeleton
//
// Last modified: 02. January 2001
//
// Copyright (c) 1999-2001 Wolfgang Engel wolf@direct3d.net
//--------------------------------------------------------------------------
#define STRICT
#include <windows.h>
#include <tchar.h>
#include "App.h"
//-----------------------------------------------------------------------------
// Name: class App
// Desc: Main class to run this application. Most functionality is inherited
// from the App base class.
//-----------------------------------------------------------------------------
class CMyFrame : public CApp
{
public:
LRESULT MsgProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
CMyFrame(); // constructor
};
//-----------------------------------------------------------------------------
// Name: WinMain()
// Desc: Entry point to the program. Initializes everything, and goes into a
// message-processing loop. Idle time is used to render the scene.
//-----------------------------------------------------------------------------
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )
{
CMyFrame d3dApp;
if( FAILED( d3dApp.Create( hInst ) ) )
return 0;
return d3dApp.Run();
}
//-----------------------------------------------------------------------------
// Name: CMyD3DApplication()
// Desc: Constructor
//-----------------------------------------------------------------------------
CMyFrame::CMyFrame()
{
// Override base class members
m_strWindowTitle = _T("Fake 4 ++");
m_dwWidth = 400;
m_dwHeight = 300;
}
//-----------------------------------------------------------------------------
// Name: MsgProc()
// Desc: message procedure
//-----------------------------------------------------------------------------
LRESULT CMyFrame::MsgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if (message == WM_KEYDOWN)
{
switch (wParam)
{
case VK_ESCAPE:
PostQuitMessage(WM_QUIT);
break;
case VK_F1:
{
Pause(TRUE);
MessageBox( hWnd, "Here comes your help text",
"Help for FAKE 4++", MB_ICONQUESTION|MB_OK | MB_SYSTEMMODAL );
Pause(FALSE);
}
break;
}
}
return CApp::MsgProc( hWnd, message, wParam, lParam );
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -