⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msgcommunicator.pas

📁 Delphi MsgCommunicator 2-10 component.I ve used, really good job. can be Server-Client message appl
💻 PAS
字号:
{******************************************************************************}
{                                                                              }
{                            MsgCommunicator                                   }
{                                                                              }
{ Copyright (c) 2004-2005 AidAim Software                                      }
{                                                                              }
{  web-site: http://www.aidaim.com                                             }
{  e-mail:   support@aidaim.com                                                }
{                                                                              }
{******************************************************************************}

{******************************************************************************}
{                                                                              }
{                            MsgCommunicator                                   }
{                                                                              }
{ Copyright (c) 2004-2005 AidAim Software                                      }
{                                                                              }
{  web-site: http://www.aidaim.com                                             }
{  e-mail:   support@aidaim.com                                                }
{                                                                              }
{******************************************************************************}

unit MsgCommunicator;

interface

{$I MsgVer.inc}
{$WARNINGS OFF}
{$HINTS OFF}


uses SysUtils, Classes, IniFiles,
     Dialogs,
{$IFDEF MSWINDOWS}
     Windows, Forms, Controls,
{$ENDIF}
{$IFDEF LINUX}
     Libc,
     Messages,
     QForms,
{$ENDIF}


{$IFDEF TRIAL_VERSION}
 {$IFDEF MSWINDOWS}
     Registry, MsgDECUtil, MsgCipher,
 {$ENDIF}
{$ENDIF}


////////////////////////////////////////////////////////////////////////////////
//
//  MsgCommunicator units
//
////////////////////////////////////////////////////////////////////////////////


{$IFDEF LINUX}
     MsgLinux,
{$ENDIF}


{$IFDEF DEBUG_MEMCHECK}
     MemCheck,
{$ENDIF}

     MsgComMain,
{$IFDEF CLIENT_VERSION}
     MsgClient, 
{$ENDIF}
{$IFDEF SERVER_VERSION} 
     MsgServer,
{$ENDIF} 
     MsgCrypto,
     MsgCompression,
     MsgTypes,
     MsgExcept,
     MsgConst, 
 {$IFDEF DEBUG_LOG}
     MsgDebug,
 {$ENDIF}
     MsgMemory;       // UNIT MsgMemory MUST BE LAST !!! 
	
 
type 
	
{$IFDEF LINUX} 
  // Delphi7 Controls.pas 
  TDate = type TDateTime; 
  TTime = type TDateTime;
{$ENDIF}
	
  TMsgCompressionAlgorithm = (caNone,caZLIB,caBZIP,caPPM); 
	
{$IFDEF TRIAL_VERSION} 
 
function msgtrcapt1: String; 
function msgtrnm1: String;
	
function msgtrcapt: String; 
function msgtrnm: String; 
function msgtrgetencmsg(msg: string): String;
function msgtrgetdecmsg(msg: string): String;
procedure msgtrshnm;
{$ENDIF}
	
implementation 
 
uses
  Math;
	
var
{ 
  FCSect:                TRTLCriticalSection; 
  CurrentSessionManager: TMsgSessionComponentManager; 
  Session:               TMsgSession; 
  Initialized:           Boolean; 
}
  IsDesignMode:          Boolean;
	
{$IFDEF TRIAL_VERSION} 
	
function msgtrcapt1: String;
begin 
{ 
 Result := 'MsgCommunicator Trial Version - ';
} 
end;
	
function msgtrnm1: String;
begin 
{ 
  Result := 
             'This is the trial version of MsgCommunicator by'#13+ 
             'AidAim Software (c) 2000-2006.'#13+ 
             'Web site: http://www.aidaim.com'#13#13+ 
	
             'Limitations of this trial version: '#13+
             '- maximum number of clients is '+IntToStr(MsgMaxSingleUserConnections)+'.'#13+ 
	
						 'This screen is created to remind you that your trial version is'#13+
             'provided to you for evaluation purposes only.'#13+
             'If you don''t want to see this screen any more, or if you intend'#13+ 
             'to create a commercial product, please, register and download'#13+ 
             'the appropriate version of this product at http://www.aidaim.com'#13+
             'Also visit our site for all the new versions of our products.'#13#13+ 
             'Should you have any questions or problems with our product,'#13+ 
             'be sure to contact us at support@aidaim.com'; 
}
end;
 
function msgtrcapt: String; 
begin 
 Result := 'BEDAEC896E0AB355805CD85A1A801CF716BAAC26BA3B04C62550D18D243EC0EE'; 
end; 
 
function msgtrnm: String;
begin 
  Result := 
             '85342E20DE20E32E63B4D63D05BD5E020874B2B2E2B760F71FBF3643793892A888AEBAF9BA2EB69F40FDD34132C1C61330A7A52789479AD49014E98B92775CC02DF725F858A025F0412CEE' 
            +'6AB32E9927BEF52AF86D7732C113F5311EC14F9C9F619C188832BC5804701B3788452068FB18EE2E816A99BF8509BF625853AFA115178C9AA2A91AAF08EF3C76352AAB75185B2163AB7D9D' 
            +'E863DBCFD40076404D9A2FFCF1D08EEF8B6A1FF6ED24C2A8B95A6B70FDB6EE87C047F640E1AF6055DE078B38E90BBFCDB5A49066D478B2F4BE0F4991B559D7A22E250CD90D289E55EA7476' 
            +'2C952C0AA3DE58A078B6BB40B1F1242DC8003D9A4DD0C3EE7F59837141DD0D4EECC07500045A6AFC7AA8966B8060DB8630A30EE401AF90472287EDD8CFA1DFB0AF12415A41465D58836F35' 
            +'E53CC02B3A1163B7A4F0F75B83C119E941135F0F224C908239B2824D2D9BD0B7449E5CC96F3680BCE198835DAF93273878E3690505F98508F082EE83EF4011C65CFEF6581E1B18E4F61110' 
            +'4ED08B27D48FB3A3CDCE8A5E2FFED7D237CC843EC4494828143D27477A82131BB177E530DF18C1899BE2A7E12EEC4328033D331F52A28CB5DCF5F80C199165220D0AF30CBEBFB5F6E15C19' 
            +'3ABF25D2C8444FC8A6603C7BECDA8CFFE09CECE4E82C0B010D8551BFF4FAFD4C08FBDF77478764954D476DBED56924466EB2F07A58F4D7C7B5BBAD1029CCF83C3096DB3F82E63E713E9C0F' 
            +'BFBF3AF01FE3BE6B5A505B99C10802B9B2ACB0F587E4B6CCE0074FBC9865B178840022857E8244E81007C62DE60B7791F04F45496449F83D01E8D123317F27229DAB0A35229165C2F14635'
            +'FEA4DFE7638CC2B2981C8314C137F5E22A8115F8DD7F914E3A8822890C8C98EA6229346775863ABAE46A221257270CD443'
            ;
	
end; 
	
function msgtrgetencmsg(msg: string): String;
var cr: TCipher_Blowfish; 
    s: string;
begin
 cr := TCipher_Blowfish.Create(MsgDefaultPassword,nil); 
 s := cr.EncodeString(msg); 
 cr.Free; 
 Result := StrToFormat(PChar(@s[1]),Length(s),fmtHEX); 
end; 
 
function msgtrgetdecmsg(msg: string): String; 
var cr: TCipher_Blowfish;
    s: string;
begin 
 s := FormatToStr(PChar(@msg[1]),Length(msg),fmtHEX);
 cr := TCipher_Blowfish.Create(MsgDefaultPassword,nil); 
 Result := cr.DecodeString(s); 
 cr.Free;
end; 
	
function msgtrgnm: String; 
begin 
 Result := msgtrgetdecmsg(msgtrnm);
end;

function msgtrgcapt: String;
var ds: char;
    vStr: string;
begin
  ds := DecimalSeparator;
  DecimalSeparator := '.';
  vStr := 'v.'+FormatFloat('0.00',MsgVersion) + ' '+ MsgVersionText;
  DecimalSeparator := ds;
  Result := msgtrgetdecmsg(msgtrcapt) + vStr;
end;

procedure msgtrshnm;
begin
{$IFDEF TRIAL_VERSION_WITHOUT_NAG_SCREEN}
 Exit;
{$ENDIF}
 MessageBox(0,PChar(msgtrgnm),PChar(msgtrgcapt),
{$IFDEF MSWINDOWS}
		 MB_OK+MB_ICONINFORMATION+MB_DEFBUTTON1
{$ENDIF}
{$IFDEF LINUX}
     [smbOK], smsInformation
{$ENDIF}
);
end;

//------------------------------------------------------------------------------
// callback function to enumerate all open windows
//------------------------------------------------------------------------------
Function MsgWindowCallback(WHandle : HWnd; Var Parm : Pointer) : Boolean;
          stdcall;
{This function is called once for each window}
 Var MyString : PChar;
begin

    {Window text}
    MyString := Allocmem(255);
    GetWindowText(WHandle,MyString,255);
    TStringList(Parm).Add(MyString);
    FreeMem(MyString,255);
    Result := True; {Everything's okay. Continue to enumerate windows}
end;
{$ENDIF}


initialization
{$IFDEF DEBUG_LOG_INIT}
aaWriteToLog('MsgCommunicator> initialization started');
{$ENDIF}

  {$IFDEF DEBUG_MEMCHECK}
  MemChk;
  {$ENDIF}

  IsDesignMode := False;

{$IFDEF DEBUG_LOG_INIT}
aaWriteToLog('MsgCommunicator> initialization finished');
{$ENDIF}

finalization

end.

⌨️ 快捷键说明

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