下面的E文可能对提问者有帮助。<br><br> Stay On Down forms... <br>Undertitle: <br> <br>Category: Win API <br>Uploader: Radikal Q3 <br> <br>Question: Stay On Down forms... <br>Answer: You will surely know the way to make a form ' StayOnTop', that is to say, a form that always remains above the rest. <br>This tip consists in just the opposite: to make that the form always remains under the rest, over the desk.<br><br>A way to get this is executing the following code:<br><br><br> SetWindowPos( Form1.Handle,<br> HWND_BOTTOM,<br> 0,0,0,0,<br> SWP_NOMOVE or SWP_NOSIZE);<br><br><br>But... if we want that it is always under? that events must use to get it? <br>I have looked for them, but I was not able to make that works cleanly and without flickering so at the end I desisted of using this code. <br>I solved the workc by means of the message WM_WindowPosChanging that Windows sends to the form before producing a position change, size or visual order (Z Order) in the form.<br><br>The example:<br><br>First we capture the message, for that which, we will add one line in the private part of your form:<br><br><br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> procedure Button1Click(Sender: TObject);<br> procedure FormActivate(Sender: TObject);<br> private<br> { Private declarations }<br> {Esta linea:/This Line:}<br> procedure Chivato(var m: TWMWINDOWPOSCHANGED);<br> message WM_WindowPosChanging;<br> public<br> { Public declarations }<br> end;<br><br><br>Now, we have to put the implementation of the procedure ' Chivato' that will treat the message meetly. We will put it, of course, in the implementation of the form:<br><br><br>procedure TForm1.Chivato(var m: TWMWINDOWPOSCHANGED);<br>begin<br> m.WindowPos.hwndInsertAfter:=HWND_BOTTOM;<br>end;<br><br><br>The operation is very simple: <br>One of the parameters of the message is WindowPos that is a structure in which Windows informs us of the new parameters of the window (size and position). <br>If we don't change the structure, the change will take place. However, if we change some of the parameters, the window will take the aspect and position that we indicate him in the change. <br> <br>