/*Create an event object, then create the thread. Use the WaitForSingleObject function to wait for the event to be set to the signaled state before calling PostThreadMessage. In the thread to which the message will be posted, call PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE) to force the system to create the message queue. Set the event, to indicate that the thread is ready to receive posted messages. */MSDN中说了,用WaitForSingleObject 来等待Post完成. 具体看下这个 http://www.cnblogs.com/ahuo/archive/2007/08/22/864948.html
除非线程崩溃,一般都会被处理如果线程不能正常处理其消息队列,那应是系统出问题了
/*Create an event object, then create the thread. Use the WaitForSingleObject function to wait for the event to be set to the signaled state before calling PostThreadMessage. In the thread to which the message will be posted, call PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE) to force the system to create the message queue. Set the event, to indicate that the thread is ready to receive posted messages.
*/MSDN中说了,用WaitForSingleObject 来等待Post完成.
具体看下这个
http://www.cnblogs.com/ahuo/archive/2007/08/22/864948.html
目的是确保给线程发送消息时,确保线程已经创建了消息队列
目前的情况可能是,当线程已经创建了消息队列,就跟2楼兄弟说的,PostThreadMessage返回TRUE就应该没问题了
是不是这样?