Delphi 进程程序多开调用单元


本文整理自网络,侵删。

 
unit fun;

interface

uses
  Windows,Forms,SysUtils,TlHelp32,ActiveX,ComObj,ShlObj;

procedure  Mutex;//进程互斥
implementation
uses main;


procedure  Mutex;
var
 hMutex:HWND;
begin
///////////////////////////////创建互斥进程/////////////////////////////
  hMutex := CreateMutex(nil,True,'johntao');
  if hMutex <> 0 then
    if GetLastError = ERROR_ALREADY_EXISTS then
    begin
      Application.MessageBox('禁止多开登陆器!','提示信息',MB_OK);
      Application.Terminate;
    end;
///////////////////////////////end/////////////////////////////////////
end;
end.

用法:


begin
  Mutex;//进程互斥
  Application.Initialize;
  Application.CreateForm(Tfrm_main, frm_main);
  Application.Run;
end.

相关阅读 >>

Delphi 数字转excel字母列序号

Delphi tms web core twebsocketclient

Delphi idsmtp控件发送邮件

Delphi tnethttpclient的用法

Delphi webbrowser 去除滚动条和边框

Delphi 调用clipboard 收集剪切板信息

Delphi研究之驱动开发篇(七)--利用共享内存与用户模式

Delphi fmx 切换窗体最大化

Delphi版多开源码,也就是遍历系统内核对象句柄

Delphi中始终用webbrowser打开网页

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...