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 / gdidemo / gdidemo.h < prev    next >
C/C++ Source or Header  |  1997-10-05  |  3KB  |  116 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. #ifdef WIN16
  13. #define APIENTRY FAR PASCAL
  14. typedef int (APIENTRY *WNDPROC)();
  15. typedef WORD WPARAM;
  16. typedef VOID *PVOID;
  17. typedef WORD UINT;
  18. #endif
  19.  
  20. #define APPCLASS   "GDIDEMO"
  21. #define APPTITLE   "Windows GDI Demonstration"
  22.  
  23.  
  24. #define APPMENU   1000
  25. #define APPICON   1001
  26. #define ABOUTBOX  1002
  27.  
  28. #define IDM_DEMO_POLYBEZIER 100
  29. #define IDM_DEMO_XFORM      101
  30. #define IDM_DEMO_MAZE       102
  31. #define IDM_DEMO_DRAW       103
  32. #define IDM_DEMO_BOUNCE     104
  33.  
  34. #define IDM_WINDOW_CASCADE  200
  35. #define IDM_WINDOW_TILE     201
  36. #define IDM_WINDOW_ICON     202
  37. #define IDM_HELP_ABOUT      900
  38.  
  39.  
  40. #define COLOR_SCALE_RED     1
  41. #define COLOR_SCALE_GREEN   2
  42. #define COLOR_SCALE_BLUE    3
  43. #define COLOR_SCALE_GRAY    4
  44.  
  45. #define CLIENTWND           0
  46.  
  47.  
  48. #define BOUNCETITLE  1
  49. #define DRAWTITLE    2
  50. #define MAZETITLE    3
  51. #define POLYTITLE    4
  52. #define XFORMTITLE   5
  53.  
  54.  
  55.  
  56.  
  57.  
  58. /*
  59. ** MAIN WINDOW ROUTINES (gdidemo.c)
  60. */
  61. LONG  APIENTRY WndProc(HWND,UINT,WPARAM,LONG);
  62. BOOL           CreateProc(HWND);
  63. VOID           DestroyProc(HWND);
  64. BOOL           CommandProc(HWND,WPARAM,LONG);
  65. VOID           PaintProc(HWND);
  66. DWORD FAR      lRandom(VOID);
  67.  
  68.  
  69. /*
  70. ** INITIALIZATION ROUTINES (init.c)
  71. */
  72. BOOL FAR RegisterAppClass(HANDLE);
  73. VOID FAR UnregisterAppClass(HANDLE);
  74. HWND FAR CreateAppWindow(HANDLE);
  75. HWND FAR CreateMDIClientWindow(HWND);
  76.  
  77.  
  78.  
  79. /*
  80. ** DIALOG ROUTINES (dialog.c)
  81. */
  82. BOOL APIENTRY AboutDlgProc(HWND,UINT,WPARAM,LONG);
  83. int  FAR      DisplayDialogBox(HWND,LPSTR,WNDPROC,LONG);
  84. VOID          PaintWindow(HWND,int);
  85. HPALETTE      CreateColorScalePalette(HDC,int);
  86.  
  87.  
  88. /*
  89. ** WINDOW ROUTINES (wininfo.c)
  90. */
  91. BOOL  FAR AllocWindowInfo(HWND,WORD);
  92. PVOID FAR LockWindowInfo(HWND);
  93. BOOL  FAR UnlockWindowInfo(HWND);
  94. BOOL  FAR FreeWindowInfo(HWND);
  95.  
  96.  
  97.  
  98.  
  99. #ifdef TESTDEBUG
  100. #define DEBUGOUT(lpszString) OutputDebugString(lpszString)
  101. #else
  102. #define DEBUGOUT(lpszString) {}
  103. #endif
  104.  
  105.  
  106. /*
  107. ** Porting macros...
  108. */
  109. #if defined(_WIN32) || defined(WIN32)
  110. #define GETINSTANCE(hWnd)   (HANDLE)GetWindowLong(hWnd,GWL_HINSTANCE)
  111. #define GETCLASSBRUSH(hWnd) (HBRUSH)GetClassLong(hWnd,GCL_HBRBACKGROUND)
  112. #else
  113. #define GETINSTANCE(hWnd)   (HANDLE)GetWindowWord(hWnd,GWW_HINSTANCE)
  114. #define GETCLASSBRUSH(hWnd) (HBRUSH)GetClassWord(hWnd,GCW_HBRBACKGROUND)
  115. #endif
  116.