the CreateThread(), accept parameters(even arrays) for the adressed function?
Now we must destroy the Thread:
anotherthing: how i know the Thread is finish? we can't destroy the Thread before finish it
Code:
Public Sub Thread( byref start as long)
Dim i As Long
i=start
Do While True
Form1.botton.Caption = i
i = i + 1
If i > 32000000 Then i = 0
Loop
End Sub
Code:
Public hThread1 As Long, hThread1_ID As Long
hThread1 = CreateThread(ByVal 0&, ByVal 0&, AddressOf Thread, _
ByVal 0&, ByVal 0&, hThread1_ID)
Code:
TerminateThread hThread1, 0
CloseHandle hThread1