noussaDardouri
Messages postés16Date d'inscriptionjeudi 18 mars 2010StatutMembreDernière intervention10 janvier 2011
-
5 janv. 2011 à 16:27
cs_Exploreur
Messages postés4821Date d'inscriptionlundi 11 novembre 2002StatutMembreDernière intervention15 novembre 2016
-
7 janv. 2011 à 14:56
Salut,
je veux écrire un programme vb6 pour afficher le nom de fenêtre qui à la focus le code qui j'utilise est la suivant :
Public 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
Private Declare Function GetForegroundWindow Lib "user32" () As Long
Public Function GetActiveWindowApp() As String
Dim hWndlength As Long, hWndTitle As String, returnvalue As Long
Dim hwnd As Long
hwnd = GetForegroundWindow
hWndlength = GetWindowTextLength(hwnd)
hWndTitle = String$(hWndlength, 0)
returnvalue = GetWindowText(hwnd, hWndTitle, (hWndlength + 1))
GetActiveWindowApp = hWndTitle
End Function
Private Sub Form_Load()
MsgBox GetActiveWindowApp()
End Sub
Mais lorsqu'on le focus sur un page web n'affiche aucun resultat.
Merci de m'aider.