1 <br>procedure SetWindowTopMost(WindowName:TForm; DoTopMost:Boolean);<br>begin<br> if DoTopMost then<br> SetWindowPos(WindowName.Handle,Hwnd_Topmost,0,0,0,0,(SWP_NOMOVE Or SWP_NOSIZE))<br> else<br> SetWindowPos(WindowName.Handle,Hwnd_Notopmost,0,0,0,0,(SWP_NOMOVE Or SWP_NOSIZE));<br>end;<br><br>2<br> 在主窗体最小化事件中加入:<br> Application.OnDeactivate:=SetactiveWindow(Handle); <br> 其中Handle为子窗体对应句柄。