Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2006 Feb : How to detect wm_close when lengthy thread is running?
| Subject: | How to detect wm_close when lengthy thread is running? |
| Posted by: | "Klaus Hast" (kha..@arcor.de) |
| Date: | Mon, 13 Feb 2006 20:02:44 |
Hello,
During thread runs I try to avoid the usage of ProcessMessages
(or quite similar PeekMessage loop PM_REMOVE / TranslateMessage /
DispatchMessage),
but so i have the problem:
how to trap WM_QUIT, WM_CLOSE, WM_QUERYENDSESSION, WM_ENDSESSION
which are arriving to my app "too late" - so that i'm able to interrupt a
lengthy thread in that case?
It seems so that the wm_close cannot be observed by a PeekMessage ...
PM_NOREMOVE ?
What's the recommended alternative?
Many thanks and regards,
Klaus