?? runoncep.dpr
字號:
program RunOnceP;
uses
Forms,
Windows,
Dialogs,
RunOnceU in 'RunOnceU.pas' {Form1};
{$R *.res}
var
MutexHandle: Integer;
begin
{attempt to open a handle to the mutex. if this function is successful,
we know that the application has already started, and we can terminate}
if OpenMutex(MUTEX_ALL_ACCESS, FALSE, 'RunOnceMutex') <> 0 then
begin
ShowMessage('This application is already open!');
Exit;
end;
{if we get here, we are the first instance of this application, so
create the mutex and immediately acquire ownership of it}
MutexHandle := CreateMutex(nil, TRUE, 'RunOnceMutex');
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
{now that we are done, we must release the mutex}
ReleaseMutex(MutexHandle);
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -