1,488
社区成员




Option Explicit
Private Declare Function CreateThread Lib "kernel32" _
(lpThreadAttributes As Long, ByVal dwStackSize As Long, _
ByVal lpStartAddress As Long, lpParameter As Any, ByVal _
dwCreationFlags As Long, lpThreadId As Long) As Long
Private Sub Command1_Click()
Dim mp As MyParam
mp.s = Now
mp.i = 1
Dim ThreadID As Long
Call CreateThread(ByVal 0&, ByVal 0&, AddressOf thMyFun, ByVal VarPtr(mp), ByVal 0&, ThreadID)
End Sub
Option Explicit
Private Declare Function MessageBox Lib "user32.dll" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
Type MyParam
s As String * 50
i As Integer
End Type
Function thMyFun(p As MyParam) As Long
MessageBox 0, p.i, p.s, 0
End Function
Function thMyFun(p as long)
End Function
Call CreateThread(ByVal 0&, ByVal 0&, AddressOf myModel.thMyFun,varptr(ParamTest), ByVal 0&, threadid)
DWORD WINAPI ThreadProc(
LPVOID lpParameter // thread data
);