Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.46 MB
Время: 0.012 c
1-73191
BM
2002-05-14 14:33
2002.05.23
Запись из потока в динамический массив


1-73123
Arhangel
2002-05-08 13:38
2002.05.23
Как перевести короткий путь к файлу в длинный?


3-73076
sambusak
2002-04-25 06:01
2002.05.23
DBE Administrator


1-73219
shane54
2002-05-14 17:38
2002.05.23
Как проверить, есть ли среди 10 чисел повторяющиеся?


3-73087
Pavlinchik
2002-04-26 21:00
2002.05.23
ПОМОГИТЕ!!! ПРОПАДАЮ!!!




   Наверх