Api In Delphi Snippets


A short and simple code snippet using voice output with Delphi

By default, Delphi gets its date/time, currency and numeric format from Control Panel's International settings. We can set the constants defined in Delphi, like DecimalSeparator, ShortDateFormat and others like in the code below. To a complete list of these variables, look at Currency and date/time formatting variables in Delphi Help.

We can use the Windows API function GetDriveType() to test if the drive is a CD-ROM drive then use the Windows API function GetVolumeInformation() to test if the VolumeName is 'Audio CD'.

We can use the Windows API function GetDriveType() to test if the drive is a CD-ROM drive then use the Windows API function GetVolumeInformation() to test if the VolumeName is 'Audio CD'.

02 December, 2012   

Delphi code example for HTML color to Delphi TColor

10 March, 2012   

Example Delphi code for Copying a screen

You can use a url shortener with Twitter such as tinyurl.com

As the most important building block of any Delphi application, the TForm object is most of the times used as is. Delphi's TForm object provides enough properties and events to help you do (and control) whatever needed with it. Sometimes you'll find out that a few events or properties are missing... Try creating a simple form application. Now...

16 January, 2013   

Example for adding items into combo by using Win32 API. Written by Nir Sofer

08 May, 2012   

Here shown an example for how to clone a Delphi Form

'The following code snippet displays the "Shut Down Windows" dialog. 'Is uses undocumented API function in shell32.dll

15 June, 2013   

Example shows here How to Clone a Delphi Form. Note: when you create a new clone from an existing form, the clone's OnCreate will not execute.

24 August, 2011   

When you are writing dynamic link libraries and need to control the loading and unloading of a DLL, or if you want to initialize your DLL when it is loaded, you can have a function called DllMain do your initialization. Windows calls the DllMain function of a DLL in four instances: 1) When a process attaches the DLL 2) When a thread attaches...

28 March, 2011   

When you are writing dynamic link libraries and need to control the loading and unloading of a DLL, or if you want to initialize your DLL when it is loaded, you can have a function called DllMain do your initialization. Windows calls the DllMain function of a DLL in four instances: 1) When a process attaches the DLL 2) When a thread attaches...

25 January, 2012   

Delphi Code example how to Cut, Copy and Paste

The pyperl dist provide an interface to the Perl DBI (dbi.py). This allow direct access to all the perl supported databases from python. Full documentation of the API from 'perldoc DBI' or the ORA "Programming the Perl DBI" book, by A. Descartes and T. Bunce.

12 April, 2012   

Delphi code example - force the input in a TEdit

28 March, 2013   

Delphi code - Is running in terminal server

06 February, 2013   

Delphi code for Hexadecimal to Integer

Here's a simple trick to execute a Delphi object's method by name: