Bonjour,
je souhaiterais controler si une application est bien ouverte (active dans la barre des taches).
je ne souhaites pas controler si le programme (exe) est lancé mais la fenetre en question.
J'ai écris cela, mais apparement c'est pas ca
On Error Resume Next
set shell = WScript.CreateObject("WScript.Shell")
shell.AppActivate "Calculatrice"
If Err.Number <> 0 Then
msgbox " L'application Calculatrice n'est pas active ! "
Else
Msgbox "L'application Calculatrice est active"
End If
il n'y aura pas d'erreur, il faut vérifier le retour de SHELL
sous forme de fonction (en VBS) çà donne :
function ApplicationIsRunning(AppName)
dim shell
set shell = WScript.CreateObject("WScript.Shell")
ApplicationIsRunning = shell.AppActivate(AppName)
set shell = Nothing
end function
If ApplicationIsRunning("Calculatrice") Then
msgbox "L'application 'Calculatrice' est active"
Else
Msgbox "L'application 'Calculatrice' n'est pas active !"
End If
++
PCPT [AFCK]
<hr size="2" width="100%" />Prenez un instant pour répondre à [infomsg_SONDAGE-POP3-POUR-CS_769706.aspx ce sondage] svp