In this example, a thread notifies the client window that it is about to terminate. It sends the constant THREAD3 as the flFlags parameter so that when the client window receives the message, it can tell which thread terminated.
#define THREAD1 1 /* bit #1 */ #define THREAD2 2 /* bit #2 */ #define THREAD3 4 /* bit #3 */ VOID FAR Thread3() { . . . WinPostMsg(hwndClient, WM_SEM1, (MPARAM) THREAD3, 0); DosExit(EXIT_THREAD, 0); }