Annotation of q_a/samples/regions/regions.h, revision 1.1.1.3

1.1.1.3 ! root        1: 
        !             2: /******************************************************************************\
        !             3: *       This is a part of the Microsoft Source Code Samples. 
        !             4: *       Copyright (C) 1993 Microsoft Corporation.
        !             5: *       All rights reserved. 
        !             6: *       This source code is only intended as a supplement to 
        !             7: *       Microsoft Development Tools and/or WinHelp documentation.
        !             8: *       See these sources for detailed information regarding the 
        !             9: *       Microsoft samples programs.
        !            10: \******************************************************************************/
        !            11: 
1.1.1.2   root       12: /******************************************************************************\
1.1       root       13: *
1.1.1.2   root       14: *                                    REGIONS.H
1.1       root       15: *
1.1.1.2   root       16: \******************************************************************************/
1.1       root       17: 
                     18: 
                     19: 
1.1.1.2   root       20: /******************************************************************************\
                     21: *                                SYMBOLIC CONSTANTS
                     22: \******************************************************************************/
1.1       root       23: 
1.1.1.2   root       24: #define IDM_ERASE           101    // menuitems
                     25: #define IDM_OFFSETRGN       102
                     26: #define IDM_INVERTRGN       103
                     27: #define IDM_FRAMERGN      104
                     28: #define IDM_PTINRGN         105
                     29: #define IDM_RECTINRGN       106
                     30: #define IDM_SETRECTRGN      107
                     31: #define IDM_GETRGNBOX       108
                     32: #define IDM_ABOUT           109
1.1       root       33: 
1.1.1.2   root       34: #define IDM_ELLIPSE         201
                     35: #define IDM_POLYPOLYGON     202
                     36: #define IDM_RECT            203
1.1       root       37: 
1.1.1.2   root       38: #define IDM_AND             301
                     39: #define IDM_COPY            302
                     40: #define IDM_DIFF            303
                     41: #define IDM_OR              304
                     42: #define IDM_XOR             305
1.1       root       43: 
1.1.1.2   root       44: #define ELLIPTIC_RGN        0X0001 // flags used in RGNSTRUCT.flags
                     45: #define POLYPOLYGON_RGN     0X0002
                     46: #define RECT_RGN            0X0004
1.1       root       47: 
1.1.1.2   root       48: #define MAXRGNSTRUCTS       3      // max # of rgns existing at 1 time
1.1       root       49: 
1.1.1.2   root       50: #define POLYPOLYGONCOUNT    3      // # of polygons in call to
                     51:                                    //   CreatePolyPolygonRgn
1.1       root       52: 
1.1.1.2   root       53: #define TRECT_NEW           1      // TrackRect() actions
                     54: #define TRECT_DELETE        2
                     55: #define TRECT_PAINT         3
1.1       root       56: 
1.1.1.2   root       57: #define  RESET_ALL          0      // Reset() actions
1.1       root       58: #define  ENABLE_OPTIONS     1
                     59: #define  ENABLE_COMBINERGN  2
                     60: #define  DISABLE_COMBINERGN 3
                     61: 
                     62: 
                     63: 
1.1.1.2   root       64: /******************************************************************************\
                     65: *                                    TYPEDEFS
                     66: \******************************************************************************/
1.1       root       67: 
1.1.1.2   root       68: typedef struct
                     69: {
1.1       root       70:   HRGN hrgn;
                     71:   WORD type;
                     72: } RGNSTRUCT;
                     73: 
                     74: 
1.1.1.2   root       75: typedef struct
                     76: {
1.1       root       77:     WORD   xOrigin, yOrigin;
                     78:     RECT   trackRect, clientRect;
                     79:     HDC    hdc;
                     80: } TRACKRECTSTRUCT, *PTRACKRECTSTRUCT;
                     81: 
                     82: 
                     83: 
1.1.1.2   root       84: /******************************************************************************\
                     85: *                                GLOBAL VARIABLES
                     86: \******************************************************************************/
1.1       root       87: 
                     88: HANDLE    hInst;
                     89: RGNSTRUCT rgnArray[MAXRGNSTRUCTS];
                     90: int       currRgn;
                     91: HMENU     hMenu;
                     92: 
                     93: RECT      ellipseRect = {40,  40, 180, 160};
                     94: POINT     polyPolygonPoints[] = {{120, 20}, {200, 20}, {200, 80},
                     95:                                                        { 80,140},
                     96:                                  { 20, 20}, { 80, 20}, { 20, 80},
                     97:                                  {200,120}, {200,200}, {160,200}};
                     98: 
                     99: int       polyPolygonCounts[] = {4,3,3};
                    100: RECT      rectRect    = {20, 100, 120, 200};
                    101: 
                    102: 
                    103: 
1.1.1.2   root      104: /******************************************************************************\
                    105: *                               FUNCTION PROTOTYPES
                    106: \******************************************************************************/
                    107: 
                    108: LRESULT CALLBACK MainWndProc   (HWND, UINT, WPARAM, LPARAM);
                    109: LRESULT CALLBACK AboutDlgProc  (HWND, UINT, WPARAM, LPARAM);
                    110: LRESULT CALLBACK RgnBoxDlgProc (HWND, UINT, WPARAM, LPARAM);
                    111: 
                    112: VOID             MyCreateRgn   (WORD);
                    113: VOID             MyCombineRgn  (int);
1.1       root      114: PTRACKRECTSTRUCT TrackRect     (PTRACKRECTSTRUCT, int, HWND, LONG);
1.1.1.2   root      115: VOID             Reset         (WORD);

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.