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

Вниз

Как закрыть другое приложение?   Найти похожие ветки 

 
sammy   (2002-03-19 08:25) [0]

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


 
MBo   (2002-03-19 08:38) [1]

TerminateProcess


 
Song   (2002-03-19 09:18) [2]

SendMessage(FindWindow(),WM_CLOSE,0);


 
SPeter   (2002-03-20 17:48) [3]

SendMessage(FindWindow("класс окна","заголовок окна"), WM_Close,0,0);


 
Sasha9   (2002-03-20 18:17) [4]

кроме WM_CLOSE есть ещё WM_DESTROY и
SendMessage(FindWindow("класс окна","заголовок окна"), WM_SYSCOMMAND,SC_CLOSE,0);


 
copyr25   (2002-03-20 18:41) [5]

var h: THandle;
...
CloseHandle(h);
...
PS:
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.



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

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

Наверх




Память: 0.48 MB
Время: 0.016 c
1-73297
Neon_space
2002-05-11 17:12
2002.05.23
Конвертирование проектов Delphi в проекты C++ Builder


1-73260
Kopachev
2002-05-10 08:27
2002.05.23
Маленький вопрос про Canvas


4-73445
Keymaster
2002-03-21 23:35
2002.05.23
Журнал программ


3-73016
rem_
2002-04-25 10:54
2002.05.23
LookUp


1-73290
lak_b
2002-05-11 14:12
2002.05.23
как сделать форму невидимой(hide) при загрузке