2009年5月30日

Delphi JEDI SingleInstance (單一執行程式)


在 Menu 中選 View -> Units... [Ctrl + F12]
選擇 Project1
uses JclAppInst
加入 JclAppInstances.CheckSingleInstance;
Project1 內容如下

program Project1;

uses
JclAppInst,
Forms,
Unit1 in 'Unit1.pas' {Form1};

{$R *.res}

begin
JclAppInstances.CheckSingleInstance;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

編譯,執行多次程式 Project1.exe
就只會有一個實體程式在執行中

沒有留言:

網誌存檔