Форум: "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.026 c
14-43167          Igor_thief            2002-01-30 17:38  2002.03.14  
Если не слом, то почитаете.


1-43044           PSERG                 2002-02-26 07:00  2002.03.14  
Delphi6 + DLL


7-43209           Новичек123            2001-12-03 22:51  2002.03.14  
Приветствую! Необходимо создать небольшой этулятор клавиатуры, нашимаем на кнопку со знаком 5 и в лебел появляется 5, нашимаем на 6 и в лебел 56


6-43133           GHF                   2001-12-26 13:27  2002.03.14  
Закачка страницы html


1-42997           bnn                   2002-02-28 14:42  2002.03.14  
Преобразование пикселей в сантиметры