sendmessage.dpr

来自「delphi写的基于server和client的聊天源码 有参考意义」· DPR 代码 · 共 40 行

DPR
40
字号
program sendmessage;

uses
  Forms,
  windows,
  Unitmsgsend in 'Unitmsgsend.pas' {frmmsgsend},
  Unitpulicsub in 'Unitpulicsub.pas',
  Unitmsgdm in 'Unitmsgdm.pas' {dm: TDataModule},
  Unitthzh in 'Unitthzh.pas',
  Unitzcser in 'Unitzcser.pas' {frmzcser},
  Unitbbs in 'Unitbbs.pas' {frmbbs},
  Unitbbsmx in 'Unitbbsmx.pas' {frmbbsmx};

Var
hMutex:HWND;
Ret:Integer;
{$R *.res}

begin
  hMutex:=CreateMutex(nil,False,'GDsendmsg');
  Ret:=GetLastError;
  If Ret<>ERROR_ALREADY_EXISTS Then
  begin
    Application.Initialize;
    Application.Title := '消息管理';
    Application.CreateForm(Tfrmmsgsend, frmmsgsend);
  try
      application.CreateForm(tdm,dm);
    except
      application.MessageBox('应用服务器连接错误,请重新注册应用服务器!','错误',mb_iconwarning);
      application.CreateForm(tfrmzcser,frmzcser);
    end;
    Application.Run;
  end else
  begin
    Application.MessageBox('程序已经运行!',pchar(application.Title),MB_iconwarning);
    ReleaseMutex(hMutex);
  end;
end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?