Reg_Folder_Exists

Checks whether a registry key (folder) exists under HKEY_CURRENT_USER.
Function Reg_Folder_Exists(Path: String): Boolean;

Parameters

  • Path: String; the subkey path relative to HKEY_CURRENT_USER.

Return Value

Returns True if the registry folder exists.
Returns False otherwise.

Reg_Read_Field

Reads a string value from a registry key under HKEY_CURRENT_USER.
Function Reg_Read_Field(Path, Name: String): String;

Parameters

  • Path: String; the subkey path under HKEY_CURRENT_USER.
  • Name: String; the name of the value to read.

Return Value

Returns the value as a string if found.
Returns an empty string if the field is missing or inaccessible.

Reg_Write_Field

Writes a string value to a registry key under HKEY_CURRENT_USER.
Procedure Reg_Write_Field(Path, Name, Value: String);

Parameters

  • Path: String; the subkey path under HKEY_CURRENT_USER.
  • Name: String; the name of the value to write.
  • Value: String; the string content to write.

Reg_Delete_Folder

Deletes a named subkey (folder) from a registry path under HKEY_CURRENT_USER.
Function Reg_Delete_Folder(Path, Name: String): Boolean;

Parameters

  • Path: String; the base subkey under HKEY_CURRENT_USER.
  • Name: String; the name of the subkey to delete.

Return Value

Returns True if the subkey was deleted successfully.
Returns False if deletion failed.

Reg_Delete_Field

Deletes a named value (field) from a registry key under HKEY_CURRENT_USER.
Function Reg_Delete_Field(Path, Name: String): Boolean;

Parameters

  • Path: String; the key under HKEY_CURRENT_USER.
  • Name: String; the name of the value to delete.

Return Value

Returns True if the value was deleted successfully.
Returns False otherwise.

Reg_Delete_Fields_That_Contain_Str

Deletes all string values from a registry key that contain a specific substring.
Function Reg_Delete_Fields_That_Contain_Str(Path, FindStr: String): Boolean;

Parameters

  • Path: String; the registry key to scan under HKEY_CURRENT_USER.
  • FindStr: String; the substring to search for in value contents.

Return Value

Returns True if one or more values were deleted.
Returns False if nothing matched or deletion failed.

Reg_Read_BinField

Reads binary data from a registry field and stores it into a ThMemoryStream buffer.
Procedure Reg_Read_BinField(Path, Name: String; Buff: ThMemoryStream);

Parameters

  • Path: String; the key path under HKEY_CURRENT_USER.
  • Name: String; the name of the binary value to read.
  • Buff: ThMemoryStream; buffer to receive up to 32KB of binary data.

Reg_Write_BinField

Writes binary data from a ThMemoryStream buffer into a registry field.
Procedure Reg_Write_BinField(Path, Name: String; Buff: ThMemoryStream);

Parameters

  • Path: String; the destination registry key under HKEY_CURRENT_USER.
  • Name: String; the name of the binary value to create or overwrite.
  • Buff: ThMemoryStream; the binary content to write to the registry.

Close_Handle

Closes a Windows system handle safely and sets it to zero if successful.
Optionally logs errors with a custom prefix.
Function Close_Handle(VAR HObject: THandle; LogErrorPrefix: RawByteString = ''): Boolean;

Parameters

  • HObject: THandle; the handle to be closed (will be set to 0 if closed).
  • LogErrorPrefix: RawByteString; optional text to prefix any logged error message.

Return Value

Returns True if the handle was successfully closed.
Returns False if the handle was invalid or closing failed.

GetSpecialFolderPath

Returns the file system path of a Windows special folder by its identifier.
Function GetSpecialFolderPath(Rfid: TIID): String;

Parameters

  • Rfid: TIID; the CSIDL or KNOWNFOLDERID identifier of the special folder.

Return Value

Returns the full path to the requested special folder.
Returns an empty string if the folder is not available.

Get_Documents_Path

Retrieves the full path to the user's "Documents" folder.
Function Get_Documents_Path: String;

Return Value

Returns the path to the current user's documents folder.

Get_AppData_Local_Path

Returns the path to the user's Local AppData folder.
Function Get_AppData_Local_Path: String;

Return Value

Returns the path to the Local Application Data directory.

Get_AppData_Roaming_Path

Returns the path to the user's Roaming AppData folder.
Function Get_AppData_Roaming_Path: String;

Return Value

Returns the path to the Roaming Application Data directory.

Get_Desktop_Path

Returns the file system path to the user's desktop folder.
Function Get_Desktop_Path: String;

Return Value

Returns the full path to the desktop folder of the current user.

Get_Windows_Path

Returns the path to the Windows system folder.
Function Get_Windows_Path: String;

Return Value

Returns the path to the Windows system root (usually C:\Windows).

Get_Pictures_Path

Returns the path to the user's "Pictures" folder.
Function Get_Pictures_Path: String;

Return Value

Returns the full path to the pictures directory.

Get_Programs_Path

Returns the full path to the "Program Files" or "Program Files (x86)" folder.
Function Get_Programs_Path(X86: Boolean = False): String;

Parameters

  • X86: Boolean; if True, returns the 32-bit Program Files folder. If False, returns the standard one.

Return Value

Returns the full path to the appropriate Program Files directory.

Disk_Free_Bytes_Available_To_User

Returns the number of free bytes available on the disk containing the specified path.
Function Disk_Free_Bytes_Available_To_User(DirectoryName: String): Int64;

Parameters

  • DirectoryName: String; a path on the disk to query.

Return Value

Returns the number of free bytes available to the calling user account.
Returns -1 if the operation fails.

Set_File_Write_Time_UTC

Updates the last modified timestamp of a file to the specified UTC time.
Function Set_File_Write_Time_UTC(FileName: String; Last_Update_UTC: TDateTime): Boolean;

Parameters

  • FileName: String; the path to the file whose timestamp will be updated.
  • Last_Update_UTC: TDateTime; the new last modification time in UTC.

Return Value

Returns True if the time was successfully updated.
Returns False if the file does not exist or update failed.

WinApi_SelectFolder

Displays a standard Windows folder selection dialog.
If the user selects a folder, it updates the Directory parameter and returns True.
Function WinApi_SelectFolder(VAR Directory: String; Note: String = ''; Handle: Cardinal = 0): Boolean;

Parameters

  • Directory: String; variable to receive the selected folder path.
  • Note: String; optional description or hint to show in the dialog.
  • Handle: Cardinal; optional parent window handle for modal positioning.

Return Value

Returns True if a folder was selected.
Returns False if the dialog was canceled or failed.

IS_Process_Exists

Checks whether a specific executable is currently running using its full file path.
Function IS_Process_Exists(CONST Full_File_Name: String): Boolean;

Parameters

  • Full_File_Name: String; full path and file name of the target process.

Return Value

Returns True if a process with the specified file name is running.
Returns False otherwise.

IF_Process_Exists_Kill_It

Checks whether a process is running by its full path and kills it if found.
Function IF_Process_Exists_Kill_It(CONST Full_File_Name: String): Boolean;

Parameters

  • Full_File_Name: String; full path and file name of the process to terminate.

Return Value

Returns True if the process was found (and terminated).
Returns False if the process was not found.

IS_Process_Exists_Without_Path

Checks if a process with the specified executable name is running (path is ignored).
Function IS_Process_Exists_Without_Path(ExeName: String): Boolean;

Parameters

  • ExeName: String; the name of the process (e.g. 'notepad.exe').

Return Value

Returns True if a matching process is running.
Returns False otherwise.

Show_All_Windows_Captions

Prints or logs the captions of all top-level windows currently open on the system.
Procedure Show_All_Windows_Captions;

Find_Window_Handle_When_Caption_Cont_String

Searches for a window whose caption contains the specified string, optionally restoring it if found.
Function Find_Window_Handle_When_Caption_Cont_String(ContStr: String; Restore_Window_IF_Found: Boolean): Cardinal;

Parameters

  • ContStr: String; the substring to look for in window captions.
  • Restore_Window_IF_Found: Boolean; if True, restores the window from minimized state.

Return Value

Returns the handle of the found window.
Returns 0 if no matching window is found.

Post_Message_When_Caption_Same_String

Posts a Windows message to a window whose caption exactly matches a given string.
Procedure Post_Message_When_Caption_Same_String(SameStr: String; Msg: Cardinal; WParam, LParam: NativeInt);

Parameters

  • SameStr: String; exact window caption to search for.
  • Msg: Cardinal; message identifier to send (e.g. WM_CLOSE).
  • WParam: NativeInt; first message parameter.
  • LParam: NativeInt; second message parameter.

List_All_Windows_Captions

Returns a list of all top-level window captions currently visible on the system.
Function List_All_Windows_Captions: ThStringList;

Parameters

None

Return Value

Returns a ThStringList containing the captions of all windows.

Call_Window_Handle_To_Front

Brings a specified window handle to the front of the screen and focuses it.
Procedure Call_Window_Handle_To_Front(Whnd: Cardinal);

Parameters

  • Whnd: Cardinal; handle of the window to bring to front.

Set_Application_Priority

Sets the process priority level for the current application.
Procedure Set_Application_Priority(Level: Byte = 1);

Parameters

  • Level: Byte; priority value (0 = Idle, 1 = Normal, 2 = High, 3 = RealTime).

Disable_Windows_UI_Effects

Disables Windows visual effects such as animations and fades.
Optionally saves the current system settings for later restoration.
Procedure Disable_Windows_UI_Effects(Save_This_Settings: Boolean);

Parameters

  • Save_This_Settings: Boolean; if True, stores the original UI settings before changes.

Set_Windows_Wallpaper

Enables or disables the desktop wallpaper based on a Boolean flag.
Function Set_Windows_Wallpaper(Enable_Wallpaper: Boolean): Boolean;

Parameters

  • Enable_Wallpaper: Boolean; True to enable wallpaper, False to disable it.

Return Value

Returns True if the wallpaper setting was changed successfully.
Returns False otherwise.

Windows_Form_Borders_Handler

Handles the non-client hit test message to allow dragging or restricting border interaction on forms.
Procedure Windows_Form_Borders_Handler(VAR Msg: TWMNCHitTest; CONST Form: TForm; CONST AllowMove: Boolean = False);

Parameters

  • Msg: TWMNCHitTest; the Windows message to process (passed by reference).
  • Form: TForm; the target form whose borders are being handled.
  • AllowMove: Boolean; if True, enables window dragging (default is False).

Execute_Browser_On_LocalHost

Launches a specific browser and navigates to the given local URL.
Function Execute_Browser_On_LocalHost(CONST Http_URL: String; CONST Incognito: Boolean; CONST BrowserType: Byte): Boolean;

Parameters

  • Http_URL: String; the localhost URL to open.
  • Incognito: Boolean; if True, launches browser in private/incognito mode.
  • BrowserType: Byte; 0 = Chrome, 1 = Edge, 2 = Internet Explorer.

Return Value

Returns True if the browser was successfully executed.

Execute_Browser_By_OS_Priority

Opens a URL using the preferred browser based on OS/browser availability order.
Function Execute_Browser_By_OS_Priority(Http_URL: String; Incognito: Boolean): Boolean;

Parameters

  • Http_URL: String; the target URL to launch.
  • Incognito: Boolean; if True, attempts incognito mode where supported.

Return Value

Returns True if a browser was successfully executed.

Start_Whatsapp

Opens WhatsApp Web with a prefilled message to a specific phone number.
Attempts to locate and launch the Chrome browser.
Procedure Start_Whatsapp(TargetPhone, Text: String);

Parameters

  • TargetPhone: String; the destination phone number (in international format).
  • Text: String; the message text to send.

ExecURL

Executes the given URL using the system's registered handler (e.g. browser).
Function ExecURL(CONST URL: String; CONST Param: String = ''): Boolean;

Parameters

  • URL: String; the URL or protocol string to execute.
  • Param: String; optional command or arguments to pass (default is empty).

Return Value

Returns True if the URL or protocol was successfully executed.

EditURL

Launches a given URL with the "edit" verb to open it in an editor (e.g. Notepad for text files).
Function EditURL(CONST URL: String; CONST Param: String = ''): Boolean;

Parameters

  • URL: String; the target file or URL to open in edit mode.
  • Param: String; optional arguments (default is empty).

Return Value

Returns True if the file was successfully opened in edit mode.

ExecAppl

Executes an external application with parameters and advanced options like waiting or hiding.
Function ExecAppl(Path, FileName, Param: String; WaitforProcess_In_Sec: Word = 0; EditMode: Boolean = False; Hidden: Boolean = False; LogThis: Boolean = False): Boolean;

Parameters

  • Path: String; working directory or application path.
  • FileName: String; name of the executable file.
  • Param: String; parameters to pass to the executable.
  • WaitforProcess_In_Sec: Word; wait time in seconds for the process to exit (0 = no wait).
  • EditMode: Boolean; if True, opens in "edit" verb mode (default is False).
  • Hidden: Boolean; if True, runs the process hidden from the user.
  • LogThis: Boolean; if True, logs the execution call.

Return Value

Returns True if the application started successfully.

ExecAppl2

Executes a command string using ShellExecute with an optional target path override.
Function ExecAppl2(FullCommandStr, ForcePathTo: String; Command: String = 'open'): Boolean;

Parameters

  • FullCommandStr: String; the full command to run.
  • ForcePathTo: String; optional directory to execute in.
  • Command: String; verb to use (e.g. 'open', 'edit', etc).

Return Value

Returns True if the ShellExecute call succeeded.

ExecAppl3_Into_File

Runs an external executable and redirects its output into a file.
Function ExecAppl3_Into_File(CONST Executable, Arguments, OutputFile: String; WaitforProcess_In_Sec: Word): Boolean;

Parameters

  • Executable: String; the full path to the executable.
  • Arguments: String; the command-line arguments to pass.
  • OutputFile: String; file to capture the output of the process.
  • WaitforProcess_In_Sec: Word; maximum time to wait for process to complete.

Return Value

Returns True if the process completed and output was written successfully.

Show_File_Properties

Displays the Windows Properties dialog for a specific file.
Function Show_File_Properties(FileName: String): Boolean;

Parameters

  • FileName: String; the full path to the file.

Return Value

Returns True if the properties dialog was successfully opened.
Returns False if the dialog could not be shown.

Check_CmdLine_Switch

Checks whether a command-line switch (flag) exists in the current application's parameters.
Function Check_CmdLine_Switch(_Switch: RawByteString): Boolean;

Parameters

  • _Switch: RawByteString; the parameter name to check for (e.g. '/silent').

Return Value

Returns True if the switch was found among the command-line arguments.
Returns False otherwise.

Get_CmdLine_Param_Value

Extracts the value of a named command-line parameter.
Function Get_CmdLine_Param_Value(Name: String): String;

Parameters

  • Name: String; the name of the parameter to locate (case-insensitive).

Return Value

Returns the string that follows the '=' after the matching parameter name.
Returns an empty string if not found or malformed.

ParamStrW

Returns a Unicode-safe version of ParamStr for retrieving command-line arguments.
Function ParamStrW(Index: Byte): String;

Parameters

  • Index: Byte; the parameter index to retrieve (starting at 0).

Return Value

Returns the parameter string at the specified index as UTF-16.

GetShortcut_FN

Builds the full file name of a shortcut based on its title and target folder.
Function GetShortcut_FN(Title: String; Folder_ID: Byte): String;

Parameters

  • Title: String; the name (without extension) of the shortcut.
  • Folder_ID: Byte; predefined system folder index.

Return Value

Returns the full .lnk path to the shortcut if the folder is valid.
Returns an empty string on failure.

CreateShortcut

Creates a Windows shortcut (.lnk) pointing to a target file with optional parameters.
Function CreateShortcut(Title, TargetFile, Parameters: String; Folder_ID: Byte; Maximized: Boolean): Boolean;

Parameters

  • Title: String; the shortcut's display name (without extension).
  • TargetFile: String; the executable or file to run.
  • Parameters: String; optional parameters to pass to the executable.
  • Folder_ID: Byte; destination folder for the shortcut (e.g. Desktop, Start Menu).
  • Maximized: Boolean; if True, the shortcut will launch in maximized window mode.

Return Value

Returns True if the shortcut was created successfully.

GetWindowsVersion

Returns the major Windows version number (e.g. 10.0, 11.0).
Function GetWindowsVersion: Double;

Parameters

None

Return Value

Returns a floating-point value indicating the Windows version.

Application_Terms_OR_HALT

Closes the application cleanly or forces termination depending on internal flags.
Procedure Application_Terms_OR_HALT;

Prevent_Multi_Instances_By_Mutex

Prevents launching multiple instances of the application using a system mutex.
Procedure Prevent_Multi_Instances_By_Mutex;

Get_Joystick_Button_Down

Checks the state of all buttons on a joystick and returns the index of the first one pressed.
Function Get_Joystick_Button_Down(Device_Index: Byte): Byte;

Parameters

  • Device_Index: Byte; the index of the joystick device to poll (usually 0).

Return Value

Returns the index of the button currently pressed (0-based).
Returns 255 if no button is pressed or joystick is unavailable.

Simulate_Keyboard_Clicks

Simulates typing text as if it were input by the keyboard.
Procedure Simulate_Keyboard_Clicks(Text: String);

Parameters

  • Text: String; the text string to simulate keystrokes for.

Get_File_Version

Retrieves the file version of a specified executable or DLL and extracts its numeric version string and high 32-bit segment.
Function Get_File_Version(_FileName: String; VAR FourNumText: String; VAR MostSignif: Cardinal): Boolean;

Parameters

  • _FileName: String; full path to the file whose version is to be read.
  • FourNumText: String; output string in the format "x.x.x.x".
  • MostSignif: Cardinal; output high-order version number for numeric comparison.

Return Value

Returns True if version info was successfully extracted.
Returns False if the file lacks version information or cannot be read.

hv_Version

Returns the version number of the compiled system utilities (SYE_OS_API) module.
Function hv_Version: String;

Parameters

None

Return Value

Returns a string such as '1.0.0.0' representing the internal library version.

Files_List_Total_Size

Calculates the total size of all files matching a mask within a directory (and optionally its subfolders).
Function Files_List_Total_Size(Path, FileMask: String; Including_SubFolders: Boolean): Int64;

Parameters

  • Path: String; folder path to search in.
  • FileMask: String; file pattern (e.g. '*.txt').
  • Including_SubFolders: Boolean; if True, recursively includes all subfolders.

Return Value

Returns the total size in bytes of all matching files.

Files_List_Into_String_List

Collects all files matching a pattern into a ThStringList object.
Function Files_List_Into_String_List(Path, FileMask: String; WithFileExt, StopOnFirstFile: Boolean): ThStringList;

Parameters

  • Path: String; directory path to scan.
  • FileMask: String; file mask filter (e.g. '*.ini').
  • WithFileExt: Boolean; if True, includes extensions in results.
  • StopOnFirstFile: Boolean; if True, returns after the first file is found.

Return Value

Returns a ThStringList of matched file names, possibly empty.

Files_List_Into_String

Returns a single string with the names of all matching files, separated by line breaks.
Function Files_List_Into_String(Path, FileMask: String; WithFileExt, StopOnFirstFile: Boolean): String;

Parameters

  • Path: String; path to search in.
  • FileMask: String; pattern to match (e.g. '*.dat').
  • WithFileExt: Boolean; include extensions in output if True.
  • StopOnFirstFile: Boolean; stop after first match if True.

Return Value

Returns a string with file names separated by CRLF.

Kill_Directories_When_Empty_From_Files

Deletes directories that contain no files (but may contain empty folders).
Function Kill_Directories_When_Empty_From_Files(Path: String): Boolean;

Parameters

  • Path: String; the root directory to scan and clean.

Return Value

Returns True if empty folders were found and removed.
Returns False if nothing was deleted or an error occurred.