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.

624 lines
18 KiB

  1. VERSION 5.00
  2. Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
  3. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  4. Begin VB.Form frmParameters
  5. Caption = "Parameters"
  6. ClientHeight = 6975
  7. ClientLeft = 60
  8. ClientTop = 345
  9. ClientWidth = 7590
  10. LinkTopic = "Form1"
  11. ScaleHeight = 6975
  12. ScaleWidth = 7590
  13. StartUpPosition = 3 'Windows Default
  14. Begin VB.Frame fraSKU
  15. Height = 5535
  16. Left = 120
  17. TabIndex = 2
  18. Top = 480
  19. Width = 7335
  20. Begin TabDlg.SSTab SSTab
  21. Height = 3735
  22. Left = 120
  23. TabIndex = 11
  24. Top = 1680
  25. Width = 7095
  26. _ExtentX = 12515
  27. _ExtentY = 6588
  28. _Version = 393216
  29. Tabs = 5
  30. Tab = 1
  31. TabHeight = 520
  32. TabCaption(0) = "Files to Include"
  33. TabPicture(0) = "frmParameters.frx":0000
  34. Tab(0).ControlEnabled= 0 'False
  35. Tab(0).Control(0)= "txtFiles"
  36. Tab(0).ControlCount= 1
  37. TabCaption(1) = "Pkg Desc Addition"
  38. TabPicture(1) = "frmParameters.frx":001C
  39. Tab(1).ControlEnabled= -1 'True
  40. Tab(1).Control(0)= "txtXML(0)"
  41. Tab(1).Control(0).Enabled= 0 'False
  42. Tab(1).ControlCount= 1
  43. TabCaption(2) = "Pkg Desc Preview"
  44. TabPicture(2) = "frmParameters.frx":0038
  45. Tab(2).ControlEnabled= 0 'False
  46. Tab(2).Control(0)= "WebBrowser(0)"
  47. Tab(2).ControlCount= 1
  48. TabCaption(3) = "HHT Addition"
  49. TabPicture(3) = "frmParameters.frx":0054
  50. Tab(3).ControlEnabled= 0 'False
  51. Tab(3).Control(0)= "txtXML(1)"
  52. Tab(3).ControlCount= 1
  53. TabCaption(4) = "HHT Preview"
  54. TabPicture(4) = "frmParameters.frx":0070
  55. Tab(4).ControlEnabled= 0 'False
  56. Tab(4).Control(0)= "WebBrowser(1)"
  57. Tab(4).ControlCount= 1
  58. Begin VB.TextBox txtFiles
  59. Height = 2895
  60. Left = -74880
  61. MultiLine = -1 'True
  62. TabIndex = 20
  63. Top = 720
  64. Width = 6735
  65. End
  66. Begin SHDocVwCtl.WebBrowser WebBrowser
  67. Height = 2895
  68. Index = 1
  69. Left = -74880
  70. TabIndex = 15
  71. Top = 720
  72. Width = 6735
  73. ExtentX = 11880
  74. ExtentY = 5106
  75. ViewMode = 0
  76. Offline = 0
  77. Silent = 0
  78. RegisterAsBrowser= 0
  79. RegisterAsDropTarget= 1
  80. AutoArrange = 0 'False
  81. NoClientEdge = 0 'False
  82. AlignLeft = 0 'False
  83. NoWebView = 0 'False
  84. HideFileNames = 0 'False
  85. SingleClick = 0 'False
  86. SingleSelection = 0 'False
  87. NoFolders = 0 'False
  88. Transparent = 0 'False
  89. ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  90. Location = "http:///"
  91. End
  92. Begin VB.TextBox txtXML
  93. Height = 2895
  94. Index = 1
  95. Left = -74880
  96. MultiLine = -1 'True
  97. ScrollBars = 3 'Both
  98. TabIndex = 14
  99. Tag = "1"
  100. Top = 720
  101. Width = 6735
  102. End
  103. Begin VB.TextBox txtXML
  104. Height = 2895
  105. Index = 0
  106. Left = 120
  107. MultiLine = -1 'True
  108. ScrollBars = 3 'Both
  109. TabIndex = 12
  110. Tag = "1"
  111. Top = 720
  112. Width = 6735
  113. End
  114. Begin SHDocVwCtl.WebBrowser WebBrowser
  115. Height = 2895
  116. Index = 0
  117. Left = -74880
  118. TabIndex = 13
  119. Top = 720
  120. Width = 6735
  121. ExtentX = 11880
  122. ExtentY = 5106
  123. ViewMode = 0
  124. Offline = 0
  125. Silent = 0
  126. RegisterAsBrowser= 0
  127. RegisterAsDropTarget= 1
  128. AutoArrange = 0 'False
  129. NoClientEdge = 0 'False
  130. AlignLeft = 0 'False
  131. NoWebView = 0 'False
  132. HideFileNames = 0 'False
  133. SingleClick = 0 'False
  134. SingleSelection = 0 'False
  135. NoFolders = 0 'False
  136. Transparent = 0 'False
  137. ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  138. Location = "http:///"
  139. End
  140. End
  141. Begin VB.TextBox txtValue
  142. Height = 285
  143. Index = 3
  144. Left = 2400
  145. TabIndex = 8
  146. Tag = "1"
  147. Top = 960
  148. Width = 4815
  149. End
  150. Begin VB.TextBox txtValue
  151. Height = 285
  152. Index = 2
  153. Left = 2400
  154. TabIndex = 6
  155. Tag = "1"
  156. Top = 600
  157. Width = 4815
  158. End
  159. Begin VB.TextBox txtValue
  160. Height = 285
  161. Index = 1
  162. Left = 2400
  163. TabIndex = 4
  164. Tag = "1"
  165. Top = 240
  166. Width = 4815
  167. End
  168. Begin VB.TextBox txtValue
  169. Height = 285
  170. Index = 4
  171. Left = 2400
  172. TabIndex = 10
  173. Tag = "1"
  174. Top = 1320
  175. Width = 4815
  176. End
  177. Begin VB.Label lbl
  178. Caption = "Product Version:"
  179. Height = 255
  180. Index = 3
  181. Left = 120
  182. TabIndex = 7
  183. Top = 960
  184. Width = 2295
  185. End
  186. Begin VB.Label lbl
  187. Caption = "Product ID:"
  188. Height = 255
  189. Index = 2
  190. Left = 120
  191. TabIndex = 5
  192. Top = 600
  193. Width = 2295
  194. End
  195. Begin VB.Label lbl
  196. Caption = "Display Name:"
  197. Height = 255
  198. Index = 1
  199. Left = 120
  200. TabIndex = 3
  201. Top = 240
  202. Width = 2295
  203. End
  204. Begin VB.Label lbl
  205. Caption = "Broken Link Working Directory:"
  206. Height = 255
  207. Index = 4
  208. Left = 120
  209. TabIndex = 9
  210. Top = 1320
  211. Width = 2295
  212. End
  213. End
  214. Begin VB.ComboBox cboSKU
  215. Height = 315
  216. Left = 600
  217. Style = 2 'Dropdown List
  218. TabIndex = 1
  219. Top = 120
  220. Width = 6855
  221. End
  222. Begin VB.TextBox txtValue
  223. Height = 285
  224. Index = 5
  225. Left = 1200
  226. TabIndex = 17
  227. Tag = "1"
  228. Top = 6120
  229. Width = 6255
  230. End
  231. Begin VB.CommandButton cmdSave
  232. Caption = "Save"
  233. Height = 375
  234. Left = 4920
  235. TabIndex = 18
  236. Top = 6480
  237. Width = 1215
  238. End
  239. Begin VB.CommandButton cmdClose
  240. Caption = "Close"
  241. Height = 375
  242. Left = 6240
  243. TabIndex = 19
  244. Top = 6480
  245. Width = 1215
  246. End
  247. Begin VB.Label lbl
  248. Caption = "SKU:"
  249. Height = 255
  250. Index = 0
  251. Left = 120
  252. TabIndex = 0
  253. Top = 120
  254. Width = 2295
  255. End
  256. Begin VB.Label lbl
  257. Caption = "Vendor String:"
  258. Height = 255
  259. Index = 5
  260. Left = 120
  261. TabIndex = 16
  262. Top = 6120
  263. Width = 2295
  264. End
  265. End
  266. Attribute VB_Name = "frmParameters"
  267. Attribute VB_GlobalNameSpace = False
  268. Attribute VB_Creatable = False
  269. Attribute VB_PredeclaredId = True
  270. Attribute VB_Exposed = False
  271. Option Explicit
  272. Private Enum TXTVALUE_INDEX_E
  273. VI_DISPLAY_NAME_E = 1
  274. VI_PRODUCT_ID_E = 2
  275. VI_PRODUCT_VERSION_E = 3
  276. VI_BL_DIRECTORY_E = 4
  277. VI_VENDOR_STRING_E = 5
  278. End Enum
  279. Private Enum XML_INDEX_E
  280. XI_PKG_DESC_E = 0
  281. XI_HHT_E = 1
  282. End Enum
  283. Private Enum SSTAB_INDEX_E
  284. SI_FILE_E = 0
  285. SI_PKG_DESC_E = 1
  286. SI_PKG_DESC_PREVIEW_E = 2
  287. SI_HHT_E = 3
  288. SI_HHT_PREVIEW_E = 4
  289. End Enum
  290. Private p_clsSizer As Sizer
  291. Private p_clsParameters As AuthDatabase.Parameters
  292. Private p_blnDirty As Boolean
  293. Private p_blnUpdating As Boolean
  294. Private p_enumCurrentSKU As SKU_E
  295. Private p_strTempFile As String
  296. Private Sub cboSKU_Click()
  297. p_ChangeSKU
  298. End Sub
  299. Private Sub cboSKU_Change()
  300. p_ChangeSKU
  301. End Sub
  302. Private Sub Form_Load()
  303. On Error GoTo LErrorHandler
  304. Dim FSO As Scripting.FileSystemObject
  305. cmdClose.Cancel = True
  306. cmdSave.Default = True
  307. Set p_clsSizer = New Sizer
  308. Set p_clsParameters = g_AuthDatabase.Parameters
  309. PopulateCboWithSKUs cboSKU, True
  310. Set FSO = New Scripting.FileSystemObject
  311. p_strTempFile = Environ$("TEMP") & "\" & FSO.GetTempName & ".xml"
  312. SetFontInternal Me
  313. p_enumCurrentSKU = 0
  314. p_ChangeSKU
  315. LEnd:
  316. Exit Sub
  317. LErrorHandler:
  318. GoTo LEnd
  319. End Sub
  320. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  321. Dim Response As VbMsgBoxResult
  322. If (p_blnDirty) Then
  323. Response = MsgBox("You have usaved changes. " & _
  324. "Are you sure that you want to exit?", vbOKCancel + vbExclamation)
  325. If (Response <> vbOK) Then
  326. Cancel = True
  327. End If
  328. End If
  329. End Sub
  330. Private Sub Form_Unload(Cancel As Integer)
  331. On Error Resume Next
  332. Dim FSO As Scripting.FileSystemObject
  333. Set p_clsSizer = Nothing
  334. Set p_clsParameters = Nothing
  335. Set FSO = New Scripting.FileSystemObject
  336. FSO.DeleteFile p_strTempFile
  337. End Sub
  338. Private Sub Form_Activate()
  339. On Error GoTo LErrorHandler
  340. p_SetSizingInfo
  341. LEnd:
  342. Exit Sub
  343. LErrorHandler:
  344. GoTo LEnd
  345. End Sub
  346. Private Sub Form_Resize()
  347. On Error GoTo LErrorHandler
  348. p_clsSizer.Resize
  349. LEnd:
  350. Exit Sub
  351. LErrorHandler:
  352. GoTo LEnd
  353. End Sub
  354. Private Sub cmdSave_Click()
  355. On Error GoTo LErrorHandler
  356. p_Save
  357. LEnd:
  358. p_blnDirty = False
  359. Exit Sub
  360. LErrorHandler:
  361. g_ErrorInfo.SetInfoAndDump "cmdSave_Click"
  362. GoTo LEnd
  363. End Sub
  364. Private Sub cmdClose_Click()
  365. Unload Me
  366. End Sub
  367. Private Sub SSTab_Click(PreviousTab As Integer)
  368. Dim strXML As String
  369. Dim intIndex As Long
  370. If (SSTab.Tab = SI_HHT_PREVIEW_E) Then
  371. intIndex = XI_HHT_E
  372. ElseIf (SSTab.Tab = SI_PKG_DESC_PREVIEW_E) Then
  373. intIndex = XI_PKG_DESC_E
  374. Else
  375. Exit Sub
  376. End If
  377. strXML = "<X>" & txtXML(intIndex) & "</X>"
  378. FileWrite p_strTempFile, strXML, , True
  379. WebBrowser(intIndex).Navigate p_strTempFile
  380. End Sub
  381. Private Sub txtValue_Change(Index As Integer)
  382. If (p_blnUpdating) Then
  383. Exit Sub
  384. End If
  385. p_blnDirty = True
  386. End Sub
  387. Private Sub txtXML_Change(Index As Integer)
  388. If (p_blnUpdating) Then
  389. Exit Sub
  390. End If
  391. p_blnDirty = True
  392. End Sub
  393. Private Sub txtFiles_Change()
  394. If (p_blnUpdating) Then
  395. Exit Sub
  396. End If
  397. p_blnDirty = True
  398. End Sub
  399. Private Sub txtXML_GotFocus(Index As Integer)
  400. cmdSave.Default = False
  401. End Sub
  402. Private Sub txtXML_LostFocus(Index As Integer)
  403. cmdSave.Default = True
  404. End Sub
  405. Private Sub txtFiles_GotFocus()
  406. cmdSave.Default = False
  407. End Sub
  408. Private Sub txtFiles_LostFocus()
  409. cmdSave.Default = True
  410. End Sub
  411. Private Sub p_ChangeSKU()
  412. Dim enumNewSKU As SKU_E
  413. Dim Response As VbMsgBoxResult
  414. Dim intIndex As Long
  415. enumNewSKU = cboSKU.ItemData(cboSKU.ListIndex)
  416. If (enumNewSKU = p_enumCurrentSKU) Then
  417. Exit Sub
  418. End If
  419. If (p_blnDirty And (p_enumCurrentSKU <> 0)) Then
  420. Response = MsgBox("You have unsaved changes. " & _
  421. "Are you sure that you want to discard them?", vbOKCancel + vbExclamation)
  422. If (Response <> vbOK) Then
  423. For intIndex = 0 To cboSKU.ListCount - 1
  424. If (cboSKU.ItemData(intIndex) = p_enumCurrentSKU) Then
  425. cboSKU.ListIndex = intIndex
  426. Exit Sub
  427. End If
  428. Next
  429. End If
  430. End If
  431. p_enumCurrentSKU = enumNewSKU
  432. p_blnUpdating = True
  433. txtValue(VI_DISPLAY_NAME_E) = p_clsParameters.DisplayName(p_enumCurrentSKU)
  434. txtValue(VI_PRODUCT_ID_E) = p_clsParameters.ProductId(p_enumCurrentSKU)
  435. txtValue(VI_PRODUCT_VERSION_E) = p_clsParameters.ProductVersion(p_enumCurrentSKU)
  436. txtValue(VI_VENDOR_STRING_E) = p_clsParameters.Value(VENDOR_STRING_C) & ""
  437. txtValue(VI_BL_DIRECTORY_E) = p_clsParameters.Value( _
  438. BROKEN_LINK_WORKING_DIR_C & Hex(p_enumCurrentSKU)) & ""
  439. txtXML(XI_PKG_DESC_E) = p_clsParameters.DomFragmentPackageDesc(p_enumCurrentSKU)
  440. txtXML(XI_HHT_E) = p_clsParameters.DomFragmentHHT(p_enumCurrentSKU)
  441. txtFiles = p_clsParameters.FilesToInclude(p_enumCurrentSKU)
  442. p_blnUpdating = False
  443. fraSKU.Caption = cboSKU.List(cboSKU.ListIndex) & " Values"
  444. p_blnDirty = False
  445. End Sub
  446. Private Sub p_Save()
  447. p_clsParameters.DisplayName(p_enumCurrentSKU) = txtValue(VI_DISPLAY_NAME_E)
  448. p_clsParameters.ProductId(p_enumCurrentSKU) = txtValue(VI_PRODUCT_ID_E)
  449. p_clsParameters.ProductVersion(p_enumCurrentSKU) = txtValue(VI_PRODUCT_VERSION_E)
  450. p_clsParameters.Value(VENDOR_STRING_C) = txtValue(VI_VENDOR_STRING_E)
  451. p_clsParameters.Value(BROKEN_LINK_WORKING_DIR_C & Hex(p_enumCurrentSKU)) = _
  452. txtValue(VI_BL_DIRECTORY_E)
  453. p_clsParameters.DomFragmentPackageDesc(p_enumCurrentSKU) = txtXML(XI_PKG_DESC_E)
  454. p_clsParameters.DomFragmentHHT(p_enumCurrentSKU) = txtXML(XI_HHT_E)
  455. p_clsParameters.FilesToInclude(p_enumCurrentSKU) = txtFiles
  456. End Sub
  457. Private Sub p_SetSizingInfo()
  458. Static blnInfoSet As Boolean
  459. Dim intIndex As Long
  460. ' If (blnInfoSet) Then
  461. ' Exit Sub
  462. ' End If
  463. p_clsSizer.AddControl cboSKU
  464. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  465. p_clsSizer.AddControl fraSKU
  466. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  467. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = Me
  468. For intIndex = VI_DISPLAY_NAME_E To VI_BL_DIRECTORY_E
  469. p_clsSizer.AddControl txtValue(intIndex)
  470. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = fraSKU
  471. Next
  472. p_clsSizer.AddControl txtValue(VI_VENDOR_STRING_E)
  473. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = fraSKU
  474. p_clsSizer.ReferenceDimension(DIM_TOP_E) = DIM_BOTTOM_E
  475. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  476. p_clsSizer.AddControl lbl(VI_VENDOR_STRING_E)
  477. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = txtValue(VI_VENDOR_STRING_E)
  478. p_clsSizer.AddControl SSTab
  479. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = Me
  480. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  481. For intIndex = XI_PKG_DESC_E To XI_HHT_E
  482. p_clsSizer.AddControl txtXML(intIndex)
  483. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = SSTab
  484. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = SSTab
  485. p_clsSizer.AddControl WebBrowser(intIndex)
  486. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = SSTab
  487. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = SSTab
  488. Next
  489. p_clsSizer.AddControl txtFiles
  490. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = SSTab
  491. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = SSTab
  492. p_clsSizer.AddControl cmdSave
  493. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = Me
  494. p_clsSizer.ReferenceDimension(DIM_TOP_E) = DIM_HEIGHT_E
  495. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = Me
  496. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_WIDTH_E
  497. p_clsSizer.AddControl cmdClose
  498. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = cmdSave
  499. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = cmdSave
  500. ' blnInfoSet = True
  501. End Sub