Форум: "WinAPI";
Поиск по всему сайту: delphimaster.net;
Текущий архив: 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.




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




Наверх





Память: 0.72 MB
Время: 0.02 c
4-43216           otari                 2002-01-11 21:27  2002.03.14  
помогите !!! двучвопросних человеку


7-43198           Leviathan             2001-12-11 20:47  2002.03.14  
Sleep в консольной программе


14-43156          Hecker                2002-01-18 18:22  2002.03.14  
Нужна помощь! (это очень серьёзно!)


7-43206           Alexander Beliy       2001-12-08 02:03  2002.03.14  
Вопрос


6-43119           daos                  2001-12-26 15:50  2002.03.14  
Как принять сообщение через сокет? до меня не доходит...