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

Вниз

SuspendThread   Найти похожие ветки 

 
Burmistroff   (2002-01-11 23:31) [0]

А что и вправду нельзя заморозить Thread ели он не твой и тебе не принадлежит (ты знаешь только его ID, но не Handle)? Может быть есть некий хитроумный метод?


 
VuDZ   (2002-01-16 02:34) [1]

SuspendThread
The SuspendThread function suspends the specified thread.


DWORD SuspendThread(
HANDLE hThread // handle to thread
);

Parameters
hThread
[in] Handle to the thread that is to be suspended.
Windows NT/2000 or later: The handle must have THREAD_SUSPEND_RESUME access. For more information, see Thread Security and Access Rights.

Return Values
If the function succeeds, the return value is the thread"s previous suspend count; otherwise, it is -1. To get extended error information, use the GetLastError function.

Remarks
If the function succeeds, execution of the specified thread is suspended and the thread"s suspend count is incremented.

Suspending a thread causes the thread to stop executing user-mode (application) code.

Each thread has a suspend count (with a maximum value of MAXIMUM_SUSPEND_COUNT). If the suspend count is greater than zero, the thread is suspended; otherwise, the thread is not suspended and is eligible for execution. Calling SuspendThread causes the target thread"s suspend count to be incremented. Attempting to increment past the maximum suspend count causes an error without incrementing the count.

The ResumeThread function decrements the suspend count of a suspended thread.


 
Anonymous   (2002-01-16 09:38) [2]

To VuDZ: It seems you have missed the point. He only has
a thread identifier, not the handle that could be passed
to SuspendThread.

There is OpenThread function on Windows 2000/XP and
Windows Me that allows you to obtain a handle for the
given thread id.

It is possible to implement this function on NT 4 and
earlier systems using native ZwOpenThread.

I don"t know how to do it on Windows 95/98.



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

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

Наверх





Память: 0.44 MB
Время: 0.005 c
1-42992
Zool
2002-02-28 10:38
2002.03.14
jpg


4-43222
raiks
2002-01-14 12:25
2002.03.14
Как отследить попытку обращения к файлу?


14-43144
Digitman
2002-01-29 18:42
2002.03.14
О


1-43093
Gayrus
2002-02-27 05:10
2002.03.14
Свой компонент


1-43033
makar
2002-02-26 09:25
2002.03.14
Вопрос





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский