如何写一个小程序,比如:写一个小游戏。
#定义最大20
#定义文本宽度200
#定义时间1 1
#定义时间2 2
#定义时间1
#定义NO1 1
#定义NO2 2
#定义错误0
#定义0号
#定义OK 1
int leng = 1;
#定义默认值0;
HDC hdc,hdc1,HDC 2;
int xw,yw;
int iGame[MAX][MAX];
点点;
enum {Default,Player1,Player2 }播放;
enum {Stop,Play,Paush }播放。
void初始化(HWND HWND);
void paint(int play,int x,int y);
void chage player();
int Look(int x,int y,int play);
void over(HWND hwnd,int play);
void time change(HWND HWND);
LRESULT回调WindowProcedure (HWND,UINT,WPARAM,LPARAM);
char SZ class name[]= " Gobang-WIN32版";
int WINAPI WinMain(hin instance hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd
MSG消息;
WNDCLASSEX wincl
wincl.hInstance = hThisInstance
wincl . lpsz class name = SZ class name;
wincl . lpfnwndproc = window procedure;
wincl.style = CS _ DBLCLKS
wincl . CB size = sizeof(WNDCLASSEX);
wincl.hIcon = LoadIcon (NULL,IDI _应用);
wincl.hIconSm = LoadIcon (NULL,IDI _应用);
wincl.hCursor = LoadCursor (NULL,IDC _ ARROW);
wincl.lpszMenuName = NULL
wincl . cbclsextra = 0;
wincl . cbwndextra = 0;
wincl . HBR BACKGROUND =(HBRUSH)COLOR _ BACKGROUND;