Arvin's Blog
  • 网站首页
  • 原创破解
  • 原创软件
  • 信息安全
  • 网站首页
  • 原创破解
  • 原创软件
  • 信息安全
  1. 首页
  2. 标签
  3. 非原创
VB实现多线程

网络收集 VB实现多线程

'模块:Private Declare Function CreateThread Lib "kernel32" (ByVal lpThreadAttributes As Any, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, lpParameter As Any, ByVal dwCreationFlags As Long, lpThreadID As Long) As LongPrivate Declare Function TerminateThread Lib "kernel32" (ByVal hThread As Long, ByVal dwExitCode As Long) As LongPrivate Declare Function SuspendThread Lib "kernel32" (ByVal hThread As Long) As LongPrivate mThreadHandle As Long'示例Function addnumber() As Long    Dim i As Long    For i = 0 To 100000        Form1.Label1.Caption = i    NextEnd Function'创建线程Public Function CreateNewThread(ByVal cFunction As Long) As Long    Dim mhandle As Long    Dim lpThreadID As Long    mhandle = CreateThread(ByVal 0&, ByVal 0&, cFunction, ByVal 0&, 0, lpThreadID)    If mhandle <> 0 Then mThreadHandle = mhandleEnd Function'终止线程Public Function TerminateTh() As Long    SuspendThread mThreadHandle    TerminateThread mThreadHandle, ByVal 0&    TerminateThread lpThreadID, ByVal 0&End Function

7,356次阅读 0个评论
网络收集 2014-10-19
友情链接
  • 草泥马之家
  • 刀客城
  • md5解密
  • 精易论坛
  • freebuf
湘ICP备14014040号-1
 Theme by Puock