VERSION 5.00 Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx" Begin VB.Form FrmInitProTool Caption = "Pruef2000 initProTool" ClientHeight = 1635 ClientLeft = 60 ClientTop = 345 ClientWidth = 4155 LinkTopic = "Form2" ScaleHeight = 1635 ScaleWidth = 4155 StartUpPosition = 3 'Windows-Standard Begin VB.CommandButton cmdNeustart Caption = "ProTool neu starten" Height = 435 Left = 960 TabIndex = 3 Top = 1020 Width = 1845 End Begin VB.Timer Timer1 Left = 360 Top = 990 End Begin VB.CommandButton cmdCancel Caption = "Abbrechen" Height = 435 Left = 3030 TabIndex = 2 Top = 1020 Width = 975 End Begin MSComctlLib.ProgressBar ProgressBar1 Height = 345 Left = 150 TabIndex = 1 Top = 540 Width = 3825 _ExtentX = 6747 _ExtentY = 609 _Version = 393216 Appearance = 1 End Begin VB.Label Label1 Caption = "Verbinden mit ProTool..." BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 435 Left = 0 TabIndex = 0 Top = 0 Width = 4125 End End Attribute VB_Name = "FrmInitProTool" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Public mhProTool As Long Public mblnFertig As Boolean Private Sub cmdCancel_Click() Unload Me mblnFertig = True End Sub Private Sub cmdNeustart_Click() StartProTool End Sub Private Sub Form_Load() mblnFertig = False ProgressBar1.Max = 10 Me.Visible = True If initProTool() = True Then mblnFertig = True Unload Me Exit Sub End If ' Holt String zum Starten der ProTool Anwendung aus der ini Datei sProtoolStart = g_App.Settings.getProToolString If sProtoolStart <> "" Then Call StartProTool StartTimer Else mblnFertig = True Unload Me Exit Sub End If waitForEnde End Sub Private Function StartProTool() As Boolean Dim sProtoolStart As String Dim hProTool As Long ' Holt String zum Starten der ProTool Anwendung aus der ini Datei sProtoolStart = g_App.Settings.getProToolString mhProTool = Shell(sProtoolStart, vbNormalFocus) End Function Sub StartTimer() Timer1.Enabled = True Timer1.Interval = 1000 End Sub Private Sub Form_Unload(Cancel As Integer) mblnFertig = True End Sub Private Sub Timer1_Timer() Me.SetFocus If ProgressBar1.Value < ProgressBar1.Max Then ProgressBar1.Value = ProgressBar1.Value + 1 Else ProgressBar1.Value = ProgressBar1.Min End If If initProTool() = True Or mblnFertig = True Then Timer1.Enabled = False mblnFertig = True Unload Me End If End Sub Public Function initProTool() As Boolean On Error GoTo Errorhandler Dim sProtoolStart As String Set m_ProToolAppObj = GetObject(, "PTPRORUN.Document") initProTool = True 'hProTool = g_App.Settings.getProToolAppTitle mblnFertig = True AppActivate hProTool, False Exit Function Errorhandler: initProTool = False End Function Public Sub waitForEnde() Do While Not mblnFertig Sleep 500, True Loop End Sub