Главная страница
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.011 c
1-58085
diww
2002-07-05 10:37
2002.07.18
Как узнать размер шрифта Windows?


1-58213
race1
2002-07-06 08:01
2002.07.18
наследование


3-58006
Борис М...
2002-06-27 14:01
2002.07.18
Удаление записи в Базе Данных


1-58140
Cherepovets
2002-07-04 16:23
2002.07.18
Помогите мне, я уже пол дня долблюсь


3-57950
Mr.Fox
2002-06-24 13:26
2002.07.18
Конвертер