The IsGUIThread function tests whether the calling thread is already a graphical user interface (GUI) thread. It can also optionally convert the thread to a GUI thread.
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool IsGUIThread([MarshalAs(UnmanagedType.Bool)] bool bConvert);
TODO
None.
bConvert
If TRUE and the thread is not a GUI thread, convert thread to a GUI thread.
The function returns a nonzero value in the following situations:
Otherwise, the function returns zero.
If the calling thread is already a GUI thread.
If bConvert is TRUE and the function successfully converts the thread to a GUI thread.
If bConvert is TRUE and the function cannot successfully convert the thread to a GUI thread, IsGUIThread returns ERROR_NOT_ENOUGH_MEMORY.