<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><DIV>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt">Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt"> <o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt">We have experienced similar issues. In our case it was a print dialog box sitting behind (instead of on top) a window resulting in the appearance of the app 'hanging' causing the end users to call our helpdesk.<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt"> <o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt">The following seems to of fixed the problem we were experiencing<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt"> <o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt"><A href="http://qc.embarcadero.com/wc/qcmain.aspx?d=3730">http://qc.embarcadero.com/wc/qcmain.aspx?d=3730</A><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt"> <o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt">Mike<o:p></o:p></SPAN></P><BR></DIV>
<DIV style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 10pt"><BR>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT size=2 face=Tahoma>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> John Bird <johnkbird@paradise.net.nz><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> NZ Borland Developers Group - Delphi List <delphi@delphi.org.nz><BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tue, 24 August, 2010 10:32:52 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [DUG] SetWindowPos HWND_TOPMOST<BR></FONT><BR>
<STYLE>
<!--
_filtered {font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;}
_filtered {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}
_filtered {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;font-family:"sans-serif";}
a:link, span.MsoHyperlink
        {color:blue;text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;text-decoration:underline;}
span.EmailStyle17
        {font-family:"sans-serif";color:#1F497D;}
span.EmailStyle18
        {font-family:"sans-serif";color:#1F497D;}
.MsoChpDefault
        {font-size:10.0pt;}
_filtered {margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {}
-->
</STYLE>
<DIV><FONT size=2 face=Arial>Not just Delphi - its an ancient Windows problem AFAIK. Even in Windows 7 I have seen a control panel applets puts a modal dialog behind the window - often the best solution is Windows+D (show desktop) and go thru all windows with alt+Tab and usually the hidden modal dialog is found. Usually.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>John</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT><BR> </DIV>
<DIV class=Section1>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">HI have seen this even happen in D2007 ! so I am not sure if it has been sorted in later Delphi versions. I have seen other Windows apps. Not written in Delphi Exhibit the same thing, so is it a Delphi thing, or a Windows thing?? P.s this happens on XP, Vista and Win7 that I have noticed.</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"> </SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">Jeremy</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"> </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: 'sans-serif'; FONT-SIZE: 10pt" lang=EN-US>From:</SPAN></B><SPAN style="FONT-FAMILY: 'sans-serif'; FONT-SIZE: 10pt" lang=EN-US> <A href="mailto:delphi-bounces@delphi.org.nz" rel=nofollow target=_blank ymailto="mailto:delphi-bounces@delphi.org.nz">delphi-bounces@delphi.org.nz</A> [mailto:delphi-bounces@delphi.org.nz] <B>On Behalf Of </B>Ross Levis<BR><B>Sent:</B> Friday, 20 August 2010 22:04<BR><B>To:</B> 'NZ Borland Developers Group - Delphi List'<BR><B>Subject:</B> [DUG] SetWindowPos HWND_TOPMOST</SPAN></P></DIV></DIV>
<P class=MsoNormal> </P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">I have a window in my app which needs to be set to stay on top of all others. In D7, if a modal dialog is activated from this window such as a TOpenFile, it appears underneath the window. I believe later versions of Delphi resolve this problem.</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"> </SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">I got around the issue by using SetWindowPos with HWND_NOTOPMOST just before the dialog is activated, and set it back again afterwards.</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"> </SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">This works well generally, but a few users have complained of the entire app hanging either before the dialog appears or after it closes. I’ve noticed this maybe twice over the last few years using XP.</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"> </SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">Is this an XP bug or Delphi getting confused?</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"> </SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">Perhaps I should try a Application.ProcessMessages after the SetWindowsPos.</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"> </SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt">Ross.</SPAN></P></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>NZ Borland Developers Group - Delphi mailing list<BR>Post: delphi@delphi.org.nz<BR>Admin: http://delphi.org.nz/mailman/listinfo/delphi<BR>Unsubscribe: send an email to delphi-request@delphi.org.nz with Subject: unsubscribe</DIV></DIV></div></body></html>