Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.07.18;
Скачать: CL | DM;

Вниз

Убить процесс...   Найти похожие ветки 

 
KarlovAF ©   (2002-04-16 09:43) [0]

Требуется узнать какие приложения и процессы запущены под конкретным пользователем и убить их все без подтверждения на выход (например WinWord без сохранения).


 
Song ©   (2002-04-16 09:46) [1]

Поиск.


 
KarlovAF ©   (2002-04-16 09:55) [2]

???
Честно говоря, Song, я не понял твоего ответа...


 
Song ©   (2002-04-16 10:21) [3]

Ok, Вверху вот там (^) есть ссылочка, называется "Поиск". Нажимаете на неё, вводите текст "Убить процесс" и всё найдётся. Позавчера этот вопрос обсуждался.


 
KarlovAF ©   (2002-04-18 08:07) [4]

Ладно, допустим нашел (хотя сколько не искал на форуме, так и не нашел за 14 число или рядом по этому вопросу).
Но вопрос заключается еще и в том, как определить пользователя процесса?
Заранее благодарен...


 
copyr25 ©   (2002-04-19 01:33) [5]

The CloseHandle function closes an open object handle.

BOOL CloseHandle(

HANDLE hObject // handle to object to close
);


Parameters

hObject

Identifies an open object handle.



Return Values

If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The CloseHandle function closes handles to the following objects:

· Console input or output
· Event file
· File mapping
· Mutex
· Named pipe
· Process
· Semaphore
· Thread
· Token (Windows NT only)



CloseHandle invalidates the specified object handle, decrements the object"s handle count, and performs object retention checks. Once the last handle to an object is closed, the object is removed from the operating system.
This function does not close module objects.
Use CloseHandle to close handles returned by calls to the CreateFile function. Use FindClose to close handles returned by calls to the FindFirstFile function.
Closing an invalid handle raises an exception. This includes closing a handle twice, not checking the return value and closing an invalid handle, and using CloseHandle on a handle returned by FindFirstFile.


 
NickyBoy   (2002-04-29 15:00) [6]

Собрав все знания, накопившиеся у меня по этой теме предлагаю ф-цию, - у меня работает, завершает даже те процессы, которые не отвечают.

function TDM.TerminateProc(WndCaption : string) : boolean;
VAR
Wnd : hWnd;
buff: ARRAY [0..127] OF Char;

dwPID: integer;
hProc: THandle;
begin
Result := False;
Wnd := GetWindow(Application.Handle, gw_HWndFirst);
WHILE Wnd <> 0 DO
BEGIN {Не показываем:}
IF (Wnd <> Application.Handle) AND {-Собственное окно}
// IsWindowVisible(Wnd) AND {-Невидимые окна}
(GetWindow(Wnd, gw_Owner) = 0) AND{-Дочерние окна}
(GetWindowText(Wnd, buff, sizeof(buff)) <> 0){-Окна без заголовков}
THEN
BEGIN
GetWindowText(Wnd, buff, sizeof(buff));
if buff = WndCaption then
begin
GetWindowThreadProcessId(Wnd, @dwPID);
hProc := OpenProcess(PROCESS_ALL_ACCESS, TRUE, dwPID);//PROCESS_TERMINATE
TerminateProcess(hProc, 0);

Result := True;
end;
END;
Wnd := GetWindow(Wnd, gw_hWndNext);
END;
end;



Страницы: 1 вся ветка

Текущий архив: 2002.07.18;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.01 c
3-57979
Маруся
2002-06-26 15:38
2002.07.18
Тип поля в базе Interbase


7-58336
Ильясов Вадим
2002-04-27 17:11
2002.07.18
Температура процессора, системы.


7-58334
BigCat
2002-04-26 19:21
2002.07.18
печать в файл (графика)


1-58178
Shrek
2002-07-05 19:02
2002.07.18
Вот это вопрос!


7-58349
KarlovAF
2002-04-16 09:43
2002.07.18
Убить процесс...