Original Post
I have a question about the MsgWaitForMultipleObjects function. If I am waiting using a MsgWaitForMultipleObjects, 1) if I use the PostThreadMessage in the child thread to post a message to the main thread, MsgWaitForMultipleObjects returns with a value of WAIT_OBJECT_0 + nCount (where nCount is the total number of threads) 2) if I use the PostQuitMessage in the child thread, MsgWaitForMultipleObjects returns with a value of WAIT_OBJECT_0 + threadhandle index. why do these 2 post messages cause the difference in return value of MsgWaitForMultipleObjects? I am looking for a way to retrieve the threadhandle index in the first case.