用API函数SetWindowPos可以将任何窗体设置成为TopMost窗体, 即AlswaysOnTop:<br><br>function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND;<br> X, Y, cx, cy: Integer; uFlags: UINT): BOOL; stdcall;<br><br>其中:<br> hWnd: 窗体的 handle (参见已答问题如何得到窗体的handle)<br> hWndInsertAfter: 设置为 HWND_TOPMOST<br> 其他信息可以用 GetWindowPlacement 函数得到<br><br>function GetWindowPlacement(hWnd: HWND; WindowPlacement: PWindowPlacement): BOOL; stdcall;<br><br> PWindowPlacement = ^TWindowPlacement;<br> {$EXTERNALSYM tagWINDOWPLACEMENT}<br> tagWINDOWPLACEMENT = packed record<br> length: UINT;<br> flags: UINT;<br> showCmd: UINT;<br> ptMinPosition: TPoint;<br> ptMaxPosition: TPoint;<br> rcNormalPosition: TRect;<br> end;<br>