I know there are other posts that say you can create a control and then check the InvokeRequired
property to see if the current thread is the main thread or not
In my experience, if you attempt to create a dialog from another thread other than the main thread then windows gets all confused and things start going crazy. I tried to do this once with a status window to show the status of the background thread (as well as many other times someone would toss up a dialog from a background thread - and one that did have a Message Loop) - and Windows just started doing "random" things in the program. I'm pretty sure there was some unsafe handling of something going on. Had issues with clicking on the form and the wrong thread handling the messages...
So, I would never have any UI coming up from Anywhere but the main thread.
However, Why not simply save off the CurrentThread when you start, and compare the ThreadID with the current thread?
-Chert