Delphi Sample Source Code
- Windows API
-
VCL
How to Create a Custom On‑Screen Touch Keyboard in Delphi keybd_event and IME Control Supported
A detailed guide on creating a custom on‑screen (touch‑enabled) keyboard in Delphi, including keybd_event usage, IME control, and CreateParams configuration. Also covers how to handle cases where the default Windows on‑screen keyboard does not appear.
-
VCL
How to Control Clipping and Window Shapes in Delphi Using Regions Guide to CreateRectRgn and CreateEllipticRgn
A detailed guide on using Regions in Delphi (rectangular, elliptical, and polygonal) to perform image clipping and modify window shapes, complete with sample code using APIs such as CreateRectRgn and CreateEllipticRgn.
-
VCL
Creating a Resident Task Tray Application in Delphi Preventing Multiple Instances and Handling TaskbarCreated
A step‑by‑step guide to building a resident task tray application in Delphi, complete with source code. Covers preventing multiple instances, handling TaskbarCreated, processing WM_QUERYENDSESSION, and other techniques for creating a stable Windows background application.
-
VCL
Get the Full Path of Windows Special Folders in Delphi | SHGetSpecialFolderPath Guide
Learn how to retrieve the full path of Windows special folders—such as Desktop, My Documents, and Application Data—using the SHGetSpecialFolderPath API in Delphi. Includes clear explanations and practical sample code.
-
VCL
Opening Windows Explorer with the ShellExecute API in Delphi | Practical Code Examples
Learn how to open Windows Explorer from Delphi using the ShellExecute API—either by opening a specific directory or highlighting a selected file. This guide includes clear explanations and practical sample code.
-
VCL
How to Create a Startup Shortcut (.lnk) in Delphi | Windows Auto‑Launch Implementation Guide
Learn how to create a shortcut (.lnk file) in the Windows Startup folder using Delphi to automatically launch your application at login. This guide explains the process with clear sample code using IShellLink and IPersistFile.
-
VCL
Improving Image Scaling Quality in Delphi with StretchBlt and SetStretchBltMode (HALFTONE)
Learn how to improve image scaling quality in Delphi using the StretchBlt API together with SetStretchBltMode(HALFTONE). This guide explains the differences from TCanvas.StretchDraw, how to work with HDCs, and includes practical sample code.
-
VCL
Controlling Windows with SetWindowPos in Delphi | Z-Order, Topmost, and SWP Flags Explained
Learn how to use the Windows API SetWindowPos in Delphi to control window position, size, and Z-order. Includes examples for topmost windows (HWND_TOPMOST), sending windows to the back (HWND_BOTTOM), non-activating updates (SWP_NOACTIVATE), and a clear overview of common SWP flags
-
VCL
Retrieving Process Lists and Forcibly Terminating Processes — Delphi Source Code Collection
A practical guide showing how to retrieve a process list in Delphi using the QueryFullProcessImageNameW API and forcibly terminate processes with the TerminateProcess API, complete with sample source code.
- Hardware
-
VCL
Reading and Writing NFC Cards (NXP NTAG215) with PaSoRi and Delphi – Windows Sample Code Collection
This article explains how to read and write NFC cards (NXP NTAG215) using PaSoRi (RC-S380) and Delphi in a Windows environment (winscard.dll and ScardTransmit), with sample code included. While UID can be retrieved from other IC cards as well, this article focuses specifically on NTAG215.
-
VCL
Delphi NFC Programming with PaSoRi (RC-S3800): Read and Write Strings and URLs
Step-by-step guide to using Delphi with the PaSoRi RC-S3800 NFC reader. Learn how to read and write strings, URLs, and UID data from IC cards, with complete source code examples and execution instructions.
-
VCL
Retrieving SMART Data in Delphi|How to Check SSD/HDD Health Status
A step‑by‑step guide on how to retrieve SMART data from SATA‑connected SSDs and HDDs using Delphi, including sample source code. Supports checking drive health status and reading attribute values.
-
VCL
How to Retrieve SMART Information from NVMe SSDs in Delphi|Health Log & IOCTL Usage Example
A guide to retrieving SMART information (Health Information Log) from NVMe‑connected SSDs using Delphi. Includes an implementation example using IOCTL_STORAGE_QUERY_PROPERTY for storage diagnostics on Windows.
