home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / video / captest / captest.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-05  |  6.3 KB  |  222 lines

  1. /****************************************************************************
  2.  *
  3.  *   captest.h: Include file for the CapTest Sample Program
  4.  *
  5.  *   Microsoft Video for Windows Capture Class Sample Program
  6.  *
  7.  ***************************************************************************/
  8. /**************************************************************************
  9.  *
  10.  *  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  11.  *  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  12.  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  13.  *  PURPOSE.
  14.  *
  15.  *  Copyright (C) 1992 - 1997 Microsoft Corporation.  All Rights Reserved.
  16.  *
  17.  **************************************************************************/
  18.  
  19.  
  20. #include "dialogs.h"
  21.  
  22. //
  23. // General purpose constants...
  24. //
  25. #define MAXVIDDRIVERS            10
  26. #define MS_FOR_15FPS             66
  27. #define DEF_PALNUMFRAMES         10
  28. #define DEF_PALNUMCOLORS         236L
  29. #define ONEMEG                   (1024L * 1024L)
  30.  
  31. //
  32. // Menu Ids...
  33. //
  34. #define IDM_FILE                  100
  35. #define IDM_F_SETCAPTUREFILE      101
  36. #define IDM_F_SAVEVIDEOAS         102
  37. #define IDM_F_ALLOCATESPACE       103
  38. #define IDM_F_EXIT                104
  39.  
  40. #define IDM_EDIT                  110
  41. #define IDM_E_COPY                111
  42. #define IDM_E_PASTEPALETTE        112
  43.  
  44. #define IDM_CAPTURE               120
  45. #define IDM_C_CAPTUREVIDEO        121
  46. #define IDM_C_CAPTUREFRAME        122
  47. #define IDM_C_CAPTURESETTINGS     123
  48.  
  49. #define IDM_OPTIONS               130
  50. #define IDM_O_PREVIEW             131
  51. #define IDM_O_OVERLAY             132
  52. #define IDM_O_AUDIOFORMAT         133
  53. #define IDM_O_VIDEOFORMAT         134
  54. #define IDM_O_VIDEOSOURCE         135
  55. #define IDM_O_VIDEODISPLAY        136
  56. #define IDM_O_PALETTE             137
  57. #define IDM_O_CHOOSECOMPRESSOR    140
  58.  
  59. // !!! Leave some room after this define for the drivers
  60. #define IDM_O_DRIVERS             150
  61. #define IDM_O_DRIVERS1            151
  62. #define IDM_O_DRIVERS2            152
  63. #define IDM_O_DRIVERS3            153
  64. #define IDM_O_DRIVERS4            154
  65. #define IDM_O_DRIVERS5            155
  66. #define IDM_O_DRIVERS6            156
  67. #define IDM_O_DRIVERS7            157
  68. #define IDM_O_DRIVERS8            158
  69. #define IDM_O_DRIVERS9            159
  70. // The above are just reserved dummy IDs.
  71.  
  72. #define IDM_HELP                  190
  73. #define IDM_H_ABOUT               191
  74.  
  75. #define IDS_ERR_REGISTER_CLASS   1
  76. #define IDS_ERR_CREATE_WINDOW    2
  77.  
  78.  
  79. //
  80. // Macro Definitions...
  81. //
  82. #define IsDriverIndex(w) ( ((w) >= IDM_O_DRIVERS)  &&  \
  83.                            ((w) - IDM_O_DRIVERS < MAXVIDDRIVERS) )
  84.  
  85. #define Width(X)  ((X).right - (X).left)
  86. #define Height(X) ((X).bottom - (X).top)
  87.  
  88.  
  89. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; 
  90. // 
  91. //  Win 16/32 portability stuff...
  92. // 
  93. // 
  94. // 
  95. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; 
  96.  
  97. #ifndef WIN32
  98.     #ifndef FNLOCAL
  99.         #define FNLOCAL     NEAR PASCAL
  100.         #define FNCLOCAL    NEAR _cdecl
  101.         #define FNGLOBAL    FAR PASCAL
  102.         #define FNCGLOBAL   FAR _cdecl
  103.     #ifdef _WINDLL
  104.         #define FNWCALLBACK FAR PASCAL __loadds
  105.         #define FNEXPORT    FAR PASCAL __export
  106.     #else
  107.         #define FNWCALLBACK FAR PASCAL __loadds
  108.         #define FNEXPORT    FAR PASCAL __export
  109.     #endif
  110.     #endif
  111.  
  112.     //
  113.     //
  114.     //
  115.     //
  116.     #ifndef FIELD_OFFSET
  117.     #define FIELD_OFFSET(type, field)    ((LONG)&(((type *)0)->field))
  118.     #endif
  119.  
  120.     //
  121.     //  based code makes since only in win 16 (to try and keep stuff out of
  122.     //  our fixed data segment...
  123.     //
  124.     #define BCODE           _based(_segname("_CODE"))
  125.  
  126.     #define HUGE            _huge
  127.  
  128.     //
  129.     //  stuff for Unicode in Win 32--make it a noop in Win 16
  130.     //
  131.     #ifndef _TCHAR_DEFINED
  132.         #define _TCHAR_DEFINED
  133.         typedef char            TCHAR, *PTCHAR;
  134.         typedef unsigned char   TBYTE, *PTUCHAR;
  135.  
  136.         typedef PSTR            PTSTR, PTCH;
  137.         typedef LPSTR           LPTSTR, LPTCH;
  138.         typedef LPCSTR          LPCTSTR;
  139.     #endif
  140.  
  141.     #define TEXT(a)         a
  142.     #define SIZEOF(x)       sizeof(x)
  143.     #define SIZEOFACMSTR(x) sizeof(x)
  144. #else
  145.     #ifndef FNLOCAL
  146.         #define FNLOCAL     _stdcall
  147.         #define FNCLOCAL    _stdcall
  148.         #define FNGLOBAL    _stdcall
  149.         #define FNCGLOBAL   _stdcall
  150.         #define FNWCALLBACK CALLBACK
  151.         #define FNEXPORT    CALLBACK
  152.     #endif
  153.  
  154.     #ifndef _CRTAPI1
  155.     #define _CRTAPI1    __cdecl
  156.     #endif
  157.     #ifndef _CRTAPI2
  158.     #define _CRTAPI2    __cdecl
  159.     #endif
  160.     #ifndef try
  161.     #define try         __try
  162.     #define leave       __leave
  163.     #define except      __except
  164.     #define finally     __finally
  165.     #endif
  166.  
  167.  
  168.     //
  169.     //  there is no reason to have based stuff in win 32
  170.     //
  171.     #define BCODE
  172.  
  173.     #define HUGE
  174.     #define HTASK                   HANDLE
  175.     #define SELECTOROF(a)           (a)
  176.     typedef LRESULT (CALLBACK* DRIVERPROC)(DWORD, HDRVR, UINT, LPARAM, LPARAM);
  177.  
  178.     //
  179.     //  for compiling Unicode
  180.     //
  181.     #ifdef UNICODE
  182.         #define SIZEOF(x)   (sizeof(x)/sizeof(WCHAR))
  183.     #else
  184.         #define SIZEOF(x)   sizeof(x)
  185.     #endif
  186.     #define SIZEOFACMSTR(x)    (sizeof(x)/sizeof(WCHAR))
  187. #endif
  188.  
  189.  
  190. //
  191. // Global Variables...
  192. //
  193. extern TCHAR           gachAppName[] ;
  194. extern TCHAR           gachIconName[] ;
  195. extern TCHAR           gachMenuName[] ;
  196. extern TCHAR           gachString[] ;
  197. extern TCHAR           gachMCIDeviceName[] ;
  198.  
  199. extern HINSTANCE      ghInstApp ;
  200. extern HWND           ghWndMain ;
  201. extern HWND           ghWndCap ;
  202. extern HANDLE         ghAccel ;
  203. extern WORD           gwDeviceIndex ;
  204. extern WORD           gwPalFrames ;
  205. extern WORD           gwPalColors ;
  206. extern WORD           gwCapFileSize ;
  207.  
  208. extern CAPSTATUS      gCapStatus ;
  209. extern CAPDRIVERCAPS  gCapDriverCaps ;
  210. extern CAPTUREPARMS   gCapParms ;
  211.  
  212. extern LPWAVEFORMATEX glpwfex ;
  213.  
  214. //
  215. // Dialog Box Procedures...
  216. //
  217. int FAR PASCAL AboutProc(HWND, UINT, UINT, LONG) ;
  218. int FAR PASCAL AudioFormatProc(HWND, UINT, UINT, LONG) ;
  219. int FAR PASCAL CapSetUpProc(HWND, UINT, UINT, LONG) ;
  220. BOOL CALLBACK MakePaletteProc(HWND, UINT, UINT, LONG) ;
  221. int FAR PASCAL AllocCapFileProc(HWND, UINT, UINT, LONG) ;
  222.