PostThreadMessage in place of Terminate

From: Valentin Tihomirov (valentin_at_abelectron.com)
Date: 11/16/03


Date: Sun, 16 Nov 2003 14:41:08 +0200

And of course, use a message loop in your thread to be it more responsive.
PostThreadMessage (WM_QUIT) may terminate thread immediately. Threre is
alternative (events) as well. But in any case, yun need to ensure thread has
completed its task.

PostThreadMessage(threadid, WM_QUIT);
Thread.WaifFor;
Thread.Free;



Relevant Pages

  • Re: a *working* PostThreadMessage() implementation...?
    ... road if you add a secondary message loop for some reason. ... Then you should be happy with PostThreadMessage, ... If the thread doesnt process it right now because it displayes a ... is currently doing $whatever i expect the message queue of my thread ...
    (microsoft.public.vc.mfc)
  • Re: a *working* PostThreadMessage() implementation...?
    ... Then you can't use PostThreadMessage, because it is DEFINED to not work the way you want. ... secondary message loop is now running), then the secondary message loop will simply ... is currently doing $whatever i expect the message queue of my thread ...
    (microsoft.public.vc.mfc)
  • Re: a *working* PostThreadMessage() implementation...?
    ... road if you add a secondary message loop for some reason. ... If the thread doesnt process it right now because it displayes a ... is currently doing $whatever i expect the message queue of my thread ... As PostThreadMessage() doesnt fulfill those simple ...
    (microsoft.public.vc.mfc)
  • Re: a *working* PostThreadMessage() implementation...?
    ... road if you add a secondary message loop for some reason. ... Then you should be happy with PostThreadMessage, ... i've experienced enough cases where the message doesnt even appear. ... From, in the "message queue", or the "threads own message ...
    (microsoft.public.vc.mfc)