This type of subroutine should be used where the scope of the processing performed by a subroutine is limited to a single application object, but where the result of that processing must be communicated to an application object other than the one that invoked the subroutine. Since the conventional method of achieving communication between objects is via messages, the subroutine posts a message to the affected application object using the WinPostMsg() call, or synchronously passes the message to the application object using the WinSendMsg() call (this latter call should be used with caution; see Message Invocation/Direct Return). The message is routed to the destination window by Presentation Manager. The subroutine typically returns to its caller in the normal fashion; this method of passing control is therefore merely a variation of the previously described Direct Invocation/Direct Return method.
Assuming that the calling routine is a window procedure, the return code (if any) from the subroutine is passed to the calling window procedure and that procedure completes its execution before the message resulting from the called subroutine is processed.
Note that this technique can be used where the called subroutine executes in a secondary thread, and the resulting message is passed back to the calling window procedure in the primary thread to indicate the completion of the secondary thread's processing. See Multitasking Considerations for further discussion of multiple threads.