📄 anti_moreapps.~pas
字号:
unit Anti_MoreApps;
interface
function HaveApp(AppID: String): Boolean;
{在工程文件中写:
if HavePrevInst(AppID: String) then Exit;
Application.Initialize;
//AppID: 不同的应用程序中应该不同,
//所以推荐用Ctrl+Shift+G生成,形如'09A81772-BAA8-41D0-A93A-600DCAEBF058';
.......}
implementation
uses Windows;
var
HMutex: THandle;
function HaveApp(AppID: String): Boolean;
begin
Result := False;
HMutex := OpenMutex(MUTEX_ALL_ACCESS, False, PChar(AppID));
if HMutex = 0 then
HMutex := CreateMutex(nil, False, PChar(AppID))
else Result := True;
end;
initialization
finalization
if HMutex <> 0 then CloseHandle(HMutex);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -