Alfa » 19.03.2004 (Пт) 15:58
Declare Function GetWindowThreadProcessId Lib "user32" Alias "GetWindowThreadProcessId" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Declare Function OpenProcess Lib "Kernel32.dll" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long
Declare Function TerminateProcess Lib "kernel32" Alias "TerminateProcess" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Long) As Long
Const PROCESS_ALL_ACCESS = &H1F0FFF
Sub KillByhWnd(ByVal hWnd as Long)
dim h1 as long, h2 as long
GetWindowThreadProcessId hWnd, h1
h2 = openprocess(PROCESS_ALL_ACCESS, false, h1)
TerminateProcess(h2)
CloseHandle(h2)
End Sub
(Поиск)