[翻译]-WinCE 程序设计 (3rd 版)--3.2 鼠标和触摸屏(续)

来源:互联网 发布:中信建投证券mac版 编辑:程序博客网 时间:2024/05/16 04:42
 清单3-3:TicTac1程序TicTac1.h//======================================================================// Header file//// Written for the book Programming Windows CE// Copyright (C) 2003 Douglas Boling//======================================================================// Returns number of elements#define dim(x) (sizeof(x) / sizeof(x[0]))//----------------------------------------------------------------------// Generic defines and data types//struct decodeUINT {                             // Structure associates    UINT Code;                                  // messages                                                 // with a function.    LRESULT (*Fxn)(HWND, UINT, WPARAM, LPARAM);}; struct decodeCMD {                              // Structure associates    UINT Code;                                  // menu IDs with a     LRESULT (*Fxn)(HWND, WORD, HWND, WORD);     // function.};   //----------------------------------------------------------------------// Function prototypes//HWND InitInstance (HINSTANCE, LPWSTR, int);int TermInstance (HINSTANCE, int);   // Window proceduresLRESULT CALLBACK MainWndProc (HWND, UINT, WPARAM, LPARAM);   // Message handlers LRESULT DoSizeMain (HWND, UINT, WPARAM, LPARAM);LRESULT DoPaintMain (HWND, UINT, WPARAM, LPARAM);LRESULT DoLButtonDownMain (HWND, UINT, WPARAM, LPARAM);LRESULT DoLButtonUpMain (HWND, UINT, WPARAM, LPARAM);LRESULT DoDestroyMain (HWND, UINT, WPARAM, LPARAM);   // Game function prototypesvoid DrawXO (HDC hdc, HPEN hPen, RECT *prect, INT nCell, INT nType);void DrawBoard (HDC hdc, RECT *prect);
原创粉丝点击