home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / gdi / winnt / wxform / wxform.h < prev    next >
Text File  |  1997-10-05  |  3KB  |  102 lines

  1.  
  2. /******************************************************************************\
  3. *       This is a part of the Microsoft Source Code Samples. 
  4. *       Copyright (C) 1993-1997 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.  
  12. /*  wxform.h -- header file for World transform sample.  */
  13.  
  14.  
  15. LRESULT CALLBACK MainWndProc     (HWND, UINT, WPARAM, LPARAM);
  16. LRESULT CALLBACK TransformDlgProc(HWND, UINT, WPARAM, LPARAM);
  17. LRESULT CALLBACK MouseDlgProc    (HWND, UINT, WPARAM, LPARAM);
  18.  
  19.  
  20.  
  21. /* dialog id's for the Transform dialog */
  22. #define IDD_EM11        101
  23. #define IDD_EM12        102
  24. #define IDD_EDX         103
  25. #define IDD_EM21        104
  26. #define IDD_EM22        105
  27. #define IDD_EDY         106
  28. #define IDD_13          107
  29. #define IDD_23          108
  30. #define IDD_33          109
  31. #define IDD_SETXFORM    110
  32. #define IDD_IDENTITY    111
  33.  
  34.  
  35. /* dialog id's for the Mouse dialog */
  36. #define IDD_SCREENX     201
  37. #define IDD_SCREENY     202
  38. #define IDD_DEVICEX     203
  39. #define IDD_DEVICEY     204
  40. #define IDD_WORLDX      205
  41. #define IDD_WORLDY      206
  42.  
  43. /* string table ids's */
  44. #define IDS_NTONLY        16
  45. #define IDS_WINDOWTITLE   17
  46.  
  47. /* special messages for doTrackobject(). */
  48. #define TROB_NEW         WM_USER+1
  49. #define TROB_DELETE      WM_USER+2
  50. #define TROB_PAINT       WM_USER+3
  51. #define TROB_HITTEST     WM_USER+5
  52. #define TROB_CENTER      WM_USER+6
  53. #define TROB_SETXFORM    WM_USER+7
  54.  
  55. /* special user message for two of the dialogs */
  56. #define WM_PUTUPFLOATS  WM_USER+1
  57.  
  58.  
  59. /* Different "Track modes." */
  60. #define TMNONE    0x0000
  61. #define TMMOVE    0x0001
  62. #define TMSIZEX   0x0002
  63. #define TMSIZEY   0x0004
  64. #define TMSIZEXY  0x0006
  65. #define TMSHEARX  0x0010
  66. #define TMSHEARY  0x0020
  67. #define TMROTATE  0x0008
  68.  
  69.  
  70. /* misc. defines for drawing and formating */
  71. #define TICKSPACE 20
  72. #define MAXCHARS  32
  73. #define INC   5
  74. #define FORMATFLOAT    "%1.2f"
  75. #define GRIDCOLOR (COLORREF) 0x01000006
  76.  
  77.  
  78.  
  79. /* structure for the track object.  c.f. ptoRect */
  80. typedef struct tagTrackObject{
  81.     RECT   rect;
  82.     XFORM  xfmChange;   /* World coordinate transform      */
  83.     XFORM  xfmDown;     /* transform when the mouse down happens. */
  84.     HDC    hdc;
  85.     int    Mode;        /* TMROTATE, TMSIZEXY, TMMOVE, ... */
  86.     struct tagTrackObject* Next;
  87. } TrackObject, *PTrackObject;
  88.  
  89.  
  90. /* function prototypes. */
  91. PTrackObject doTrackObject(PTrackObject, int, HWND, LONG);
  92. VOID MouseMove(PTrackObject, int, HWND, LONG);
  93. VOID CenterOrigin (HWND, HDC);
  94.  
  95.  
  96. /* Global variables. */
  97. BOOL showTransform, showMouse, showHelp;
  98. HWND hwndTransform, hwndMouse, hwndHelp;
  99. PTrackObject ptoRect = NULL;
  100. HANDLE hInst;
  101. HWND   hwndMain;
  102.