精品一区二区三区影院在线午夜_天天躁日日躁狠狠躁AV麻豆_国产午夜福利短视频_中文字幕乱偷无码AV先锋蜜桃_久久精品一二区东京热_国产成人亚洲日韩欧美久久久,国产成人精品久久一区二区三区

VB使用API多線(xiàn)程程序.

'Original code at:- http://www.free2code.net/plugins/ar.../read.php?id=94
visual basic code:

Option Explicit
'Form level code.

'MultiThread versus DoEvents.

'Add a textbox and 4 command buttons to a form.

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 Long
Private Declare Function TerminateThread Lib "kernel32" (ByVal hThread As Long, _
ByVal dwExitCode As Long) As Long
Private Sub Command1_Click()
id = CreateThread(ByVal 0&, ByVal 0&, AddressOf AddTextMultiThread, ByVal 0&, 0, id)
End Sub
Private Sub Command2_Click()
Call TerminateThread(id, ByVal 0&)
End Sub
Private Sub Command3_Click()
StopDo = True
AddTextDoEvents
End Sub
Private Sub Command4_Click()
StopDo = False
End Sub
Private Sub Form_Load()
Me.Height = 4545
Me.Width = 8925
Text1.Move 45, 45, 8700, 3525
Command1.Move 45, 3690, 1635, 375
Command1.Caption = "Start MultiThread"
Command2.Move 1845, 3690, 1635, 375
Command2.Caption = "Stop MultiThread"
Command3.Move 5310, 3690, 1635, 375
Command3.Caption = "Start DoEvents"
Command4.Move 7110, 3690, 1635, 375
Command4.Caption = "Stop DoEvents"
End Sub

visual basic code:

'Module level code.
Option Explicit
Public id As Long
Public StopDo As Boolean
Public Function AddTextMultiThread()
Do
Form1.Text1.SelText = "Adding to Text1 - "
Loop
End Function
Public Function AddTextDoEvents()
StopDo = True
Do While StopDo = True
Form1.Text1.SelText = "Adding to Text1 - "
DoEvents
Loop
End Function
泰兴市| 洪雅县| 延寿县| 宜兰县| 平泉县| 麻阳| 松阳县| 雅安市| 泗阳县| 文山县| 友谊县| 澜沧| 正阳县| 涪陵区| 合阳县| 巴里| 岳阳市| 绥滨县| 双牌县| 大洼县| 苏尼特右旗| 承德县| 东源县| 惠来县| 元江| 沁水县| 五常市| 雷州市| 龙口市| 平潭县| 林周县| 衡东县| 北碚区| 临洮县| 县级市| 昌图县| 高邮市| 肃宁县| 罗甸县| 扶沟县| 丰镇市|