Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/03/2007, 20:44
el-quique
 
Fecha de Ingreso: marzo-2007
Mensajes: 2
Antigüedad: 18 años, 1 mes
Puntos: 0
Re: Control de procesos

Hola, el codigo me sirvio perfectamente. Pero como necesitaba que todo fuera automatico cambie el boton command1 por un timer1 y dejandolo haci:

Private Sub Timer1_Timer()
Dim ret As Boolean
Dim r As Long
Dim str As String
ret = False
Me.Text1.Text = ""
Dim hSnapShot As Long, uProcess As PROCESSENTRY32
hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0&)
uProcess.dwSize = Len(uProcess)
r = Process32First(hSnapShot, uProcess)
Me.AutoRedraw = True
Do While r
str = Left$(uProcess.szExeFile, IIf(InStr(1, uProcess.szExeFile, Chr$(0)) > 0, InStr(1, uProcess.szExeFile, Chr$(0)) - 1, 0))
Me.Text1.Text = Me.Text1.Text + vbCrLf + str
If UCase(str) = UCase(ProcessName) Then
ret = True
Exit Do
End If

Gracias por todo. Nos vemos