home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / inole2 / chap18 / cosmo1.0 / polyline.h < prev    next >
C/C++ Source or Header  |  1995-05-03  |  2KB  |  73 lines

  1. /*
  2.  * POLYLINE.H
  3.  *
  4.  * Definitions and function prototypes for the PolyLine window class.
  5.  *
  6.  * Copyright(c) Microsoft Corp. 1992-1994 All Rights Reserved
  7.  * Win32 version, January 1994
  8.  */
  9.  
  10.  
  11. //Need some extra types for Windows 3.1
  12. #ifndef WIN32
  13. #ifndef POINTS
  14. typedef POINT POINTS;
  15. #endif  //POINTS
  16.  
  17. #ifndef LPPOINTS
  18. typedef POINTS FAR *LPPOINTS;
  19. #endif  //LPPOINTS
  20. #endif
  21.  
  22. typedef struct
  23.     {
  24.     short   left;
  25.     short   top;
  26.     short   right;
  27.     short   bottom;
  28.     } RECTS, FAR *LPRECTS;
  29.  
  30. #define RECTSTORECT(rs, r) {(r).left=(rs).left;(r).top=(rs).top; \
  31.     (r).right=(rs).right;(r).bottom=(rs).bottom;};
  32.  
  33. #define RECTTORECTS(r, rs) {(rs).left=(short)(r).left;(rs).top=(short)(r).top; \
  34.     (rs).right=(short)(r).right;(rs).bottom=(short)(r).bottom;};
  35.  
  36. //Messages
  37. #define PLM_RECTSET         WM_USER
  38. #define PLM_POLYLINESET     WM_USER+1
  39. #define PLM_POLYLINEGET     WM_USER+2
  40. #define PLM_POLYLINENEW     WM_USER+3
  41. #define PLM_BITMAPGET       WM_USER+4
  42. #define PLM_METAFILEGET     WM_USER+5
  43. #define PLM_METAFILEPICTGET WM_USER+6
  44. #define PLM_BACKUPUNDO      WM_USER+7
  45.  
  46. //Notifications
  47. #define PLN_POINTCHANGE     1
  48. #define PLN_SIZECHANGE      2
  49.  
  50. //Definitions and structures.
  51. #define CPOLYLINEPOINTS     20
  52. #define CBPOLYLINEWNDEXTRA  sizeof(HLOCAL)
  53.  
  54. typedef struct
  55.     {
  56.     WORD        wVerMaj;                //Major version number.
  57.     WORD        wVerMin;                //Minor version number.
  58.     WORD        cPoints;                //Number of points.
  59.     WORD        fDrawEntire;            //Flag to draw entire figure.
  60.     RECTS       rc;
  61.     POINTS      rgpt[CPOLYLINEPOINTS];  //Array of points.
  62.     } POLYLINE;
  63.  
  64. typedef POLYLINE FAR *LPPOLYLINE;
  65. #define CBPOLYLINE sizeof(POLYLINE)
  66.  
  67.  
  68. //Function prototypes.
  69. HWND     WINAPI HPolylineWindowCreate(HWND, HINSTANCE);
  70. LONG     WINAPI PolylineWndProc(HWND, UINT, WPARAM, LPARAM);
  71. DWORD    PASCAL LPolylineUserMessage(HWND, UINT, WPARAM, LPARAM, LPPOLYLINE);
  72. void     PASCAL PolylineDraw(HWND, HDC, LPPOLYLINE);
  73.