To determine is current event is runnung in main thread:
In form's constructor I set a variable
- Code: Select all
testCheck := GetCurrentThreadId;
in the event :
- Code: Select all
if testCheck = GetCurrentThreadId then
//running in main thread
else
//running in another thread
I wonder if this is right way?
Thanks