Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

222 lines
3.4 KiB

  1. #include <windows.h>
  2. #include <commdlg.h>
  3. #include "rc_ids.h"
  4. #include "dialogs.h"
  5. #include "msg.h"
  6. //
  7. // Define enumeration type for product type.
  8. // The user can override the product type on the command line
  9. // (ie, if we are on a workstation normally we look for worksttion
  10. // books, but user can override this).
  11. //
  12. typedef enum {
  13. ForceNone,
  14. ForceServer,
  15. ForceWorkstation
  16. } ForceProduct;
  17. //
  18. // module handle
  19. //
  20. extern HANDLE hInst;
  21. //
  22. // Handle of main icon.
  23. //
  24. extern HICON MainIcon;
  25. //
  26. // Command line parameters
  27. //
  28. extern ForceProduct CmdLineForce;
  29. //
  30. // Fixed name of the help file. This is dependent on whether
  31. // this is server or workstation and is set in FixupNames().
  32. //
  33. extern PWSTR HelpFileName;
  34. //
  35. // Path on CD-ROM where online books files are located.
  36. // We "just know" this value.
  37. //
  38. extern PWSTR PathOfBooksFilesOnCd;
  39. //
  40. // Name of profile value that stores the last known location
  41. // of the online books helpfile. This value varies depending
  42. // on the product (workstation/server).
  43. //
  44. extern PWSTR BooksProfileLocation;
  45. //
  46. // Profile routines. These actually operate on registry data.
  47. // See bkprof.c.
  48. //
  49. PWSTR
  50. MyGetProfileValue(
  51. IN PWSTR ValueName,
  52. IN PWSTR DefaultValue
  53. );
  54. BOOL
  55. MySetProfileValue(
  56. IN PWSTR ValueName,
  57. OUT PWSTR Value
  58. );
  59. //
  60. // Routines to manipulate help files and help file names.
  61. // See bkhlpfil.c.
  62. //
  63. VOID
  64. FormHelpfilePaths(
  65. IN WCHAR Drive, OPTIONAL
  66. IN PWSTR Path,
  67. IN PWSTR FilenamePrepend, OPTIONAL
  68. OUT PWSTR Filename,
  69. OUT PWSTR Directory OPTIONAL
  70. );
  71. BOOL
  72. CheckHelpfilePresent(
  73. IN PWSTR Path
  74. );
  75. VOID
  76. FireUpWinhelp(
  77. IN WCHAR Drive, OPTIONAL
  78. IN PWSTR Path
  79. );
  80. //
  81. // Memory manipulation routines. Note that MyMalloc always
  82. // succeeds (it does not return if it fails).
  83. // See bkmem.c.
  84. //
  85. VOID
  86. OutOfMemory(
  87. VOID
  88. );
  89. PVOID
  90. MyMalloc(
  91. IN DWORD Size
  92. );
  93. VOID
  94. MyFree(
  95. IN PVOID Block
  96. );
  97. //
  98. // Resource manipulation routines.
  99. // See bkres.c.
  100. //
  101. PWSTR
  102. MyLoadString(
  103. IN UINT StringId
  104. );
  105. PWSTR
  106. RetreiveMessage(
  107. IN UINT MessageId,
  108. ...
  109. );
  110. int
  111. MessageBoxFromMessage(
  112. IN HWND Owner,
  113. IN UINT MessageId,
  114. IN UINT CaptionStringId,
  115. IN UINT Style,
  116. ...
  117. );
  118. //
  119. // Routine to install the on-line books to a local hard drive.
  120. // See bkinst.c.
  121. //
  122. BOOL
  123. DoInstall(
  124. IN OUT PWSTR *Location
  125. );
  126. //
  127. // Routine to carry out an action with a billboard
  128. // telling the user what is going on.
  129. // See bkthrdlg.c.
  130. //
  131. DWORD
  132. ActionWithBillboard(
  133. IN PTHREAD_START_ROUTINE ThreadEntry,
  134. IN HWND OwnerWindow,
  135. IN UINT CaptionStringId,
  136. IN UINT TextStringId,
  137. IN PVOID UserData
  138. );
  139. //
  140. // Structure that is passed to ThreadEntry.
  141. //
  142. typedef struct _ACTIONTHREADPARAMS {
  143. HWND hdlg;
  144. PVOID UserData;
  145. } ACTIONTHREADPARAMS, *PACTIONTHREADPARAMS;
  146. //
  147. // Miscellaneous utility routines.
  148. // See bkutils.c.
  149. //
  150. WCHAR
  151. LocateCdRomDrive(
  152. VOID
  153. );
  154. BOOL
  155. IsCdRomInDrive(
  156. IN WCHAR Drive,
  157. IN PWSTR TagFile
  158. );
  159. UINT
  160. MyGetDriveType(
  161. IN WCHAR Drive
  162. );
  163. BOOL
  164. DoesFileExist(
  165. IN PWSTR File
  166. );
  167. PWSTR
  168. DupString(
  169. IN PWSTR String
  170. );
  171. VOID
  172. CenterDialogOnScreen(
  173. IN HWND hdlg
  174. );
  175. VOID
  176. CenterDialogInWindow(
  177. IN HWND hdlg,
  178. IN HWND hwnd
  179. );
  180. VOID
  181. MyError(
  182. IN HWND Owner,
  183. IN UINT StringId,
  184. IN BOOL Fatal
  185. );