Форум: "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.004 c