互斥对象的使用示例

var
  hMutex: HWND;
  Ret: integer;

begin
  Application.Initialize;
  Application.Title := '神迹之光-免费测试版';
  hMutex := CreateMutex(nil, False, '传奇外挂 酷酷神仙版');
  Ret := GetLastError;
  if Ret <> ERROR_ALREADY_EXISTS then
  begin
    Application.CreateForm(TFrmMain, FrmMain);
    Application.Run;
  end
  else
    ReleaseMutex(hMutex);
end.

原文地址:https://www.cnblogs.com/ZhouXiHong/p/455809.html