HOLA!!!
Para mi sos un re
LAMMER pero estamos para ayudar...
Toma lee bien todo antes de preguntar, Google no muerde.
Esta todo funcional solamente pones el nombre del proceso, el codigo que queres que ejecute cuando esta cargado o descargado y listo.
Aclaro lo puse dentro de un boton por las dudas para que se te haga mas facil.
'Constantes
'-----------------------------------
Const TH32CS_SNAPHEAPLIST = &H1
Const TH32CS_SNAPPROCESS = &H2
Const TH32CS_SNAPTHREAD = &H4
Const TH32CS_SNAPMODULE = &H8
Const TH32CS_SNAPALL = (TH32CS_SNAPHEAPLIST Or TH32CS_SNAPPROCESS Or _
TH32CS_SNAPTHREAD Or TH32CS_SNAPMODULE)
Const TH32CS_INHERIT = &H80000000
Const MAX_PATH As Integer = 260
'Estructura para los procesos
'-----------------------------------
Private Type PROCESSENTRY32
dwSize As Long
cntUsage As Long
th32ProcessID As Long
th32DefaultHeapID As Long
th32ModuleID As Long
cntThreads As Long
th32ParentProcessID As Long
pcPriClassBase As Long
dwFlags As Long ' Flags
szExeFile As String * MAX_PATH ' nombre del ejecutable
End Type
'Funciones Api para listar los procesos
'--------------------------------------------------------
Private Declare Function CreateToolhelp32Snapshot Lib "Kernel32" ( _
ByVal lFlags As Long, _
ByVal lProcessID As Long) As Long
Private Declare Function Process32First Lib "Kernel32" ( _
ByVal hSnapShot As Long, _
uProcess As PROCESSENTRY32) As Long
Private Declare Function Process32Next Lib "Kernel32" ( _
ByVal hSnapShot As Long, _
uProcess As PROCESSENTRY32) As Long
Private Declare Sub CloseHandle Lib "Kernel32" (ByVal hPass As Long)
' ESTO ES EL PROCEDIMIENTO DE UN BOTON (POR SI SABES LO QUE ES UN BOTON) LAMMER
Private Sub Command1_Click()
Dim PROCESO As String
Dim hSnapShot As Long, uProcess As PROCESSENTRY32
hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0&)
uProcess.dwSize = Len(uProcess)
R = Process32First(hSnapShot, uProcess)
'Recorre los procesos
PROCESO = "EXPLORER.EXE" '<-----ACA EL NOMBRE DEL PROCESO
Do While R
R = Process32Next(hSnapShot, uProcess)
If Mid(UCase(uProcess.szExeFile), 1, Len(PROCESO)) = UCase(PROCESO) Then
'ESTA ABIERTO ------------------------------^
Else ' ^
'ESTA CERRADO ------------------------------^
End If
Loop
Set elemento = Nothing
Call CloseHandle(hSnapShot)
End Sub
' LLL AAA MMMM MMMM MMMM MMMM EEEEEE RRRRR
' LLL AA AA MM MM MM MM MM MM MM MM EE RR RR
' LLL AA AA MM MMM MM MM MMM MM EEEE RRRRR
' LLL AAAAAAA MM M MM MM M MM EE RR RR
' LLLLLLL AA AA MM MM MM MM EEEEEE RR RR
P.D: Perdon por el tono, pero lo siento asi por lo de "ImperiumAO.exe".
GRACIAS POR LEER!!!