Il est possible de lister les processus actifs sur une machine en utilisant les fonctions de l'API Windows Mais il existe une astuce beaucoup plus simple à l'aide d'un petit script WMI, utilisant la classe Win32_process (testé sur Windows 2000, XP) vb
Private Sub Command1_Click() Dim svc As Object Dim sQuery As String Dim oproc On Error GoTo Command1_Click_Error
Set svc = GetObject("winmgmts:rootcimv2") sQuery = "select * from win32_process" For Each oproc In svc.execquery(sQuery) Debug.Print oproc.Name & " = " & oproc.ExecutablePath Next Set svc = Nothing Exit Sub
Command1_Click_Error: MsgBox "Error " & Err.Number & " (" & Err.Description & ")" Err.Clear End Sub
------------------------------------------------
"Lister les processus visual basic" dans google.
A+
ROLLOT Pascal Jean vient de nous annoncer :
Bonjour,
Je voudrais faire un prg qui serait lancé en tâche de fond et qui vérifierait
si une application tourne.
exemple : si outlook.exe est actif.
Il est possible de lister les processus actifs sur une machine en
utilisant les fonctions de l'API Windows
Mais il existe une astuce beaucoup plus simple à l'aide d'un petit
script WMI, utilisant la classe Win32_process (testé sur Windows 2000,
XP) vb
Private Sub Command1_Click()
Dim svc As Object
Dim sQuery As String
Dim oproc
On Error GoTo Command1_Click_Error
Set svc = GetObject("winmgmts:rootcimv2")
sQuery = "select * from win32_process"
For Each oproc In svc.execquery(sQuery)
Debug.Print oproc.Name & " = " & oproc.ExecutablePath
Next
Set svc = Nothing
Exit Sub
Command1_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ")"
Err.Clear
End Sub
Il est possible de lister les processus actifs sur une machine en utilisant les fonctions de l'API Windows Mais il existe une astuce beaucoup plus simple à l'aide d'un petit script WMI, utilisant la classe Win32_process (testé sur Windows 2000, XP) vb
Private Sub Command1_Click() Dim svc As Object Dim sQuery As String Dim oproc On Error GoTo Command1_Click_Error
Set svc = GetObject("winmgmts:rootcimv2") sQuery = "select * from win32_process" For Each oproc In svc.execquery(sQuery) Debug.Print oproc.Name & " = " & oproc.ExecutablePath Next Set svc = Nothing Exit Sub
Command1_Click_Error: MsgBox "Error " & Err.Number & " (" & Err.Description & ")" Err.Clear End Sub
------------------------------------------------
"Lister les processus visual basic" dans google.
A+
Patrick Philippot
Bonjour,
ROLLOT Pascal Jean wrote:
Je voudrais faire un prg qui serait lancé en tâche de fond et qui vérifierait si une application tourne. exemple : si outlook.exe est actif.
http://support.microsoft.com/kb/467805/fr
Bonne lecture.
-- Patrick Philippot - Microsoft MVP MainSoft Consulting Services www.mainsoft.fr
Bonjour,
ROLLOT Pascal Jean wrote:
Je voudrais faire un prg qui serait lancé en tâche de fond et qui
vérifierait si une application tourne.
exemple : si outlook.exe est actif.
http://support.microsoft.com/kb/467805/fr
Bonne lecture.
--
Patrick Philippot - Microsoft MVP
MainSoft Consulting Services
www.mainsoft.fr