^ Delphi PIDL to String and String to PIDL functions

Delphi 3delite helper functions (Win32, Win64, OSX, iOS, Android)

Some free Delphi helper functions:
  • Helper3delite.pas - Win32, Win64, OSX32, iOS and Android compatible

    • function IntToStrDigits(Value: Int64; Digits: Integer): String;
    • function IncludeTrailingPathDelimiterHTTP(const S: string): string;
    • function URLEncode(const S: String; const InQueryString: Boolean): String;
    • function CreateUnicodeFile(FileName: String): Boolean;
    • function IsNewerVersion(CurrentVersion, NewVersion: String): Boolean;
    • function IntToStrW(const Value: Int64; const Digits: Word): String;
    • function MatchFileType(const FileName: String; Extensions: String): Boolean;
    • function ExtractFileNameWithoutExt(const FileName: String): String;
    • function ExtractURL(const URLFileName: string): String;
    • function LastPos(SubStr: Char; S: string): Integer; overload;
    • function LastPosLong(SubStr, S: string): Integer; overload;
    • function LastPosEx(SubStr, S: string): Integer; overload;
    • function LastPos(SubStr: array of Char; S: string): Integer; overload;
    • function PToStr(Address: Pointer): String;
    • function GetLogFileName(FileNameStart, Folder: String): String;
    • function MIMEDecodeStr(MIMEStr: String): String;
    • function GetHTMLTitle(FileName: String): String;
    • function CreateDumbFile(FileName: String): Boolean;
    • function CreateDumbFileEx(FileName: String; Size: Integer): Boolean;
    • function StrConvertToFileName(StrFileName: String): String;
    • function StrConvertToSQLName(Text: String): String;
    • function HexToInt(HexStr: String): Integer;
    • function MakeInt64(LowDWord, HiDWord: Cardinal): Int64;
    • function StrXOR(Text: String; Key: Byte): String;
    • function BitSet(Value: Cardinal; BitNo: Byte; On: Boolean): Cardinal;
    • function WriteText2File(FileName, Text: String): Boolean;
    • procedure LogStrings(FileName, Text: String);
    • function BGR2RGB(BGRValue: Cardinal): Cardinal;
    • function Bytes2MB(Bytes: Int64): String; overload;
    • function Bytes2MB(Bytes: Extended): String; overload;
    • function Secs2Time(Secs: UInt64): String; overload;
    • function Secs2TimeFast(Seconds: Double): String; overload;
    • function Secs2Time(Secs: Double): String; overload;
    • function mSec2Time(mSec: Int64): String;
    • function Sec2Time(Sec: Int64): String;
    • function mSec2TimeEx(mSec: Int64; Format: Integer): String;
    • function mSec2HoursPart(mSec: Int64): Int64;
    • function mSec2MinutesPart(mSec: Int64): Int64;
    • function mSec2SecondsPart(mSec: Int64): Int64;
    • function mSec2MilliSecondsPart(mSec: Int64): Int64;
    • function NGetFileSize(FileName: String): Int64; overload;
    • function NGetFileSizeFrom(SearchRec: TSearchRec): Int64; overload;
    • function EncodeUnicode(UniString: String): String;
    • function DecodeUnicode(UnicodeString: String): String;
    • function IntToBin1(Value: Longint; Digits: Integer): string;
    • function IntToBin2(d: Longint): string;
    • function GetFileModDate(FileName: String): TDateTime;
    • function ExtractFileNameFromURL(const FileName: string): string;
    • function HTMLDecode(const AStr: String): String;
    • function DateTimeDiff(Start, Stop: TDateTime): Int64;
    • function DateTimeDiffmSec(Start, Stop: TDateTime): Int64;
    • function Time2mSec(Value: TTime): Int64;
    • function Linear2dB(Value: Double): String;
    • function dB2LinearPercent(Value: Double): String;
    • function ReplaceNewLines(Text: String): String;
    • function FFTIndex2Frequency(Index: Integer; Length: Integer; Samplerate: Integer): Integer;
    • function FFTFrequency2Index(Frequency: Integer; Length: Integer; Samplerate: Integer): Integer;

  • Helper3deliteWin.pas - Win32 and Win64 compatible

    • function PrivateExtractIcons(lpszFile: LPCTSTR; nIconIndex, cxIcon, cyIcon: Integer; phIcon : HICON; piconid, nIcons, flags: UINT): UINT; stdcall;
    • function FileTime2DateTime(FileTime: TFileTime): TDateTime;
    • function RenameDir(DirFrom, DirTo: string; Silent: Boolean): Boolean;
    • function FileDelete(FileName: String; Silent: Boolean): Boolean;
    • function ExecAndWaitForIt(const s: string): Cardinal;
    • function GetPathDiskSize(Path: String): Int64;
    • function GetPathFreeSpace(Path: String): Int64;
    • function HTTPDecode(const AStr: AnsiString): AnsiString;
    • function HTTPEncode(const AStr: AnsiString): AnsiString;
    • function RuningOn64BitOS: Boolean;
    • procedure OpenGoogleSearch(Handle: HWND; SearchString: String);
    • function GetFileVersionStr(ExeFilename: String): String;
    • function GetFileVersionStrEx(ExeFilename: String; Silent: Boolean): String; overload;
    • function GetFileDescriptionStr(ExeFilename: String): String;
    • function GetFileAuthorStr(ExeFilename: String): String;
    • function GetFileCopyrightStr(ExeFilename: String): String;
    • function DriveSerialNumber(DriveID:Byte): string;
    • procedure ProcessMessages;
    • function FileExistsOnVideoDVD(const FileName: String): Boolean;
    • function WindowsXPThemeActive: Boolean;
    • function CtrlDown: Boolean;
    • function ShiftDown: Boolean;
    • function AltDown: Boolean;
    • function EjectTray(Drive: Char): Boolean;
    • function InsertTray(Drive: Char): Boolean;
    • function GetProcMemUsage(Proc: Cardinal): Int64;
    • function GetTimeZoneBias: TDateTime;
    • function BlockSize(Data: Pointer): Integer; register;
    • function ExecProcessHandle(ProgramName: String): THandle;
    • function SetDelimitedText(const Value: string; Delimiter, QuoteChar: Char): String;
    • function GetWinTempFileName(Beggining, Extension: String): String; stdcall; export;
    • function GetLoginName: String;
    • function GetComputerNameStr: String;
    • function GetVolumeLabel(Drive: String): string;
    • function GetCPUCount: Integer;
    • function IsMouseBtnSwapped: Boolean;
    • function IsMouseBtnDown(AMouseBtn: TMouseButtonType): Boolean;
    • function FileExistsEx(const FileName: String): Boolean;
    • function LocalDateTimeToUTC(D: TDateTime): TDateTime;
    • function UTCToLocalDateTime(D: TDateTime): TDateTime;

  • Helper3deliteForms.pas - Win32 and Win64 compatible

    • function RepositionWindowIfNotVisible(Window: TForm): Boolean;
    • procedure SetAsMainForm(aForm: TForm);
    • procedure SetAsMainForm2(aForm:TForm);
    • function CreatePath(Path: String): Boolean;
    • procedure WordWrapHints(Control: TWinControl);
    • procedure ReSetHeightConstraints(Control: TWinControl);

  • Helper3deliteGFX.pas - Win32 and Win64 compatible

    • function CreateIconFromBitmaps(bmpMask, bmpColor: Graphics.TBitmap): HIcon;
    • function InvertColor(aColor: TColor): TColor;

They are not optimized, so check them before using them in tight loops.

Other misc units included:
  • cmpStandardSystemMenu unit by Colin Wilson
  • FormState unit by Martin Holmes
  • GetAppCPUUsage unit
  • GuidEx unit for GUIDs
  • IOCctl unit - various device type values
  • SpecialFolders unit - Windows special folders (My Documents, etc.)
  • StrEncoder unit by Akybron
  • TaskBarMenu unit by delphi.about.com
  • Redirect unit by Holger Dors
  • ShellDialogs unit by Ingo Eckel
  • PIDL unit by Dieter Steinwedel
  • TWSocket, TSmtpCli, HttpProt class and the MD5 unit by Francois PIETTE
  • CDDB Component by Ari Sundholm, Nanojiffy
  • TSHChangeNotify 3.0 component by Elliott Shevin
  • scsidefs unit by Microsoft Corporation
  • TOggVorbis unit by Jurgen Faul
  • MPShellTypes unit by Jim Kueneman
  • MetaData unit Philip Hadar
  • MemCheck by Jean Marc Eber & Vincent Mahon
Free to use, if using it please consider buying a license for one of my (Delphi) components: www.3delite.hu - Delphi components


[Top]