VERSION 5.00 Begin VB.Form EnterPasswordForm BorderStyle = 3 'Fixed Dialog Caption = "P4OFC - Enter Password" ClientHeight = 1875 ClientLeft = 45 ClientTop = 330 ClientWidth = 3975 ControlBox = 0 'False LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 1875 ScaleWidth = 3975 ShowInTaskbar = 0 'False StartUpPosition = 1 'CenterOwner Begin VB.TextBox txtPassword Height = 375 IMEMode = 3 'DISABLE Left = 1080 PasswordChar = "*" TabIndex = 1 Top = 720 Width = 2655 End Begin VB.CommandButton cmdCancel Cancel = -1 'True Caption = "Cancel" Height = 375 Left = 2280 TabIndex = 3 Top = 1320 Width = 1215 End Begin VB.CommandButton cmdOK Caption = "OK" Default = -1 'True Height = 375 Left = 840 TabIndex = 2 Top = 1320 Width = 1215 End Begin VB.Label lblUser Caption = "Password for user" Height = 375 Left = 120 TabIndex = 4 Top = 120 Width = 3615 End Begin VB.Label Label1 Caption = "&Password:" Height = 255 Left = 120 TabIndex = 0 Top = 720 Width = 855 End End Attribute VB_Name = "EnterPasswordForm" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private m_Action As VbMsgBoxResult Private m_p4 As P4COM.p4 Private Sub DoClick(Action As VbMsgBoxResult) Me.Hide m_Action = Action End Sub Private Sub cmdCancel_Click() Dim t As Tracker: Set t = GStackTrace.Enter(TypeName(Me), "cmdCancel_Click") On Error GoTo Error_Block DoClick vbCancel Exit Sub Error_Block: 't.Report End Sub Private Sub cmdOK_Click() Dim t As Tracker: Set t = GStackTrace.Enter(TypeName(Me), "cmdOK_Click") On Error GoTo Error_Block m_p4.Input = txtPassword.Text If CommandSuccessful("login", m_p4, " logged in.") Then DoClick vbOK Else MsgBox "Invalid password. Please try again.", vbExclamation + vbOKOnly txtPassword.Text = "" txtPassword.SetFocus End If Exit Sub Error_Block: t.Report End Sub Public Function Answer(p4 As P4COM.p4) As VbMsgBoxResult Answer = vbCancel m_Action = vbCancel Set m_p4 = p4 lblUser.Caption = "Password for user " & p4.User Screen.MousePointer = vbDefault ShowForm Me, True Answer = m_Action Unload Me End Function