Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
ng
Salut,
Qu'appelles-tu le nom ? Le titre ? Le chemin ?
Pour le titre :
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function GetForegroundWindow Lib "user32" () As Long
Public Function EstActive(strTitre As String) As Boolean '//si t'as le classname, c'est plus sûr EstActive = (FindWindow(vbNullString, strTitre) = GetForegroundWindow) End Function
Exemple :
MsgBox EstActive("Calculatrice") '//Renvoie True si la fenêtre est active
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/ http://apisvb.europe.webmatrixhosting.net/
Malaussene a écrit :
Bonjour à tous
Est-il possible et si oui comment de savoir si une application dont j'ai le nom est active?
Merci
Salut,
Qu'appelles-tu le nom ? Le titre ? Le chemin ?
Pour le titre :
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetForegroundWindow Lib "user32" () As Long
Public Function EstActive(strTitre As String) As Boolean
'//si t'as le classname, c'est plus sûr
EstActive = (FindWindow(vbNullString, strTitre) = GetForegroundWindow)
End Function
Exemple :
MsgBox EstActive("Calculatrice") '//Renvoie True si la fenêtre est active
--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/
Malaussene <noreturn@thanks.com> a écrit :
Bonjour à tous
Est-il possible et si oui comment de savoir si une application
dont j'ai le nom est active?
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function GetForegroundWindow Lib "user32" () As Long
Public Function EstActive(strTitre As String) As Boolean '//si t'as le classname, c'est plus sûr EstActive = (FindWindow(vbNullString, strTitre) = GetForegroundWindow) End Function
Exemple :
MsgBox EstActive("Calculatrice") '//Renvoie True si la fenêtre est active
-- Nicolas G. FAQ VB : http://faq.vb.free.fr API Guide : http://www.allapi.net Google Groups : http://groups.google.fr/ MZ-Tools : http://www.mztools.com/ http://apisvb.europe.webmatrixhosting.net/
Malaussene a écrit :
Bonjour à tous
Est-il possible et si oui comment de savoir si une application dont j'ai le nom est active?