elyote666
Messages postés30Date d'inscriptionlundi 17 mai 2004StatutMembreDernière intervention 4 octobre 2007
-
19 mars 2005 à 00:08
elyote666
Messages postés30Date d'inscriptionlundi 17 mai 2004StatutMembreDernière intervention 4 octobre 2007
-
19 mars 2005 à 01:29
Salut à tous ! Comment faire pour que mon programme détecte quelle fenêtre à le focus
dans Windows.
Merci de vos réponses !
Gobillot
Messages postés3140Date d'inscriptionvendredi 14 mai 2004StatutMembreDernière intervention11 mars 201934 19 mars 2005 à 01:00
pour exemple pour avoir le nom de la fenêtre active:
Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal Hwnd As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal Hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Dim Hwnd As Long
Dim Lg As Long
Dim Nom As String
Hwnd = GetForegroundWindow
Lg = GetWindowTextLength(Hwnd)
Nom = Space$(Lg + 1)
GetWindowText Hwnd, Nom, Lg + 1
Nom = Left$(Nom, Lg)
MsgBox Nom
Daniel
Vous n’avez pas trouvé la réponse que vous recherchez ?