----- Original Message ----- From: "Dennis Jenkins" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Thursday, September 15, 2005 12:54 PM
Subject: Re: [sqlite] tracing memroy leak


Unless I'm wrong (he he... tha can happen):

PostMessage simply inserts the "MSG" into the target thread's message queue. The target thread's message pump needs to consume that message and dispatch it. Remember, message queues are owned by threads, not windows. PostMessage is asynchronous.

SendMessage actually dispatches the message to the target window handler, but inside the CALLERs thread context. SendMessage blocks until the call is completed. The target message handler must be reentrant for this to work.

It is not processed in the caller's thread context, it is processed in the context of the thread that created the window. If you call SendMessage() to a window in another thread, the first thread will block until the window's thread processes the message and returns. Same behavior across process boundaries. Messages below WM_USER are marshaled to the other process's memory space before being queued up. Anything with a messageid above WM_USER you have to marshal across process yourself.

Robert


Reply via email to