delphi 切换指定窗口到最前并获得焦点

//静态加载SwitchToThisWindow
procedure SwitchToThisWindow(hWnd:Thandle;fAltTab:boolean);stdcall;external 'User32.dll';

procedure TForm1.Button1Click(Sender: TObject);
var
h:thandle;
begin
h:=findwindow(nil,'test'); //为外部EXE标题
SwitchToThisWindow(h,true);
end;

posted @ 2010-06-15 15:07  novel  阅读(1767)  评论(0编辑  收藏  举报