--- q_a/samples/regions/regions.h 2018/08/09 18:29:19 1.1 +++ q_a/samples/regions/regions.h 2018/08/09 18:29:33 1.1.1.2 @@ -1,70 +1,68 @@ -/************************************************************************\ +/******************************************************************************\ * -* REGIONS.H +* REGIONS.H * -\************************************************************************/ +\******************************************************************************/ -/************************************************************************\ -* SYMBOLIC CONSTANTS -\************************************************************************/ -#define IDM_ERASE 101 /* menuitems */ -#define IDM_OFFSETRGN 102 -#define IDM_INVERTRGN 103 -#ifdef NOTIMPLEMENTED +/******************************************************************************\ +* SYMBOLIC CONSTANTS +\******************************************************************************/ - #define IDM_FRAMERGN 104 +#define IDM_ERASE 101 // menuitems +#define IDM_OFFSETRGN 102 +#define IDM_INVERTRGN 103 +#define IDM_FRAMERGN 104 +#define IDM_PTINRGN 105 +#define IDM_RECTINRGN 106 +#define IDM_SETRECTRGN 107 +#define IDM_GETRGNBOX 108 +#define IDM_ABOUT 109 -#endif +#define IDM_ELLIPSE 201 +#define IDM_POLYPOLYGON 202 +#define IDM_RECT 203 -#define IDM_PTINRGN 105 -#define IDM_RECTINRGN 106 -#define IDM_SETRECTRGN 107 -#define IDM_GETRGNBOX 108 -#define IDM_ABOUT 109 +#define IDM_AND 301 +#define IDM_COPY 302 +#define IDM_DIFF 303 +#define IDM_OR 304 +#define IDM_XOR 305 -#define IDM_ELLIPSE 201 -#define IDM_POLYPOLYGON 202 -#define IDM_RECT 203 +#define ELLIPTIC_RGN 0X0001 // flags used in RGNSTRUCT.flags +#define POLYPOLYGON_RGN 0X0002 +#define RECT_RGN 0X0004 -#define IDM_AND 301 -#define IDM_COPY 302 -#define IDM_DIFF 303 -#define IDM_OR 304 -#define IDM_XOR 305 +#define MAXRGNSTRUCTS 3 // max # of rgns existing at 1 time -#define ELLIPTIC_RGN 0X0001 /* flags used in RGNSTRUCT.flags */ -#define POLYPOLYGON_RGN 0X0002 -#define RECT_RGN 0X0004 +#define POLYPOLYGONCOUNT 3 // # of polygons in call to + // CreatePolyPolygonRgn -#define MAXRGNSTRUCTS 3 /* max # of rgns existing at 1 time */ +#define TRECT_NEW 1 // TrackRect() actions +#define TRECT_DELETE 2 +#define TRECT_PAINT 3 -#define POLYPOLYGONCOUNT 3 /* # of polygons in call to - CreatePolyPolygonRgn */ - -#define TRECT_NEW 1 /* TrackRect() actions */ -#define TRECT_DELETE 2 -#define TRECT_PAINT 3 - -#define RESET_ALL 0 /* Reset() actions */ +#define RESET_ALL 0 // Reset() actions #define ENABLE_OPTIONS 1 #define ENABLE_COMBINERGN 2 #define DISABLE_COMBINERGN 3 -/************************************************************************\ -* TYPEDEFS -\************************************************************************/ +/******************************************************************************\ +* TYPEDEFS +\******************************************************************************/ -typedef struct { +typedef struct +{ HRGN hrgn; WORD type; } RGNSTRUCT; -typedef struct { +typedef struct +{ WORD xOrigin, yOrigin; RECT trackRect, clientRect; HDC hdc; @@ -72,9 +70,9 @@ typedef struct { -/************************************************************************\ -* GLOBAL VARIABLES -\************************************************************************/ +/******************************************************************************\ +* GLOBAL VARIABLES +\******************************************************************************/ HANDLE hInst; RGNSTRUCT rgnArray[MAXRGNSTRUCTS]; @@ -92,14 +90,15 @@ RECT rectRect = {20, 100, 120, 2 -/************************************************************************\ -* FUNCTION PROTOTYPES -\************************************************************************/ - -LONG APIENTRY MainWndProc (HWND, UINT, UINT, LONG); -BOOL APIENTRY AboutDlgProc (HWND, UINT, UINT, LONG); -BOOL APIENTRY RgnBoxDlgProc (HWND, UINT, UINT, LONG); -void MyCreateRgn (WORD); -void MyCombineRgn (int); +/******************************************************************************\ +* FUNCTION PROTOTYPES +\******************************************************************************/ + +LRESULT CALLBACK MainWndProc (HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK AboutDlgProc (HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK RgnBoxDlgProc (HWND, UINT, WPARAM, LPARAM); + +VOID MyCreateRgn (WORD); +VOID MyCombineRgn (int); PTRACKRECTSTRUCT TrackRect (PTRACKRECTSTRUCT, int, HWND, LONG); -void Reset (WORD); +VOID Reset (WORD);