Leaked source code of windows server 2003
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.

466 lines
12 KiB

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form frmHHT
  4. BorderStyle = 1 'Fixed Single
  5. Caption = "Create HHT and CAB"
  6. ClientHeight = 4230
  7. ClientLeft = 45
  8. ClientTop = 330
  9. ClientWidth = 6015
  10. LinkTopic = "Form1"
  11. MaxButton = 0 'False
  12. MinButton = 0 'False
  13. ScaleHeight = 4230
  14. ScaleWidth = 6015
  15. StartUpPosition = 3 'Windows Default
  16. Begin VB.TextBox txtLanguage
  17. Height = 285
  18. Left = 960
  19. TabIndex = 14
  20. Text = "ALL"
  21. Top = 3000
  22. Width = 4935
  23. End
  24. Begin VB.CommandButton cmdCreate
  25. Caption = "Create"
  26. Height = 375
  27. Left = 3360
  28. TabIndex = 16
  29. Top = 3720
  30. Width = 1215
  31. End
  32. Begin VB.CommandButton cmdCancel
  33. Caption = "Cancel"
  34. Height = 375
  35. Left = 4680
  36. TabIndex = 17
  37. Top = 3720
  38. Width = 1215
  39. End
  40. Begin VB.Frame fraSKU
  41. Caption = "SKU"
  42. Height = 2295
  43. Left = 120
  44. TabIndex = 3
  45. Top = 600
  46. Width = 5775
  47. Begin VB.OptionButton optSKU
  48. Caption = "All"
  49. Height = 255
  50. Index = 11
  51. Left = 120
  52. TabIndex = 20
  53. Top = 1920
  54. Width = 2295
  55. End
  56. Begin VB.OptionButton optSKU
  57. Caption = "Server"
  58. Height = 255
  59. Index = 10
  60. Left = 3000
  61. TabIndex = 19
  62. Top = 1560
  63. Width = 2295
  64. End
  65. Begin VB.OptionButton optSKU
  66. Caption = "Desktop"
  67. Height = 255
  68. Index = 9
  69. Left = 120
  70. TabIndex = 18
  71. Top = 1560
  72. Width = 2295
  73. End
  74. Begin VB.OptionButton optSKU
  75. Caption = "Windows Me"
  76. Height = 255
  77. Index = 0
  78. Left = 120
  79. TabIndex = 4
  80. Top = 240
  81. Width = 2295
  82. End
  83. Begin VB.OptionButton optSKU
  84. Caption = "64-bit Datacenter Server"
  85. Height = 255
  86. Index = 8
  87. Left = 3000
  88. TabIndex = 12
  89. Top = 1200
  90. Width = 2295
  91. End
  92. Begin VB.OptionButton optSKU
  93. Caption = "64-bit Advanced Server"
  94. Height = 255
  95. Index = 6
  96. Left = 3000
  97. TabIndex = 10
  98. Top = 720
  99. Width = 2295
  100. End
  101. Begin VB.OptionButton optSKU
  102. Caption = "64-bit Professional"
  103. Height = 255
  104. Index = 3
  105. Left = 120
  106. TabIndex = 7
  107. Top = 960
  108. Width = 2295
  109. End
  110. Begin VB.OptionButton optSKU
  111. Caption = "32-bit Datacenter Server"
  112. Height = 255
  113. Index = 7
  114. Left = 3000
  115. TabIndex = 11
  116. Top = 960
  117. Width = 2295
  118. End
  119. Begin VB.OptionButton optSKU
  120. Caption = "32-bit Advanced Server"
  121. Height = 255
  122. Index = 5
  123. Left = 3000
  124. TabIndex = 9
  125. Top = 480
  126. Width = 2295
  127. End
  128. Begin VB.OptionButton optSKU
  129. Caption = "32-bit Server"
  130. Height = 255
  131. Index = 4
  132. Left = 3000
  133. TabIndex = 8
  134. Top = 240
  135. Width = 2295
  136. End
  137. Begin VB.OptionButton optSKU
  138. Caption = "32-bit Professional"
  139. Height = 255
  140. Index = 2
  141. Left = 120
  142. TabIndex = 6
  143. Top = 720
  144. Width = 2295
  145. End
  146. Begin VB.OptionButton optSKU
  147. Caption = "32-bit Personal"
  148. Height = 255
  149. Index = 1
  150. Left = 120
  151. TabIndex = 5
  152. Top = 480
  153. Width = 2295
  154. End
  155. End
  156. Begin VB.CommandButton cmdBrowse
  157. Caption = "..."
  158. Height = 315
  159. Left = 5520
  160. TabIndex = 2
  161. Top = 120
  162. Width = 375
  163. End
  164. Begin VB.TextBox txtName
  165. Height = 315
  166. Left = 1080
  167. TabIndex = 1
  168. Tag = "1"
  169. Top = 120
  170. Width = 4335
  171. End
  172. Begin MSComDlg.CommonDialog dlgFileOpen
  173. Left = 120
  174. Top = 3720
  175. _ExtentX = 847
  176. _ExtentY = 847
  177. _Version = 393216
  178. End
  179. Begin VB.Label lblLanguage
  180. Caption = "Language:"
  181. Height = 255
  182. Left = 120
  183. TabIndex = 13
  184. Top = 3000
  185. Width = 855
  186. End
  187. Begin VB.Label lblStatus
  188. BorderStyle = 1 'Fixed Single
  189. Caption = "Entry #1 created"
  190. Height = 255
  191. Left = 120
  192. TabIndex = 15
  193. Tag = "1"
  194. Top = 3360
  195. Width = 5775
  196. End
  197. Begin VB.Label lblName
  198. Caption = "File Name:"
  199. Height = 255
  200. Left = 120
  201. TabIndex = 0
  202. Top = 120
  203. Width = 855
  204. End
  205. End
  206. Attribute VB_Name = "frmHHT"
  207. Attribute VB_GlobalNameSpace = False
  208. Attribute VB_Creatable = False
  209. Attribute VB_PredeclaredId = True
  210. Attribute VB_Exposed = False
  211. Option Explicit
  212. Private Const DATE_FORMAT_C As String = "Short Date"
  213. Private WithEvents p_clsHHT As AuthDatabase.HHT
  214. Attribute p_clsHHT.VB_VarHelpID = -1
  215. Private Enum SKU_INDEX_E
  216. SI_WINDOWS_MILLENNIUM_E = 0
  217. SI_STANDARD_E = 1
  218. SI_PROFESSIONAL_E = 2
  219. SI_PROFESSIONAL_64_E = 3
  220. SI_SERVER_E = 4
  221. SI_ADVANCED_SERVER_E = 5
  222. SI_ADVANCED_SERVER_64_E = 6
  223. SI_DATA_CENTER_SERVER_E = 7
  224. SI_DATA_CENTER_SERVER_64_E = 8
  225. SI_DESKTOP_ALL_E = 9
  226. SI_SERVER_ALL_E = 10
  227. SI_ALL_E = 11
  228. End Enum
  229. Private Const FILE_FILTER_CAB_C As String = "CAB File (*.cab)|*.cab"
  230. Private p_blnCreating As Boolean
  231. Private p_blnCancelHHTCreation As Boolean
  232. Private Sub Form_Load()
  233. Set p_clsHHT = g_AuthDatabase.HHT
  234. p_blnCreating = False
  235. p_blnCancelHHTCreation = False
  236. p_SetToolTips
  237. SetFontInternal Me
  238. End Sub
  239. Private Sub Form_Activate()
  240. optSKU(SI_STANDARD_E).Value = True
  241. lblStatus = ""
  242. p_DisableCreate
  243. cmdCreate.Default = True
  244. cmdCancel.Cancel = True
  245. End Sub
  246. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  247. If (p_blnCreating) Then
  248. cmdCancel_Click
  249. Cancel = True
  250. End If
  251. End Sub
  252. Private Sub Form_Unload(Cancel As Integer)
  253. Set p_clsHHT = Nothing
  254. End Sub
  255. Private Sub txtName_Change()
  256. If (txtName = "") Then
  257. p_DisableCreate
  258. Else
  259. p_EnableCreate
  260. End If
  261. End Sub
  262. Private Sub cmdBrowse_Click()
  263. On Error GoTo LErrorHandler
  264. dlgFileOpen.CancelError = True
  265. dlgFileOpen.Flags = cdlOFNHideReadOnly
  266. dlgFileOpen.Filter = FILE_FILTER_CAB_C
  267. dlgFileOpen.ShowSave
  268. txtName = dlgFileOpen.FileName
  269. LEnd:
  270. Exit Sub
  271. LErrorHandler:
  272. GoTo LEnd
  273. End Sub
  274. Sub cmdCreate_Click()
  275. Dim strName As String
  276. On Error GoTo LErrorHandler
  277. p_blnCreating = True
  278. p_DisableEverythingExceptCancel
  279. p_clsHHT.GenerateCAB txtName, p_GetSelectedSKU, txtLanguage
  280. LEnd:
  281. p_blnCreating = False
  282. p_Exit
  283. Exit Sub
  284. LErrorHandler:
  285. Select Case Err.Number
  286. Case cdlCancel, errCancel
  287. ' Nothing. The user cancelled.
  288. Case errDatabaseVersionIncompatible
  289. DisplayDatabaseVersionError
  290. Case errProductIdOrVersionMissing
  291. MsgBox "The Product ID or Product Version is missing. " & _
  292. "Please configure these values by selecting Tools/Parameters.", vbExclamation + vbOKOnly
  293. Case Else
  294. g_ErrorInfo.SetInfoAndDump "cmdCreate_Click"
  295. End Select
  296. GoTo LEnd
  297. End Sub
  298. Private Sub cmdCancel_Click()
  299. If (p_blnCreating) Then
  300. p_blnCreating = False
  301. p_blnCancelHHTCreation = True
  302. p_DisableCancel
  303. Else
  304. p_Exit
  305. End If
  306. End Sub
  307. Private Sub p_clsHHT_ReportStatus(ByVal strStatus As String, ByRef blnCancel As Boolean)
  308. lblStatus = strStatus
  309. DoEvents
  310. If (p_blnCancelHHTCreation) Then
  311. blnCancel = True
  312. p_Exit
  313. End If
  314. End Sub
  315. Private Function p_GetSelectedSKU() As SKU_E
  316. If (optSKU(SI_STANDARD_E).Value) Then
  317. p_GetSelectedSKU = SKU_STANDARD_E
  318. ElseIf (optSKU(SI_PROFESSIONAL_E).Value) Then
  319. p_GetSelectedSKU = SKU_PROFESSIONAL_E
  320. ElseIf (optSKU(SI_SERVER_E).Value) Then
  321. p_GetSelectedSKU = SKU_SERVER_E
  322. ElseIf (optSKU(SI_ADVANCED_SERVER_E).Value) Then
  323. p_GetSelectedSKU = SKU_ADVANCED_SERVER_E
  324. ElseIf (optSKU(SI_DATA_CENTER_SERVER_E).Value) Then
  325. p_GetSelectedSKU = SKU_DATA_CENTER_SERVER_E
  326. ElseIf (optSKU(SI_PROFESSIONAL_64_E).Value) Then
  327. p_GetSelectedSKU = SKU_PROFESSIONAL_64_E
  328. ElseIf (optSKU(SI_ADVANCED_SERVER_64_E).Value) Then
  329. p_GetSelectedSKU = SKU_ADVANCED_SERVER_64_E
  330. ElseIf (optSKU(SI_DATA_CENTER_SERVER_64_E).Value) Then
  331. p_GetSelectedSKU = SKU_DATA_CENTER_SERVER_64_E
  332. ElseIf (optSKU(SI_WINDOWS_MILLENNIUM_E).Value) Then
  333. p_GetSelectedSKU = SKU_WINDOWS_MILLENNIUM_E
  334. ElseIf (optSKU(SI_SERVER_ALL_E).Value) Then
  335. p_GetSelectedSKU = SKU_SERVER_ALL_E
  336. ElseIf (optSKU(SI_DESKTOP_ALL_E).Value) Then
  337. p_GetSelectedSKU = SKU_DESKTOP_ALL_E
  338. ElseIf (optSKU(SI_ALL_E).Value) Then
  339. p_GetSelectedSKU = SKU_ALL_E
  340. End If
  341. End Function
  342. Private Sub p_Exit()
  343. Set frmHHT = Nothing
  344. Unload Me
  345. End Sub
  346. Private Sub p_EnableCreate()
  347. cmdCreate.Enabled = True
  348. End Sub
  349. Private Sub p_DisableCreate()
  350. cmdCreate.Enabled = False
  351. End Sub
  352. Private Sub p_DisableCancel()
  353. cmdCancel.Enabled = False
  354. End Sub
  355. Private Sub p_DisableEverythingExceptCancel()
  356. Dim optIndex As Long
  357. lblName.Enabled = False
  358. txtName.Enabled = False
  359. cmdBrowse.Enabled = False
  360. fraSKU.Enabled = False
  361. For optIndex = optSKU.LBound To optSKU.UBound
  362. optSKU(optIndex).Enabled = False
  363. Next
  364. p_DisableCreate
  365. End Sub
  366. Private Sub p_SetToolTips()
  367. lblName.ToolTipText = "Type the path and name of the CAB file to create."
  368. txtName.ToolTipText = lblName.ToolTipText
  369. fraSKU.ToolTipText = "Select the desired SKU for which to create the file."
  370. End Sub