第1个回答 推荐于2016-04-18
下面的代码可以完成你要的功能
如果有不明白可以联系qq 1988723
procedure setWindowTopMost;
var p:TPoint;
childWnd,parentWnd:HWND;
begin
GetCursorPos(p);
childWnd:=WindowFromPoint(p);
parentWnd:=GetParent(childWnd);
if parentWnd<>GetDesktopWindow then
begin
SetWindowPos(childWnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE or SWP_NOSIZE);
end;
end;本回答被提问者采纳