Hello The trick,
Thank you very much for your project. It's helped a lot here
Now I need an anointing to stop the threads immediately without waiting for them to finish.
I tried the code below and things seem to be working fine. Please, do you have any other suggestions?
Code:Private Declare Function TerminateThread Lib "kernel32" (ByVal hThread As Long, ByVal dwExitCode As Long) As Long Public Function StopThreadImmediately(ByVal lAsynchId As Long) As Long Dim hThread As Long Const THREAD_TERMINATE As Long = 1 ' // Unsupported in IDE If bIsInIDE Then Exit Function If lAsynchId > 0 Then hThread = OpenThread(THREAD_TERMINATE, 0, lAsynchId) If Not (hThread = 0) Then StopThreadImmediately = TerminateThread(hThread, 0) CloseHandle hThread End If End If End Function





Reply With Quote
