<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:m =
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19019">
<STYLE>@font-face {
        font-family: PMingLiU;
}
@font-face {
        font-family: PMingLiU;
}
@font-face {
        font-family: Calibri;
}
@font-face {
        font-family: Tahoma;
}
@font-face {
        font-family: @PMingLiU;
}
@page WordSection1 {size: 612.0pt 792.0pt; margin: 72.0pt 72.0pt 72.0pt 72.0pt; }
P.MsoNormal {
        MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt
}
LI.MsoNormal {
        MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt
}
DIV.MsoNormal {
        MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"; FONT-SIZE: 11pt
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.EmailStyle17 {
        FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d; mso-style-type: personal
}
SPAN.EmailStyle18 {
        FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d; mso-style-type: personal-reply
}
.MsoChpDefault {
        FONT-SIZE: 10pt; mso-style-type: export-only
}
DIV.WordSection1 {
        page: WordSection1
}
</STYLE>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-NZ link=blue vLink=purple>
<DIV dir=ltr align=left><SPAN class=391164808-01082011><FONT color=#0000ff
size=2 face=Arial>Not 100% sure, but I thought that your loop will not work if
the message on top of the queue is not falling into your range, and the message
would remain on the queue (due to 'NOREMOVE' flag), and will be peeked everytime
afterwards.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=391164808-01082011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=391164808-01082011><FONT color=#0000ff
size=2 face=Arial>Not sure which message MadExcept uses, it could well be
outside of your message ID range.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=391164808-01082011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=391164808-01082011><FONT color=#0000ff
size=2 face=Arial>Edward</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT face=Tahoma><FONT size=2><B>From:</B> delphi-bounces@delphi.org.nz
[mailto:delphi-bounces@delphi.org.nz] <B>On Behalf Of </B>Ross
Levis<BR><B>Sent:</B> Thursday, 28 July 2011 11:17 p.m.<BR><B>To:</B> 'NZ
Borland Developers Group - Delphi List'<BR><B>Subject:</B> Re: [DUG] Why does
this hang?<BR></FONT></FONT><BR></DIV>
<DIV></DIV>
<DIV class=WordSection1>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">A little more
info. I have MadExcept operating and it detected “The application seems to
be frozen.”<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="COLOR: #1f497d; FONT-SIZE: 12pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">77fa15ec
ntdll.dll
KiUserCallbackDispatcher<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">77e1567d
user32.dll
PeekMessageA<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="COLOR: #1f497d; FONT-SIZE: 12pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="COLOR: #1f497d; FONT-SIZE: 12pt">KiUserCallbackDispatcher is where it is
hanging.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="COLOR: #1f497d; FONT-SIZE: 12pt"><o:p> </o:p></SPAN></P>
<DIV>
<DIV
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<P class=MsoNormal><B><SPAN
style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt"
lang=EN-US>From:</SPAN></B><SPAN
style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt" lang=EN-US>
delphi-bounces@delphi.org.nz [mailto:delphi-bounces@delphi.org.nz] <B>On Behalf
Of </B>Ross Levis<BR><B>Sent:</B> Thursday, 28 July 2011 11:09
p.m.<BR><B>To:</B> 'NZ Borland Developers Group - Delphi
List'<BR><B>Subject:</B> [DUG] Why does this
hang?<o:p></o:p></SPAN></P></DIV></DIV>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">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.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="COLOR: #1f497d; FONT-SIZE: 12pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">If
PeekMessage(Msg, MainForm.Handle , 0, 0, PM_NOREMOVE) and<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">((Msg.message
< 160) or ((Msg.message > 264) and (Msg.message <
512))<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">or (Msg.message
> 524)) then<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">
Application.HandleMessage;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="COLOR: #1f497d; FONT-SIZE: 12pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">I use to have
an Application.ProcessMessages but this was causing a problem which I can’t
remember now, and this code fixed it.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="COLOR: #1f497d; FONT-SIZE: 12pt"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="COLOR: #1f497d; FONT-SIZE: 12pt">Cheers.<o:p></o:p></SPAN></P></DIV>
<HR SIZE=1 noShade>
<A></A>
<P class=avgcert align=left color="#000000">No virus found in this
message.<BR>Checked by AVG - <A
href="http://www.avg.com">www.avg.com</A><BR>Version: 10.0.1390 / Virus
Database: 1518/3797 - Release Date: 07/29/11</P></BODY></HTML>