{ *********************************************************************** }
{                                                                         }
{ Copular Chat Client v3.0 Source Code                                    }
{ Project Unit                                                            }
{                                                                         }
{ Copyright (c) 1998-2002 SAF Studio                                      }
{                                                                         }
{ Author  : Niu Yu Ping                                                   }
{ Nickname: DecimalOX                                                     }
{ Address : Jilin City China                                              }
{                                                                         }
{ QICQ    : 103106262                                                     }
{ Homepage: www.safree.com                                                }
{ EMail   : decimalox@sohu.com                                            }
{                                                                         }
{ *********************************************************************** }

program Client;

uses
  Forms,
  Windows,
  chat in 'chat.pas' {ChatForm},
  Sprite in 'Sprite.pas',
  tools in 'tools.pas',
  logon in 'logon.pas' {LogonForm},
  main in 'main.pas' {MainForm},
  Core in '..\Core\Core.pas';

{$R *.RES}

var
  hMutex:HWND;
  ECode:Integer;

begin
  Application.Initialize;
  Application.Title := 'Copular Chat Client v3.0';

  //if another process of the client is running then exit
  hMutex:=CreateMutex(nil,False,'Copular Chat Client v3.0');
  ECode:=GetLastError;
  if ECode<>ERROR_ALREADY_EXISTS then
  begin
    Application.CreateForm(TMainForm, MainForm);
    Application.Run
  end
  else
    MessageBox(0,'已经有一个聊天室客户程序在运行了','信息',MB_OK or MB_ICONINFORMATION);
  ReleaseMutex(hMutex);
end.
