📄 clsthread.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "clsThread"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'----------------------------------------------------------------
' CreateThread 创建一个线程
' GetExitCodeThread 取退出线程的代码
' ResumeThread 激活一个线程
' Sleep 是睡觉函数(可以使你的线程睡觉) :) 我喜欢睡觉
' CloseHandle 关闭一个打开物体的句柄 适用于很多句柄
Private Declare Function CreateThread Lib "kernel32" (ByVal pThreadAttributes As Long, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, lpParameter As Any, ByVal dwCreationFlags As Long, lpThreadID As Long) As Long
Private Declare Function ResumeThread Lib "kernel32" (ByVal hThread As Long) As Long
Private Declare Function GetExitCodeThread Lib "kernel32" (ByVal hThread As Long, lpExitCode As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Public Function CreateNewThread(ThreadProc As Long)
Dim hThread As Long
Dim ThreadID As Long
hThread = CreateThread(0, 0, ThreadProc, 0, 0, ThreadID)
Call CloseHandle(hThread)
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -