Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2002.05.23;
Скачать: [xml.tar.bz2];

Вниз

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

 
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 вся ветка

Форум: "WinAPI";
Текущий архив: 2002.05.23;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.006 c
14-73406
SPeller
2002-04-13 10:13
2002.05.23
MySQL


1-73218
Builder
2002-05-13 15:18
2002.05.23
ScrollBars в DBGrid - а не убрать бы их?


3-73091
vne
2002-04-26 15:17
2002.05.23
Как получить Extended или Double простым SQL?


1-73105
BAHO
2002-05-07 00:23
2002.05.23
Расчет времени...


1-73267
Nelud
2002-05-10 22:58
2002.05.23
Господа ! Почему в консольном приложении FileExists всегда F





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский