VB/易语言中TerminateThread如何终止线程?

来源:百度知道 编辑:UC知道 时间:2024/05/30 04:54:19
RT~~
麻烦给个TerminateThread终止线程的VB或易语言的例子
谢谢~~~

VB6.0的。代码如下。单击窗体效果就显现。
================
Option Explicit
Private Declare Function GetCurrentThread Lib "kernel32" () As Long
Private Declare Function GetExitCodeThread Lib "kernel32" (ByVal hThread As Long, lpExitCode As Long) As Long
Private Declare Function TerminateThread Lib "kernel32" (ByVal hThread As Long, ByVal dwExitCode As Long) As Long

Private Sub Form_Click()
Dim hT As OLE_HANDLE, lEC As Long
hT = GetCurrentThread
GetExitCodeThread hT, lEC
TerminateThread hT, lEC
End Sub