📄 project1.~dpr
字号:
program Project1;
uses
Forms,
Windows,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
var
hMutex:hWnd;
begin
Application.Initialize;
Application.Title:='test';//名字自己定义
hMutex:=CreateMutex(nil,false,'test');
if GetLastError<>Error_Already_Exists then
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end
else
begin
Application.MessageBox('本程序只允许同时运行一个','Error');
ReleaseMutex(hMutex);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -