home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / winbase / io / filer / globals.h < prev    next >
C/C++ Source or Header  |  1997-10-05  |  9KB  |  286 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. #include<windows.h>
  13.  
  14. //
  15. // Accellerator IDs
  16. //
  17. #define ACCEL_ID        1001
  18.  
  19. //
  20. // Icon IDs
  21. //
  22. #define UI_FILERICON    2001
  23.  
  24. //
  25. // DialogBox Control IDs
  26. //
  27. #define SB_OK           3001
  28. #define SB_CANCEL       3002
  29. #define SB_ACTION       3003
  30. #define SB_TOFROM       3004
  31. #define SB_SOURCE       3005
  32. #define SB_DEST         3006
  33. #define SB_STATIC       3007
  34. #define SB_KEY          3008
  35. #define SB_VALUE        3009
  36. #define SB_SCROLL       3010
  37.  
  38. //
  39. // String Table IDs
  40. //
  41. #define STR_EXE         4001
  42. #define STR_COM         4002
  43. #define STR_CMD         4003
  44. #define STR_BAT         4004
  45. #define IDS_ABOUTDLGERR 4005
  46. #define IDS_DRVBUTTNERR 4006
  47. #define IDS_CHNGDRVERR  4007
  48. #define IDS_SELOBJERR   4008
  49. #define IDS_BITBLTERR   4009
  50. #define IDS_DRVNOTACTVE 4010
  51. #define IDS_INSRTMEDIA  4011
  52. #define IDS_SRCSTRNGERR 4012
  53. #define IDS_CANTSPAWN   4013
  54. #define IDS_MENUERR1    4014
  55. #define IDS_MENUERR2    4015
  56. #define IDS_MENUERR3    4016
  57. #define IDS_MENUERR4    4017
  58. #define    IDS_ENUMDRVERR    4018
  59. #define    IDS_ENUMALOCERR 4019
  60. #define    IDS_ENUMSTRERR    4020
  61. #define    IDS_DRVALOCERR    4021
  62. #define IDS_DCCDRVLST    4022
  63. #define IDS_DCCCURDIR   4023
  64. #define IDS_DCCTABSTP   4024
  65. #define IDS_MMOPENERR   4025
  66. #define IDS_COPYING     4026
  67. #define IDS_COPYINGTO   4027
  68. #define IDS_DELETING    4028
  69. #define IDS_DELETINGFRM 4029
  70. #define IDS_MOVING      4030
  71. #define IDS_RENAMEERR   4031
  72. #define IDS_MKDIRERR    4032
  73. #define IDS_VERDLGERR   4033
  74. #define IDS_MMEXPAND    4034
  75. #define IDS_REFRESH1    4035
  76. #define IDS_REFRESH2    4036
  77. #define IDS_REFRESH3    4037
  78. #define IDS_FILDIRERR   4038
  79. #define IDS_FILDIRERR2  4039
  80. #define IDS_FILDIRERR3  4040
  81. #define IDS_FILDIRERR4  4041
  82. #define IDS_DBLCLKERR   4042
  83. #define IDS_SELCNGERR   4043
  84. #define IDS_CONDIRERR   4044
  85. #define IDS_LBNOTFYERR  4045
  86. #define IDS_PARNTFYERR  4046
  87. #define IDS_GETLBTXTERR 4047
  88. #define IDS_OPENLBERR   4048 
  89. #define IDS_CANTEDIT    4050
  90. #define IDS_FILE        4051
  91. #define IDS_DIR         4052
  92. #define IDS_GETVERERR   4053
  93. #define IDS_GETVERERR2  4054
  94. #define IDS_GETVERERR3  4055
  95. #define IDS_GETVERERR4  4056
  96. #define IDS_GETVERERR5  4057
  97. #define IDS_GETVERERR6  4058
  98. #define IDS_GETVERERR7  4059
  99. #define IDS_GETVERERR8  4060
  100. #define IDS_ISDIRERR    4061
  101. #define IDS_EXEFILEERR  4062
  102. #define IDS_SELPROCERR  4063
  103. #define IDS_SELDLGERR   4064
  104. #define IDS_SELDLGERR2  4065
  105. #define IDS_SELDLGERR3  4066
  106. #define IDS_SELDLGERR4  4067
  107. #define IDS_SELDLGERR5  4068
  108. #define IDS_SELDLGERR6  4069
  109. #define IDS_SELDLGERR7  4070
  110. #define IDS_FILEIOERR   4071
  111. #define IDS_FILEIOERR2  4072
  112. #define IDS_FILEIOERR3  4073
  113. #define IDS_HNDIOMSG    4074
  114. #define IDS_HNDIOMSG2   4075
  115. #define IDS_HNDIOMSG3   4076
  116. #define IDS_HNDIOMSG4   4077
  117. #define IDS_HNDIOMSG5   4078
  118. #define IDS_RENMEMSG    4079
  119. #define IDS_RENMEMSG2   4080
  120. #define IDS_RENMEMSG3   4081
  121. #define IDS_RENMEMSG4   4082
  122. #define IDS_RENMEMSG5   4083
  123. #define IDS_RENMEMSG6   4084
  124. #define IDS_RENMEMSG7   4085
  125. #define IDS_MKDIRMSG    4086
  126. #define IDS_MKDIRMSG2   4087
  127. #define IDS_MKDIRMSG3   4088
  128. #define IDS_TXTMSG      4089
  129.  
  130. #define STR_DEF_EDITOR  4101
  131.  
  132. //
  133. // Bitmap IDs
  134. //
  135. #define UB_BMP_MARKER   5001    // This should be the same as the first bitmap.
  136. #define UB_FLOPPY1      5001    // THESE BITMAP IDs MUST BE CONTIGUOUS AND
  137. #define UB_FLOPPY2      5002    //   IN THIS ORDER!  For 'ease of loading'.
  138. #define UB_REMOTE1      5003
  139. #define UB_REMOTE2      5004
  140. #define UB_CD1          5005
  141. #define UB_CD2          5006
  142. #define UB_FIXED1       5007
  143. #define UB_FIXED2       5008
  144.  
  145. //
  146. // Command line window and Drv-CHILD child window IDs
  147. //
  148. #define COMMAND_ID      6001    // Command Line Window
  149. #define TEXT_WINDOW_ID  6002    // Title Bar
  150. #define LISTDIR_ID      6003    // Directory ListBox
  151. #define LISTFILE_ID     6004    // File ListBox
  152.  
  153. //
  154. // Internal Main window IDs
  155. //
  156. #define MM_FILLDIR      7001
  157. #define MM_FILLFILE     7002
  158.  
  159. //
  160. // Menu ID's, VKEYs, & other WM_COMMAND messages
  161. //
  162. #define MM_OPEN         8001
  163. #define MM_COPY         8002
  164. #define MM_DELETE       8003
  165. #define MM_MOVE         8004
  166. #define MM_RENAME       8005
  167. #define MM_MKDIR        8006
  168. #define MM_DELDIR       8007
  169. #define MM_VERSION      8008
  170. #define MM_EXIT         8009
  171.  
  172. #define MM_REFRESH      8101
  173. #define MM_ACTIVEDRV    8102
  174. #define MM_TAB          8103
  175. #define MM_SWAP         8104
  176. #define MM_ORIENT       8105
  177. #define MM_EXPAND       8106
  178. #define MM_KEEPCMD      8107
  179.  
  180. #define MM_ESCAPE       8112
  181. #define MM_TOGGLE       8113
  182.  
  183. #define MM_ABOUT        8201
  184.  
  185. #define MM_DRIVE_NUM    8301       // ...Through 8226, one for each drive letter
  186.                     //   .
  187.                     //   .
  188.                     //  8326
  189.  
  190.  
  191. //
  192. // constants
  193. //
  194. #define MAIN_WIDTH          605    // Default width and height of main window
  195. #define MAIN_HEIGHT         400
  196.  
  197. #define DRIVE_BITMAP_WIDTH  23     // Width and height of drive toolbar bitmaps
  198. #define DRIVE_BITMAP_HEIGHT 14     //   assoc. w/ bitmap IDs above.
  199. #define DRIVE_LETTER_SPACING 2     // Space between drv bmp and drv letter label
  200. #define DRIVE_BITMAP_SPACING 6     // Space on either side of drv bitmap-labels
  201. #define NUM_BITMAPS          8     // # types of Drive Bitmaps to be loaded.
  202.  
  203. #define DIRECTORY_STRING_SIZE MAX_PATH  // Size of max allowable direcory path
  204.  
  205. #define LIST_BORDER         2      // Space between listbox and Drv child frame
  206.  
  207. #define DRIVE_MENU_NUM      2      // This is the 'Drives' submenu
  208.  
  209. #define LISTBOX_TAB_SIZE    8      // Size of the tabs in the Drv child LBs
  210.  
  211. #define OVER_UNDER          0      // Relative positions of Drv children
  212. #define SIDE_BY_SIDE        1
  213.  
  214. #define BOLD_FONT           700    // GetDeviceCaps sez this value is for bold
  215.                                    //   in the lfWeight LOGFONT member
  216.  
  217. #define NUM_EXTENSION_STRINGS   4  // Lists number of file ext. in stringtable
  218. #define EXTENSION_LENGTH        5  // Tot. number of characters in extension,
  219.                                    //  including '\0' char.
  220.  
  221. #define FILE_SYSTEM_STRING_SIZE         20      // Must be >= 8
  222.  
  223. #define NUM_POSSIBLE_REMOVABLE_DRIVES   26      // A-Z
  224.  
  225. #define MUTEX_TIMEOUT       50     // LB Mutex timeout in milliseconds
  226.  
  227.  
  228. // The following are used in the .EXE Version retrieval code in DRVPROC.C
  229. #define NUM_VERSION_INFO_KEYS    12     // See FilerGetVersion()
  230. #define VERSION_DLG_LB_HEIGHT    10     // height in text lines of version dlg LBs
  231.  
  232. #define VERSION_INFO_KEY_ROOT    TEXT("\\StringFileInfo\\")
  233. // end .EXE Version code constants
  234.  
  235.  
  236. //
  237. // Drive enumeration strucure
  238. //
  239. typedef struct _PerDriveInfo {
  240.     TCHAR   DriveLetter;
  241.     LPTSTR  DriveName;
  242.     TCHAR   FileSystem[FILE_SYSTEM_STRING_SIZE];
  243.     UINT    DriveType;
  244.     struct _PerDriveInfo *next;
  245. } DRVINFO, *LPDINFO;
  246.  
  247. //
  248. // Instance data for each Drv child window
  249. //
  250. typedef struct _PerWndInfo {
  251.     HWND    hwnd;                       // Handle to Drive child window
  252.     HWND    hParent;                    // Handle to Filer main window
  253.     HWND    hTextWnd;                   // Handle to Drive child Title Bar
  254.     HWND    hFileLB;                    // Handle to Drv child File LB
  255.     HWND    hDirLB;                     // Handle to Drv child Dir LB
  256.     HANDLE  hDirThread;                 // Handle to ExpDir or FullExpand thread
  257.     HANDLE  hDirMutex;                  // Protects Dir LB from mult. access
  258.     HANDLE  hFileMutex;                 // Protects File LB from mult. access
  259.     BOOL    fDirLeft;                   // Flag: the Dir LB is on left
  260.     BOOL    fDirExpand;                 // Flag: the Dir LB is fully expanded
  261.     BOOL    fSuicide;                   // Flag: kills ExpDir/FullExpand thread
  262.     BOOL    fEscape;                    // Flag: User aborted Expand thread
  263.     LPDINFO lpDriveInfo;                // pointer to current _PerDriveInfo
  264.     TCHAR   CaptionBarText[DIRECTORY_STRING_SIZE]; // Drv Child Title text
  265. } DRVCHILDINFO, *LPCINFO;
  266.  
  267. typedef struct _PerButtonInfo {
  268.     HANDLE          hButton;
  269.     BOOL            fButtonDown;
  270.     LPDINFO         lpDrive;
  271.     struct _PerButtonInfo  *next;
  272. }   BINFO, *LPBINFO;
  273.  
  274. typedef struct _SelectDlgInfo {
  275.     HWND    hwnd;
  276.     DWORD   dwAction;
  277.     LPTSTR  szAction;
  278.     LPTSTR  szToFrom;
  279. } SELECTINFO, *LPSINFO;
  280.  
  281. //  .EXE version information key structure: for FilerGetVersion() in DRVPROC.C
  282. typedef struct _VersionKeyInfo {
  283.     TCHAR const *szKey;
  284.     TCHAR       *szValue;
  285. } VKINFO, *LPVKINFO;
  286.