参考:<br>uses<br> Forms, Windows,<br> main in 'main.pas' {MainForm},<br><br>{$R *.RES}<br><br>var<br> PrevInstWnd : Integer;<br><br>begin<br> PrevInstWnd := FindWindow('TApplication','XX程序');<br> if PrevInstWnd<>0 then<br> begin<br> if IsIconic(PrevInstWnd) then<br> ShowWindow(PrevInstWnd, SW_RESTORE)<br> else<br> SetForeGroundWindow(PrevInstWnd);<br> Exit;<br> end;<br> Application.Initialize;<br> Application.Title := 'XX程序';<br> Application.CreateForm(TMainForm, MainForm);<br> Application.Run;<br>end.<br>