#define QS_POSTMSG 0x40000000 #define QS_QUIT 0x80000000 #define QS_INPUT 0x01000000 #define QS_PAINT 0x02000000 #define QS_TIMER 0x0000FFFF #define QS_EMPTY 0x00000000
(4)获得消息时用到的宏定义
#define PM_NOREMOVE 0x0000 #define PM_REMOVE 0x0001 #define PM_NOYIELD 0x0002
(5)声明各种消息处理函数,如获得消息、等待消息等 (6)宏定义键盘分布的相关参数和键盘信息处理函数
#define KBD_LAYOUT_DEFAULT \ #define KBD_LAYOUT_FRPC \ #define KBD_LAYOUT_FR \ #define KBD_LAYOUT_DE \ #define KBD_LAYOUT_DELATIN1 \ #define KBD_LAYOUT_IT \ #define KBD_LAYOUT_ES \ #define KBD_LAYOUT_ESCP850 \
(7)宏定义hook相关的参数和函数 (8)宏定义窗口相关参数 (9)定义主窗口数据结构
typedef struct _MAINWINCREATE {
/** The style of the main window */ DWORD dwStyle;
/** The extended style of the main window */ DWORD dwExStyle;
/** The caption of the main window */ const char* spCaption;
/** The handle to the menu of the main window */ HMENU hMenu;
/** The handle to the cursor of the main window */ HCURSOR hCursor;
/** The handle to the icon of the main window */ HICON hIcon;
/** The hosting main window */ HWND hHosting;
/** The window callback procedure */
int (*MainWindowProc)(HWND, int, WPARAM, LPARAM);
/** The position of the main window in the screen coordinates */ int lx, ty, rx, by;
/** The pixel value of background color of the main window */ int iBkColor;
/** The first private data associated with the main window */ DWORD dwAddData;
/** Reserved, do not use */ DWORD dwReserved; }MAINWINCREATE;
typedef MAINWINCREATE* PMAINWINCREATE;
(10)声明窗口创建、显示、获取窗口信息等等与窗口相关的函数 (11)宏定义主窗口的限制参数并声明相关函数
#define MWM_MINWIDTH 0 #define MWM_MINHEIGHT 1 #define MWM_BORDER 2 #define MWM_THICKFRAME 3 。。。。。。
#define MWM_ITEM_NUMBER 31
(12)宏定义颜色信息并声明相关函数
#define BKC_CAPTION_NORMAL 0 #define FGC_CAPTION_NORMAL 1 #define BKC_CAPTION_ACTIVED 2 #define FGC_CAPTION_ACTIVED 3 。。。。。。
#define BKC_DESKTOP 34 #define BKC_DIALOG #define BKC_TIP
/* back compitabilty defines */
#define BKC_BUTTON_DEF WEC_3DBOX_NORMAL #define BKC_BUTTON_PUSHED WEC_3DBOX_DARK #define FGC_BUTTON_NORMAL WED_3DBOX_REVERSE #define FGC_BUTTON_PUSHED WED_3DBOX_REVERSE #define BKC_EDIT_DEF WEC_3DBOX_LIGHT #define BKC_EDIT_DISABLED WEC_3DBOX_NORMAL #define WEC_3DFRAME_LEFT_OUTER WED_3DBOX_REVERSE #define WEC_3DFRAME_LEFT_INNER WEC_3DBOX_DARK #define WEC_3DFRAME_TOP_OUTER WED_3DBOX_REVERSE #define WEC_3DFRAME_TOP_INNER WEC_3DBOX_DARK #define WEC_3DFRAME_RIGHT_OUTER WEC_3DBOX_LIGHT #define WEC_3DFRAME_RIGHT_INNER WEC_3DBOX_NORMAL
35 36
#define WEC_ITEM_NUMBER 37
#define WEC_3DFRAME_BOTTOM_OUTER WEC_3DBOX_LIGHT #define WEC_3DFRAME_BOTTOM_INNER WEC_3DBOX_NORMAL #define WEC_3DFRAME_LEFT WEC_3DBOX_LIGHT #define WEC_3DFRAME_TOP WEC_3DBOX_LIGHT #define WEC_3DFRAME_RIGHT WEC_3DBOX_DARK #define WEC_3DFRAME_BOTTOM WEC_3DBOX_DARK
(13)宏定义位图相关参数并声明相关函数 (14)宏定义系统图标参数并声明相关函数 (15)滚动条相关的宏定义、数据结构和函数声明 (16)菜单相关的宏定义和函数声明
(17)对话框相关的宏定义、数据结构和函数声明
typedef struct _CTRLDATA {
/** Class name of the control */ const char* class_name; /** Control style */
DWORD dwStyle; /** Control position in dialog */ int x, y, w, h; /** Control identifier */
int id; /** Control caption */
const char* caption; /** Additional data */
DWORD dwAddData; /** Control extended style */
DWORD dwExStyle; } CTRLDATA;
typedef CTRLDATA* PCTRLDATA;
typedef struct _DLGTEMPLATE {
/** Dialog box style */
DWORD dwStyle; /** Dialog box extended style */
DWORD dwExStyle; /** Dialog box position */
int x, y, w, h; /** Dialog box caption */
const char* caption; /** Dialog box icon */
HICON hIcon;
/** Dialog box menu */
HMENU hMenu; /** Number of controls */
int controlnr; /** Poiter to control array */
PCTRLDATA controls; /** Addtional data, must be zero */
DWORD dwAddData; } DLGTEMPLATE;
typedef DLGTEMPLATE* PDLGTEMPLATE;
10、internals.h窗口、消息和消息队列相关的宏定义和数据结构及相关函数声明
(1)内部数据包括一些默认参数的宏定义
#define DEF_NR_TIMERS 32 #define DEF_MSGQUEUE_LEN 8 #define SIZE_CLIPRECTHEAP 16 #define SIZE_INVRECTHEAP 16 #define SIZE_QMSG_HEAP 8 #define MAX_LEN_FIXSTR 64 #define NR_HEAP 5
#define LEN_BITMAP (1+2+4+8+16)
(2)句柄类型和子类型的宏定义
#define TYPE_HWND 0x01 #define TYPE_MAINWIN 0x11 #define TYPE_CONTROL 0x12 #define TYPE_ROOTWIN 0x13 #define TYPE_HMENU 0x02 #define TYPE_MENUBAR 0x21 #define TYPE_PPPMENU 0x22 #define TYPE_NMLMENU 0x23 #define TYPE_HACCEL 0x03 #define TYPE_HCURSOR 0x05 #define TYPE_HICON 0x07 #define TYPE_HDC 0x08 #define TYPE_SCRDC 0x81 #define TYPE_GENDC 0x82 #define TYPE_MEMDC 0x83
#define TYPE_WINTODEL 0xF1 #define TYPE_UNDEFINED 0xFF
(3)Z序相关的数据结构
typedef struct _ZORDERNODE {
HWND hWnd; /* Handle of window */ struct _ZORDERNODE* pNext; /* Next window */ }ZORDERNODE;
typedef ZORDERNODE* PZORDERNODE;
typedef struct _ZORDERINFO {
int nNumber; /* Number of windows */ HWND hWnd; /* Handle of host window */ PZORDERNODE pTopMost; /* the top most Z order node */ } ZORDERINFO;
typedef ZORDERINFO* PZORDERINFO;
(4)滚动条和滚动窗口相关的数据结构
typedef struct _SCROLLWINDOWINFO {
int iOffx; int iOffy; const RECT* rc1; const RECT* rc2; }SCROLLWINDOWINFO;
typedef SCROLLWINDOWINFO* PSCROLLWINDOWINFO;
#define SBS_NORMAL 0x00 #define SBS_DISABLED 0x01 #define SBS_HIDE 0x02 typedef struct _SCROLLBARINFO {
int minPos; // min value of scroll range. int maxPos; // max value of scroll range. int curPos; // current scroll pos. int pageStep; // steps per page. int barStart; // start pixel of bar. int barLen; // length of bar. BYTE status; // status of scroll bar. }SCROLLBARINFO;
typedef SCROLLBARINFO* PSCROLLBARINFO;
(5)符号信息相关的数据结构
typedef struct _CARETINFO {
int x; // position of caret int y;
void* pNormal; // normal bitmap.
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库MINIGUI输入模块代码文件分析(3)在线全文阅读。
相关推荐: