/*
Name: cpp.h
Copyright: (c) huyoo,changsha,hunan province,china
Author: huyoo
Date: 10-10-04 01:28
Description: 封装Cpp
*/
//07-10-04 11:39
#if !defined APP_H
#define APP_H
#include <windows.h>
#include "resource.h"
class WinApp
{
public:
WinApp();
int InitInstance(HINSTANCE appInstance, HINSTANCE hPrevInst,
char * cmdParam, int cmdShow);
public:
static LRESULT CALLBACK MainWndProc
(HWND hwnd, UINT message,WPARAM wParam, LPARAM lParam);
};
#endif
//-----------------------------------------------------------
/*
Name: cpp.cpp
Copyright: (c) huyoo,changsha,hunan province,china
Author: huyoo
Date: 10-10-04 01:28
Description: 封装Cpp
*/
#include "app.h"
#include <windows.h>
WinApp::WinApp()
{}
int WinApp::InitInstance(HINSTANCE appInstance, HINSTANCE hPrevInst, char * cmdParam, int cmdShow)
{
return 0;
}
LRESULT CALLBACK WinApp::MainWndProc
(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_CREATE:
return 0;
case WM_SIZE:
return 0;
case WM_PAINT:
return 0;
case WM_COMMAND:
return 0;
}
return ::DefWindowProc (hwnd, message, wParam, lParam);
}
//-------------------------------------------------------------------------------
//main.cpp
#include "app.h"
int WINAPI WinMain
(HINSTANCE appInstance, HINSTANCE hPrevInst, char * cmdParam, int cmdShow)
{
WinApp theApp;
return theApp.InitInstance(appInstance, hPrevInst, cmdParam, cmdShow);
}
//千万不要去调试运行,没有任何结果.
//仅仅当作抛砖引玉了 !!! ^_*
本文地址:http://com.8s8s.com/it/it26763.htm