from MSDN:<br>=============<br>The GetMsgProc function is an application-defined or library-defined callback function used with the SetWindowsHookEx function. The system calls this function whenever the GetMessage or PeekMessage function 【has retrieved a message】 from an application message queue. 【Before returning】 the retrieved message to the caller, the system passes the message to the hook procedure. <br>============<br>注意【】的部分。<br>我的理解是:Hook被调用是在目的程序收到消息之后,发回确认信息之前,这样对目的程序的执行并不能产生影响,对不?<br><br>
Before returning the retrieved message to the caller, the system passes the message to the hook procedure.<br>这里caller是调用GetMessage的应用程序,而不是调用PostMessage的那个<br>PostMessage发消息是不存在你所说的确认信息的<br><br>你再看看Remarks里的一段:<br>The GetMsgProc hook procedure can examine or modify the message. After the hook procedure returns control to the system, the GetMessage or PeekMessage function returns the message, along with any modifications, to the application that originally called it.