A Win32-based application can have multiple threads of execution, and each thread can create windows. The thread that creates a window must contain the code for its window procedure.
An application can use the EnumThreadWindows function to enumerate the windows created by a particular thread. This function passes the handle of each thread window, in turn, to an application-defined callback function, EnumThreadWndProc.
The GetWindowThreadProcessId function returns the identifier of the thread that created a particular window.
To set the show state of a window created by another thread, use the ShowWindowAsync function.