[Read Me] [License]
TDegrade = (ddRouge, ddVert, ddBleu);
TDegrades = set of TDegrade;
TColoredLabel = Class(TLabel)
Degrade : TDegrades;
End;
TWizardPage = class(TCustomControl)
ImageNum : Integer;
CanShow : Boolean;
end;
TWizard = class(TCustomControl)
Procedure RefreshImage;
CanShow : array of Boolean;
ActivePage : string;
PageIndex : Integer;
PageStart : Integer;
Pages : TStrings;
ButtonNext : TButton;
ButtonPrec : TButton;
Image : TImage;
ImageList : TImageList;
ImageNum : Integer;
HelpNum : Integer;
OnPageChanged : TNotifyPageChange;
OnBeforeChange : TNotifyBeforePageChange;
end;
TMosaicImage = class(TGraphicControl)
Mosaic: Boolean;
end;
TOngletDirection = (odVertical,odHorizontal);
TOnglet = class(TGraphicControl)
TopBorder : integer;
BottomBorder : integer;
LeftBorder : integer;
RightBorder : integer;
Pages : TStringList;
Colors : Array of TColor;
Direction : TOngletDirection;
Selected : integer;
ButtonBar : TButtonBar;
end;
TButtonBarIcon = class(TObject)
Width : integer;
Height : integer;
Icon : TBitmap;
Hint : String;
Command : String;
PageNum : Integer;
Procedure ExtractIcon(FileName : String ; Num : Word);
End;
TButtonBar = class(TGraphicControl)
Function Add : TButtonBarIcon;
IconWidth : integer;
IconHeight : integer;
TopBorder : integer;
BottomBorder : integer;
LeftBorder : integer;
RightBorder : integer;
BackGround : TBitmap;
Page : Integer;
OnExecute : TNotifyExecute;
end;
TDirChooser = class(TComponent)
Function Execute:Boolean;
Title : String;
DefaultDir : String;
DefaultSubDir : String;
Text : String;
ReadOnly : boolean;
end;
TRegisteryBase = class(TComponent)
Function GetStrValue(Key : String;Def : String):String;
Procedure SetStrValue(Key : String;V : String);
Function GetIntValue(Key : String;Def : Integer):Integer;
Procedure SetIntValue(Key : String;V : Integer);
Procedure DelKey(Key : String);
Procedure DelValue(Key : String);
Function GetAppStrValue(Key : String;Def : String):String;
Procedure SetAppStrValue(Key : String;V : String);
Function GetAppIntValue(Key : String;Def : Integer):Integer;
Procedure SetAppIntValue(Key : String;V : Integer);
Procedure DelAppKey(Key : String);
Procedure DelAppValue(Key : String);
Procedure SetAssociation(Ext, Name, Desc, Commande, Icone : String);
Procedure SetAssociationToMe(Ext, Name, Desc : String ; Icone : Integer);
Societe : String;
Version : String;
ExtAssociation : String;
AutoRun : Boolean;
AutoRunServices : Boolean;
WinDir : String;
SysDir : String;
DesktopDir : String;
FavoritesDir : String;
FontsDir : String;
NetHoodDir : String;
PersonalDir : String;
ProgramsDir : String;
RecentDir : String;
SendToDir : String;
StartMenuDir : String;
StartupDir : String;
TemplatesDir : String;
ProgramFilesDir : String;
IS_UserName : String;
IS_Companyname : String;
IS_Serial : String;
end;
TResItem = Record
Name : TResName;
Date : TDateTime;
NormalSize : Longint;
CompSize : Longint;
Compressed : ByteBool;
UserData : Integer;
End;
TDadRes = Class(TComponent)
Procedure Open;
Procedure Close;
Procedure UpdateFile;
Procedure Add(Stream : TStream ; Name : String ; Date : TDateTime ; Compressed : Boolean ; UserData : Integer);
Procedure AddFile(FileName, Name : String ; Compressed : Boolean ; UserData : Integer);
Procedure Delete(Name : String);
Function Extract(Name : String ; Stream : TStream):TResItem;
Procedure ExtractToFile(Name, FileName : String);
Procedure Optimize;
Procedure GetNames(Strings : TStrings);
Items[Name : String] : TResItem;
Stream[Name : String] : TDadResStream;
Offset : integer;
ReadOnly : Boolean;
FileName : TFileName;
Version : String;
Actived : Boolean;
IndexFile : String;
OnPourcent : TOnPourcent;
End;
TDadResStream = class(TStream)
constructor Create(Name : String ; AOwner : TDadRes);
end;
TSystemTrayIcon = class(TComponent)
Animate : Boolean;
AnimInterval : Cardinal;
AnimImageList : TImageList;
AnimPingPong : Boolean;
Enabled : Boolean;
Visible : Boolean;
ShowAppIcon : Boolean;
Icon : TIcon;
Hint : String;
ShowHint : Boolean;
UserID : integer;
ShowMainForm : Boolean;
PopupMenu : TPopupMenu;
RestoreOnClick : Boolean;
OnLeftClick : TNotifyEvent;
OnRightClick : TNotifyEvent;
OnMouseDown : TSStIcMouseEvent;
OnMouseMove : TSStIcMouseEvent;
OnMouseUp : TSStIcMouseEvent;
end;
// Operations sur des TBitmap
Procedure DrawRotate(Const Dest : TCanvas; X, Y, W, H : Integer ; Const Src : TBitmap; Const Angle, Zoom : Double ; Transparent : Boolean);
Function RotateBitmap(Const Src : TBitmap; Const Dest : TBitmap; DWidth , DHeight : Integer ; Const Angle, Zoom : Double):TBitmap;
Function StretchBitmap(Const Src : TBitmap; Const Dest : TBitmap; DWidth , DHeight : Integer ; Interpolation : Boolean):TBitmap;
Function AjustToRect(const SrcWidth, SrcHeight, DstWidth, DstHeight : Integer ; Center : Boolean):TRect;
Function StretchBitmap_PreserveRatio(Const Src : TBitmap; Const Dest : TBitmap; DWidth , DHeight : Integer ; Quick : Boolean):TBitmap;
Procedure StretchDraw(Canvas : TCanvas ; Const Img : TBitmap; DstRect : TRect; Quick, Center : Boolean);
// Fonctions avancées sur les affichages de textes
procedure SetTextAngle(Canvas : TCanvas; Angle : Word);
procedure SetTextDims(Canvas : TCanvas; Width, Height : Word);
procedure TextOutAngle(Canvas : TCanvas; x,y: Integer; Angle: Word; s: string);
Procedure TextJustify(Canvas : TCanvas ; Rect : TRect ; Jx,Jy : Integer ; Text : String);
// Primitives de dessin sur Canvas
Procedure DrawRect(Canvas : TCanvas ; Const Rect : TRect);
Procedure DrawMosaic(Dest : TCanvas ; Const DestRect : TRect ; Source : TBitmap);
Procedure DrawGradient(Canvas : TCanvas ; Const R : TRect ; ColorFrom, ColorTo : TColor);
// Opérations sur des TRect
Function DeltaRect(Const Rect : TRect ; DeltaX, DeltaY : integer):TRect;
Function TestRect(X, Y : integer ; Rect : TRect):Boolean;
// Extraction des l'icones d'un fichier avec redimensionnement "propre"
Procedure ExtractFileIcon(FileName : String ; Width, Height : Integer ; Dest : TBitmap ; Num : Word);
Type
TExecWindow = (ewDefault, ewMinimized, ewMaximized, ewHide );
TExitWindowsFlag = (ewLogOff,ewShutDown,ewReboot,ew,ewForce,ewPowerOff);
TExitWindowsFlags = set of TExitWindowsFlag;
function FileExec(const CmdLine: String ; ExecWindow : TExecWindow ; Wait: Boolean ): Boolean;
function DocExec(const CmdLine: String ; ExecWindow : TExecWindow):Boolean;
Function ExitWindows(Flags : TExitWindowsFlags):Boolean;
Function DadExtractFileDir(S:String):String; // avec le '\' final
Function Remplace(Const What,From,By : String):String;
Function OpenKey(Key : String ; Const CanCreate : Boolean):Boolean;
Function ReadString(Key : String):String;
Procedure WriteString(Const Name, Value : String);
Procedure WriteToFile(Fic, Text : String);
Function GetUserName:String;
Function GetComputerName:String;
Var
RootKey : Integer;
type
HMonitor = integer;
PMonitorInfo = ^TMonitorInfo;
TMonitorInfo = Record
cbSize : DWord;
rcMonitor : TRect;
rcWork : TRect;
dwFlags : DWord;
szDevice : Array[0..CCHDEVICENAME-1] of Char;
End;
TDisplayDevice = record
cbSize : DWord;
DeviceName : Array[0..31] of Char;
DeviceDescription : Array[0..127] of Char;
StateFlags : DWord;
End;
const
// Constantes pour Flags de MonitorFromPoint
MONITOR_DEFAULTTONULL = 0; // Retourne nil si le point n'appartient à aucun moniteur.
MONITOR_DEFAULTTOPRIMARY = 1; // Retourne le handle du moniteur principal.
MONITOR_DEFAULTTONEAREST = 2; // Retourne le handle du moniteur le plus proche.
// Constante pour dwFlags de TMonitorInfo
MONITOR_INFO_PRIMARY = 1;
// Constantes pour StateFlags de TDisplayDevice
ATTACHED_TO_DESKTOP = $01;
DISPLAY_DEVICE_MULTI_DRIVER = $02;
DISPLAY_DEVICE_PRIMARY_DEVICE = $04;
DISPLAY_DEVICE_MIRRORING_DRIVER = $08;
DISPLAY_DEVICE_VGA_COMPATIBLE = $10;
function MonitorFromPoint(Pt : TPoint ; Flags : DWord):HMonitor;
function MonitorFromRect(Rc : PRect ; Flags : DWord):HMonitor;
function MonitorFromWindow(Wnd : HWnd ; Flags : DWord):HMonitor;
function GetMonitorInfo(Monitor : HMonitor ; var MonitorInfo : TMonitorInfo):Boolean;
function MonitorEnumProc(Monitor : HMonitor ; hdcMonitor : HDC ; rcMonitor : PRect ; Data : DWord):Boolean;
function EnumDisplayMonitors(dc : HDC ; rcClip : PRect ; EnumProc : TMonitorEnumProc ; Data : DWord):Boolean;
function EnumDisplayDevices(Reserved : Pointer ; iDevNum : DWord ; var DisplayDevice : TDisplayDevice ; dwFlags : DWord):Boolean;
Procedure ShowMessage(Msg : String);