Вниз
Скачать: 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.009 c
4-73453
watcher
2002-03-22 16:17
2002.05.23
Создание юзера


3-73055
kull
2002-04-26 20:53
2002.05.23
Грамматика IBSQL


14-73392
Draculenok
2002-04-15 09:21
2002.05.23
бесплатные звонки


6-73349
AlexeyVr
2002-03-10 22:23
2002.05.23
Чтение HTML почты


3-73010
YPS
2002-04-17 16:15
2002.05.23
Упаковка базы Ассеss 2000




   Наверх