Форум: "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.04 c
7-43197           Darker2               2001-10-28 07:54  2002.03.14  
COM Port. Помощь в начинании.


1-42988           FOM                   2002-02-26 10:06  2002.03.14  
NetMessageBufferSend()


1-43048           asl                   2002-02-21 16:17  2002.03.14  
Требуется поставить простенькую защиту на прогу.


1-43100           Miwa                  2002-02-27 22:44  2002.03.14  
SDK help


1-43117           Eraser                2002-02-28 13:05  2002.03.14  
создание компонентов в программе