Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Controlar EXE

9 views
Skip to first unread message

tou

unread,
Oct 4, 2001, 1:13:54 PM10/4/01
to
Hola,

Necesito hacer un programa que lance notepad.exe, y que cuando el usuario
cierre el notepad.exe mi programa efectue una operaciones...

Gracias


Eric Garza

unread,
Oct 4, 2001, 1:36:11 PM10/4/01
to
Tou,

Consulta el siguiente artículo:

HOWTO: 32-Bit App Can Determine When a Shelled Process Ends
http://support.microsoft.com/support/kb/articles/Q129/7/96.ASP

--
Regards,
Eric Garza, MVP
Project manager
AMI GE


"tou" <t...@tou.tou> wrote in message news:9pi506$pjg$1...@diana.bcn.ttd.net...

Abraham Uribe Morales

unread,
Oct 17, 2001, 12:17:52 PM10/17/01
to
Hola !

Ahí te va

'Lanza el notepad con
ExecCmdNoFocus notepad.exe

' el la sección de la declaraciones
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
Const STILL_ACTIVE = &H103
Const PROCESS_QUERY_INFORMATION = &H400


' La función que executa y espera
Public Sub ExecCmdNoFocus(ByVal CmdLine As String)
'Función : Ejecutar y esperar a que un proceso termine
Dim hProcess As Long
Dim Retval As Long
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, _
'la ventana se mostrará minimizada sin foco (modificable)
Shell(CmdLine, vbMinimizedNoFocus))
Do
GetExitCodeProcess hProcess, Retval
DoEvents
Sleep 100
'Loop while the process is active
Loop While Retval = STILL_ACTIVE
End Sub


Saludos

tou <t...@tou.tou> escribió en el mensaje de noticias
9pi506$pjg$1...@diana.bcn.ttd.net...

0 new messages