vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
Blitzschnelles Erstellen von grafischen Diagrammen!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2026
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

Visual-Basic Einsteiger
Shell Anwendung 
Autor: Bichler
Datum: 23.10.07 19:12

Hallo

Ich habe ein großes Problem.
Ich möchte über eine Shell Funktion ein Backupprogramm starten.
Erst wenn das Backupprogramm beendet ist, möchte ich ein anderes Fenster einblenden. Mein Problem ist, dass das zweite Fenster sofort nach dem start
des Programms eingeblendet wird.
Kann mir jemand einen Tip geben?
Mein Programm sieht Folgendermaßen aus.


Option Explicit

Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type

Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessID As Long
dwThreadID As Long
End Type

Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal _
hHandle As Long, ByVal dwMilliseconds As Long) As Long

Private Declare Function CreateProcessA Lib "kernel32" (ByVal _
lpApplicationName As Long, ByVal lpCommandLine As String, ByVal _
lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _
ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _
ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, _
lpStartupInfo As STARTUPINFO, lpProcessInformation As _
PROCESS_INFORMATION) As Long

Private Const INFINITE = -1&

Private Const NORMAL_PRIORITY_CLASS = &H20&

Private Declare Function CloseHandle Lib "kernel32" (ByVal _
hObject As Long) As Long



Public Sub ExecCmd(cmdline$)
Dim proc As PROCESS_INFORMATION
Dim start As STARTUPINFO
Dim ReturnValue As Integer

' Initialize the STARTUPINFO structure:
start.cb = Len(start)

' Start the shelled application:
ReturnValue = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, _
NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)

' Wait for the shelled application to finish:
Do
ReturnValue = WaitForSingleObject(proc.hProcess, 0)
DoEvents
Loop Until ReturnValue <> 258

ReturnValue = CloseHandle(proc.hProcess)
End Sub

Private Sub CommandButton1_Click()

Dim Ergebnis
Dim newHour As Variant
Dim newMinute As Variant
Dim newSecond As Variant
Dim waitTime As Variant

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 3
waitTime = TimeSerial(newHour, newMinute, newSecond)
Ergebnis = Shell("C:\Programme\TrayBackup\traybackup.exe")
Application.Wait waitTime
SendKeys "^f"
AppActivate Ergebnis
UserForm2.Show

End Sub



Private Sub CommandButton10_Click()

Application.Quit

End Sub



Vielen Dank
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
Shell Anwendung1.429Bichler23.10.07 19:12
Re: Shell Anwendung1.067Cool Tour23.10.07 19:23
Re: Shell Anwendung1.033Bichler23.10.07 19:40
Re: Shell Anwendung1.039Cool Tour23.10.07 19:51
Kurz und schmerzlos:1.036Cool Tour23.10.07 20:01
Re: Shell Anwendung1.020Bichler23.10.07 20:09
Re: Shell Anwendung1.081Cool Tour23.10.07 20:18
Re: Shell Anwendung1.048Bichler23.10.07 20:29
Re: Shell Anwendung1.060ModeratorDieter23.10.07 19:24

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2026 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel