Visual Basic - duda con este codigo

Life is soft - evento anual de software empresarial
 
Vista:

duda con este codigo

Publicado por Jesus (19 intervenciones) el 25/02/2005 19:36:50
No se programar muy bien y pedi ayuda para hacer un programa que llamara a un ejecutable y cuando este terminara de correr mostrara un mensaje.....me enviaron este codigo y sin embargo no entiendo bien algunas cosas...el ejecutable q debo llamar lleva por nombre proyecto.exe y no se en parte de este codigo debo colocar el nombre..agradeceria la orientacion de alguien

Const STILL_ACTIVE = &H103
Const PROCESS_QUERY_INFORMATION = &H400

Declare Function OpenProcess Lib "Kernel32" _
(ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long

Declare Function GetExitCodeProcess Lib "Kernel32" _
(ByVal hProcess As Long, lpExitCode As Long) As Long

Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
Public Sub ExecCmdNoFocus(ByVal CmdLine As String)
Dim hProcess As Long
Dim RetVal As Long
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, Shell(CmdLine, vbHide))
Do
GetExitCodeProcess hProcess, RetVal
DoEvents
Sleep 100
Loop While RetVal = STILL_ACTIVE
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:duda con este codigo

Publicado por ChaRLinux (60 intervenciones) el 25/02/2005 19:53:32
mira te mando este codigo que nos hizo favor de mandar nuestro amigo Benjo
espero te sirva
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 Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
Const STILL_ACTIVE = &H103
Const PROCESS_QUERY_INFORMATION = &H400
Sub Shell32Bit(ByVal JobToDo As String)
Dim hProcess As Long
Dim RetVal As Long
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, Shell(JobToDo, 1))
Do
GetExitCodeProcess hProcess, RetVal
DoEvents: Sleep 100
Loop While RetVal = STILL_ACTIVE
MsgBox "se cerró la aplicación"

End Sub

Private Sub Command1_Click()
Shell32Bit "RUTA DE TU PROYECTO"
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:duda con este codigo

Publicado por Jesus (19 intervenciones) el 25/02/2005 20:38:55
muchas gracias por la ayuda, me funcionó perfecto...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar