000
12.04.2002, 11:36
DD
|
Hallo zusammen! Wie kann ich in VB in mein Prog ne Datei includen z.B. für so ne Art Setup Programm??
Wie kann man aus einem Programm aus eine andere Öffnen also Ausführen lassen??
THX schonmal!
DD
--
DD
|
|
Profil || Suche
|
001
12.04.2002, 11:44
Pa
|
schau mal bei www.vbwelt.de im forum .. da war glaub schonmal sowas ähnliches! greez Pa
--
_______________ cooldata.org - real bugware
|
|
Profil || Suche
|
002
12.04.2002, 12:17
DD
|
THX!!!! Trotzdem freu ich mich über mehr antworten!
--
DD
|
|
Profil || Suche
|
003
12.04.2002, 15:28
Ferdi
|
andere Programme Ausführen geht mit
Shell ( <pfadunddateiname> , <startmodi> )
und ist direkt in vb includiert
wers anspruchsvoller haben will kann auch die eigentliche API Funktion nehmen (Shell ist nur ne vereinfachung)
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Const SW_NORMAL = 1 Public Const SW_ERASE = &H4 Public Const SW_HIDE = 0 Public Const SW_INVALIDATE = &H2 Public Const SW_MAXIMIZE = 3 Public Const SW_MINIMIZE = 6 Public Const SW_OTHERUNZOOM = 4 Public Const SW_OTHERZOOM = 2 Public Const SW_PARENTCLOSING = 1 Public Const SW_PARENTOPENING = 3 Public Const SW_RESTORE = 9 Public Const SW_SCROLLCHILDREN = &H1 Public Const SW_SHOW = 5 Public Const SW_SHOWDEFAULT = 10 Public Const SW_SHOWMAXIMIZED = 3 Public Const SW_SHOWMINIMIZED = 2
ShellExecute hwnd, "<blubb>", "<Laufwerk>:\<Pfad>\<Datei>.<ext>", ByVal 0&, 0&, SW_NORMAL
'<blubb> kann z.B. "open" fürs öffnen sein 'oder auch z.B. "explore" um den Explorer zu öffnen mit dem angegebenen Pfad)
für die dies noch umständlicher haben wollen:
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Const PROCESS_QUERY_INFORMATION = &H400 Const STATUS_PENDING = &H103&
Public Sub RunShell(cmdline$) Dim hProcess As Long Dim ProcessId As Long Dim exitCode As Long Dim r As Long
ProcessId& = Shell(cmdline$, 1) hProcess& = OpenProcess(PROCESS_QUERY_INFORMATION, False, ProcessId&) Do Call GetExitCodeProcess(hProcess&, exitCode&) DoEvents Loop While exitCode& = STATUS_PENDING If exitCode& <> 0 Then MsgBox "Error Registering: " & cmdline$, vbExclamation, "ERROR" End If r = CloseHandle(hProcess) End Sub
--
Dieser Beitrag wurde am 12.04.2002 um 15:30 von Ferdi bearbeitet.
|
|
Profil || Suche
|
004
13.04.2002, 10:47
DD
|
so viel wollte ich gar nicht aber danke! DD
--
DD
|
|
Profil || Suche
|