SuspendThread Procedure

Suspends the thread.

Syntax

[ lCount = ] SuspendThread ( hThread )

The SuspendThread procedure syntax has the following parts:

 

Name

Type

Description

lCount

Long

The thread's previous suspend count if successful; 0xFFFFFFFF otherwise.

hThread

Val AHandle

Handle to the thread.

Comments

Increments the current thread’s suspend count. If any thread has a suspend count above zero, that thread does not execute. The thread can be resumed by calling the ResumeThread function.

Example

The following example will suspend a thread of handle hThread1 and place the suspend count into lSuspendThreadCount1:

lSuspendThreadCount1=SuspendThread(hThread1)

See Also

CreateThread, ExitThread, ResumeThread, TerminateThread