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.

140 lines
3.6 KiB

  1. VERSION 5.00
  2. Begin VB.Form CopyKeyForm
  3. BorderStyle = 3 'Fixed Dialog
  4. Caption = "Copy a Key"
  5. ClientHeight = 1845
  6. ClientLeft = 45
  7. ClientTop = 330
  8. ClientWidth = 4335
  9. Icon = "CopyKey.frx":0000
  10. LinkTopic = "Form1"
  11. MaxButton = 0 'False
  12. MinButton = 0 'False
  13. ScaleHeight = 1845
  14. ScaleWidth = 4335
  15. ShowInTaskbar = 0 'False
  16. StartUpPosition = 3 'Windows Default
  17. Begin VB.TextBox SourceText
  18. Height = 285
  19. Left = 1200
  20. TabIndex = 7
  21. Top = 120
  22. Width = 3015
  23. End
  24. Begin VB.CommandButton OkButton
  25. Cancel = -1 'True
  26. Caption = "OK"
  27. Default = -1 'True
  28. Height = 345
  29. Left = 1560
  30. TabIndex = 6
  31. Top = 1440
  32. Width = 1260
  33. End
  34. Begin VB.CommandButton CancelButton
  35. Caption = "Cancel"
  36. Height = 345
  37. Left = 3000
  38. TabIndex = 5
  39. Top = 1440
  40. Width = 1260
  41. End
  42. Begin VB.CheckBox OverwriteCheck
  43. Caption = "Overwrite"
  44. Height = 195
  45. Left = 2040
  46. TabIndex = 3
  47. Top = 1080
  48. Value = 1 'Checked
  49. Width = 1215
  50. End
  51. Begin VB.OptionButton MoveOption
  52. Caption = "Move"
  53. Height = 195
  54. Left = 1080
  55. TabIndex = 2
  56. Top = 1080
  57. Width = 855
  58. End
  59. Begin VB.OptionButton CopyOption
  60. Caption = "Copy"
  61. Height = 195
  62. Left = 120
  63. TabIndex = 1
  64. Top = 1080
  65. Value = -1 'True
  66. Width = 855
  67. End
  68. Begin VB.TextBox DestText
  69. Height = 285
  70. Left = 1200
  71. TabIndex = 0
  72. Top = 600
  73. Width = 3015
  74. End
  75. Begin VB.Label Label2
  76. Caption = "Source:"
  77. Height = 255
  78. Left = 120
  79. TabIndex = 8
  80. Top = 120
  81. Width = 975
  82. End
  83. Begin VB.Label Label1
  84. Caption = "Destination:"
  85. Height = 255
  86. Left = 120
  87. TabIndex = 4
  88. Top = 600
  89. Width = 975
  90. End
  91. End
  92. Attribute VB_Name = "CopyKeyForm"
  93. Attribute VB_GlobalNameSpace = False
  94. Attribute VB_Creatable = False
  95. Attribute VB_PredeclaredId = True
  96. Attribute VB_Exposed = False
  97. Option Explicit
  98. DefInt A-Z
  99. 'Form Parameters
  100. Public SourceKey As String 'In
  101. Public Moved As Boolean 'Out
  102. Public Sub Init()
  103. SourceText.Text = SourceKey
  104. SourceText.Enabled = False
  105. DestText.Text = SourceKey
  106. DestText.Enabled = True
  107. End Sub
  108. Private Sub OkButton_Click()
  109. On Error GoTo LError
  110. Dim Overwrite As Boolean
  111. If OverwriteCheck.Value = vbChecked Then
  112. Overwrite = True
  113. Else
  114. Overwrite = False
  115. End If
  116. If CopyOption.Value = True Then
  117. MainForm.MetaUtilObj.CopyKey SourceKey, DestText.Text, Overwrite
  118. Moved = False
  119. ElseIf MoveOption.Value = True Then
  120. MainForm.MetaUtilObj.MoveKey SourceKey, DestText.Text, Overwrite
  121. Moved = True
  122. End If
  123. Me.Hide
  124. Exit Sub
  125. LError:
  126. MsgBox "Failure to copy key: " & Err.Description, vbExclamation + vbOKOnly, "Copy a Key"
  127. End Sub
  128. Private Sub CancelButton_Click()
  129. Me.Hide
  130. End Sub