<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
This was raised some time back on this list. Myself and Jeremy both had
some suggestions heres <span>Jeremys</span>:<br>
<pre wrap="">All I did was put that code into the OnPaint Event. I.e. :-

procedure TfrmEditAccount.<span id="mail-highlight-id"
 style="background-color: yellow;">FormShow</span>(Sender: TObject);
begin
  SetWindowPos(Handle, HWND_TOPMOST, Self.left, self.top, 0, 0,
SWP_NOACTIVATE or SWP_NOSIZE);
end;</pre>
Also <span>Conor</span> suggestion may help.<br>
Also could try:<br>
{<span>createnotowned</span>:boolean}<br>
if <span>CreateNotOwned</span> then <span>FormStyle</span> := <span>fsStayOnTop</span><br>
or<br>
&nbsp;&nbsp;&nbsp; if <span>CreateNotOwned</span> then <span>frm</span> := <span>Tform</span>.Create(nil)
else<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>frm</span> := <span>Tform</span>.Create(screen.<span>activeform</span>);<br>
<br>
Al+<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Conor.Boyd@sungard.com">Conor.Boyd@sungard.com</a> wrote:
<blockquote
 cite="midBDB1CD2AE888F2469483A77935D909B24AEBDB@sts-chc-mail01.internal.sungard.corp"
 type="cite">
  <pre wrap="">IIRC the problem is that sometimes Windows needs to recreate your form,
and forgets to set the Stay On Top info.

I think the work around is something like:

1) In your form override the CreateParams procedure.
2) Set the ExStyle field of the TCreateParams parameter to include the
WS_EX_TOPMOST bit.

It's been years since I had to do this, but maybe a bit of Googling will
help you out.

HTH,

Conor

-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:delphi-bounces@ns3.123.co.nz">delphi-bounces@ns3.123.co.nz</a> [<a class="moz-txt-link-freetext" href="mailto:delphi-bounces@ns3.123.co.nz">mailto:delphi-bounces@ns3.123.co.nz</a>]
On Behalf Of Glen Boyd

I have a program that sits on top of all other windows and just displays
a little info for the user.

The only problem is sometimes it forgets it is meant to stay on top and
nothing I seem to do will convince it otherwise.

Are there any tricks out there for forcing the window to be on top of
others but not have the focus?

It is a standard windows 32bit program (i.e. not .net).

Any pointers would be appreciated.

_______________________________________________
Delphi mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Delphi@ns3.123.co.nz">Delphi@ns3.123.co.nz</a>
<a class="moz-txt-link-freetext" href="http://ns3.123.co.nz/mailman/listinfo/delphi">http://ns3.123.co.nz/mailman/listinfo/delphi</a>



  </pre>
</blockquote>
</body>
</html>