[DUG] Why does this hang?

Kyley Harris Kyley at harrissoftware.com
Mon Aug 1 21:05:35 NZST 2011


to properly help we'd really need to have an understanding of what your wait
loop is waiting for, and how its waiting..

you are most likely causing a deadlock where the handle message is passing
it to something else that could be waiting for your wait to complete. The
handle message could be forcing your code to act out of turn..

so without knowing why you are waiting, and for what.. as well as what you
want handled the reasons could be numerous.

On Thu, Jul 28, 2011 at 11:09 PM, Ross Levis <ross at stationplaylist.com>wrote:

> I’m using the following code inside a wait loop so that most messages are
> processed except for some mouse and keyboard messages (I think) which I
> don’t want to be processed.  It’s working perfectly here but for another
> user it hangs indefinitely.****
>
> ** **
>
> If PeekMessage(Msg, MainForm.Handle , 0, 0, PM_NOREMOVE) and****
>
> ((Msg.message < 160) or ((Msg.message > 264) and (Msg.message < 512))****
>
> or (Msg.message > 524)) then****
>
>    Application.HandleMessage;****
>
> ** **
>
> I use to have an Application.ProcessMessages but this was causing a problem
> which I can’t remember now, and this code fixed it.****
>
> ** **
>
> Cheers.****
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> unsubscribe
>



-- 
Kyley Harris
Harris Software
+64-21-671-821
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20110801/26f97e20/attachment.html 


More information about the Delphi mailing list