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.

164 lines
3.5 KiB

  1. '//+----------------------------------------------------------------------------
  2. '//
  3. '// File: getdir.frm
  4. '//
  5. '// Module: pbadmin.exe
  6. '//
  7. '// Synopsis: Directory location form
  8. '//
  9. '// Copyright (c) 1997-1999 Microsoft Corporation
  10. '//
  11. '// Author: quintinb Created Header 09/02/99
  12. '//
  13. '//+----------------------------------------------------------------------------
  14. VERSION 5.00
  15. Begin VB.Form frmGetDir
  16. BorderStyle = 3 'Fixed Dialog
  17. Caption = "Select a directory"
  18. ClientHeight = 3720
  19. ClientLeft = 4920
  20. ClientTop = 1440
  21. ClientWidth = 2850
  22. Icon = "GetDir.frx":0000
  23. KeyPreview = -1 'True
  24. LinkTopic = "Form1"
  25. MaxButton = 0 'False
  26. MinButton = 0 'False
  27. PaletteMode = 1 'UseZOrder
  28. ScaleHeight = 3720
  29. ScaleWidth = 2850
  30. ShowInTaskbar = 0 'False
  31. Begin VB.CommandButton OKButton
  32. Caption = "ok"
  33. Height = 375
  34. Left = 195
  35. TabIndex = 2
  36. Top = 3225
  37. Width = 1050
  38. End
  39. Begin VB.CommandButton CancelButton
  40. Cancel = -1 'True
  41. Caption = "cancel"
  42. Height = 375
  43. Left = 1560
  44. TabIndex = 3
  45. Top = 3225
  46. Width = 1050
  47. End
  48. Begin VB.DriveListBox Drive1
  49. Height = 360
  50. HelpContextID = 11020
  51. Left = 105
  52. TabIndex = 0
  53. Top = 120
  54. WhatsThisHelpID = 11020
  55. Width = 2625
  56. End
  57. Begin VB.DirListBox Dir1
  58. Height = 2505
  59. Left = 120
  60. TabIndex = 1
  61. Top = 540
  62. WhatsThisHelpID = 11030
  63. Width = 2595
  64. End
  65. End
  66. Attribute VB_Name = "frmGetDir"
  67. Attribute VB_GlobalNameSpace = False
  68. Attribute VB_Creatable = False
  69. Attribute VB_PredeclaredId = True
  70. Attribute VB_Exposed = False
  71. Option Explicit
  72. Public SelDir As String
  73. Private Sub CancelButton_Click()
  74. SelDir = ""
  75. Me.Hide
  76. End Sub
  77. Private Sub Drive1_Change()
  78. On Error GoTo DriveErr
  79. If Left(Dir1.path, 2) = Left(Drive1.Drive, 2) Then Exit Sub
  80. Dir1.path = Drive1.Drive
  81. Dir1.Refresh
  82. On Error GoTo 0
  83. Exit Sub
  84. DriveErr:
  85. MsgBox LoadResString(6023) & Chr(13) & Drive1.Drive, vbInformation
  86. Drive1.Drive = Left(Dir1.path, 2)
  87. Exit Sub
  88. End Sub
  89. Private Sub Form_Activate()
  90. On Error GoTo ErrTrap
  91. Dir1.path = SelDir
  92. If Left(SelDir, 1) <> "\" Then
  93. Drive1.Drive = Left(SelDir, 1)
  94. Else
  95. Drive1.ListIndex = -1
  96. End If
  97. On Error GoTo 0
  98. Exit Sub
  99. ErrTrap:
  100. Exit Sub
  101. End Sub
  102. Private Sub Form_Deactivate()
  103. Unload Me
  104. End Sub
  105. Private Sub Form_Load()
  106. On Error GoTo LoadErr
  107. CenterForm Me, Screen
  108. Me.Caption = LoadResString(5205)
  109. OKButton.Caption = LoadResString(1002)
  110. CancelButton.Caption = LoadResString(1003)
  111. SetFonts Me
  112. On Error GoTo 0
  113. Exit Sub
  114. LoadErr:
  115. Exit Sub
  116. End Sub
  117. Private Sub OKButton_Click()
  118. On Error GoTo ErrTrap
  119. If Len(Dir1.path) > 110 Then
  120. MsgBox LoadResString(6059), 0
  121. Dir1.SetFocus
  122. Else
  123. SelDir = Dir1.path
  124. Me.Hide
  125. End If
  126. Exit Sub
  127. ErrTrap:
  128. Exit Sub
  129. End Sub