OVH Cloud OVH Cloud

Arreter SHELL

1 réponse
Avatar
big
Bonjour
la fonction suivante est sur la page (cette article :How=20
to kill an app gently par Karl E. Peterson)
http://msdn.microsoft.com/library/en-
us/dnvsm01/html/dt0109.asp=20
Function PostCloseMessage(ByVal hwnd As _
Long, ByVal lParam As Long) As Long
Static PID As Long
' Check if hWnd belongs to PID: lParam
Call GetWindowThreadProcessId(hwnd, PID)
If PID =3D lParam Then
' Belongs to target process, try close
' message if this doesn't have an owner. VB
' apps that display a msgbox from
' QueryUnload will lock a 9x box up hard,
' if we don't do this test!
If GetWindowLong(hwnd, GWL_HWNDPARENT) _
=3D 0 Then
Call PostMessage(hwnd, WM_CLOSE, _
0&, ByVal 0&)
End If
End If
' Return true to continue enumeration.
PostCloseMessage =3D True
End Function
comment je peux trouver le param=E8tre IParam pour le=20
fournir =E0 cette fonction afin de l'utiliser ?
Merci d'avance

1 réponse

Avatar
François Picalausa
Bonjour/soir,

il est indiqué dans cet article:

Dim ThreadID As Long
Dim ProcessID As Long
ThreadID = GetWindowProcessId(hWnd, ProcessID)

C'est le process ID qui est passé à cette fonction au
travers de la procédure d'énumération de fenêtres.

Le listing 3 montre l'appel à la procédure d'énumération
des fenêtres.

--
François Picalausa

-----Message d'origine-----
Bonjour
la fonction suivante est sur la page (cette article :How
to kill an app gently par Karl E. Peterson)
http://msdn.microsoft.com/library/en-
us/dnvsm01/html/dt0109.asp
Function PostCloseMessage(ByVal hwnd As _
Long, ByVal lParam As Long) As Long
Static PID As Long
' Check if hWnd belongs to PID: lParam
Call GetWindowThreadProcessId(hwnd, PID)
If PID = lParam Then
' Belongs to target process, try close
' message if this doesn't have an owner. VB
' apps that display a msgbox from
' QueryUnload will lock a 9x box up hard,
' if we don't do this test!
If GetWindowLong(hwnd, GWL_HWNDPARENT) _
= 0 Then
Call PostMessage(hwnd, WM_CLOSE, _
0&, ByVal 0&)
End If
End If
' Return true to continue enumeration.
PostCloseMessage = True
End Function
comment je peux trouver le paramètre IParam pour le
fournir à cette fonction afin de l'utiliser ?
Merci d'avance
.