VB/易语言中TerminateThread如何终止线程?
发布网友
发布时间:2024-04-23 13:26
我来回答
共1个回答
热心网友
时间:2024-07-08 00:28
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