SetWindowPos肯定可以的, 注意下面的handle是属于那一个窗体的<br>SetWindowPos(Form2.handle, hwnd_topmost, 0, 0, 0, 0, swp_nomove or swp_nosize)<br><br>procedure TForm1.mnuProgramInTopClick(Sender: TObject);<br>begin<br> if mnuProgramInTop.Checked =true then //mnuProgramInTop指菜单名<br> SetWindowPos(self.Handle , HWND_NOTOPMOST, 0,0,0,0, SWP_NOMOVE + SWP_NOSIZE) //设置为普通窗口<br> else<br> SetWindowPos(self.Handle, HWND_TOPMOST, 0,0, 0,0, SWP_NOMOVE + SWP_NOSIZE); //放在最前面<br>end;<br><br>看以前的贴子:<br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=638858<br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=382348<br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=382348 <br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=255545<br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=452684<br>