A
Adam Honek
How does one attach a thread so it can update the UI of a form?
The other thing is I thought .IsBackground makes the thread active so it
doesn't stop looping until the main thread dies. This doesn't seem to be the
case however with it just dying after one run.
I recall there being a Win32 API by the name AttachThreadInput, is this the
answer?
I'm using the code below to launch the thread.
Dim MyBackgroundThread As System.Threading.Thread
MyBackgroundThread = New System.Threading.Thread(AddressOf
mybackgroundcheck)
MyBackgroundThread.SetApartmentState(Threading.ApartmentState.STA)
MyBackgroundThread.IsBackground = True
MyBackgroundThread.Start()
Thanks,
Adam
The other thing is I thought .IsBackground makes the thread active so it
doesn't stop looping until the main thread dies. This doesn't seem to be the
case however with it just dying after one run.
I recall there being a Win32 API by the name AttachThreadInput, is this the
answer?
I'm using the code below to launch the thread.
Dim MyBackgroundThread As System.Threading.Thread
MyBackgroundThread = New System.Threading.Thread(AddressOf
mybackgroundcheck)
MyBackgroundThread.SetApartmentState(Threading.ApartmentState.STA)
MyBackgroundThread.IsBackground = True
MyBackgroundThread.Start()
Thanks,
Adam