Delphi

1 / 5

How To Show The Print Dialog And Print Text Files

1,299

The RichEdit component in Delphi is a powerful visual control that allows you to create and display formatted text within your applications.It provides features like font styling,colors,indentation,bullet points,and even embedded images,enabling you to bui...

Delphi Pointer Types

22,113

Sometimes,you may confuse the name of the pointer type in delphi,because of the difference with C / C++.It's really make us confusion.Actually usage rule is also different,so I always forget how to use delphi pointer easily.Anyway below table is useful whe...

How to launch the external application in Delphi ?

1,074

You can launch application on windows by ShellExecute function.Following is the simple example to launch application. In case of running DOS command application such as batch file and you want not to display user,put SW_HIDE in the function option as follo...

How to use TTF Font Without Installing

1,123

Here's how to use a TTF (true type font) in your Delphi application without having to install it in Windows:1.In the OnCreate event for the main form in your Delphi application call the AddFontResource API function.The AddFontResource function adds the fon...

Creating thumbnail images

866

Suppose you have a Web Form where uploading of files is enabled,using the HtmlInputFile HTML control,and a user is uploading an image.If you accept only images of a specified size,you might need to shrink the uploaded image / create a thumnail.Here's how...

How to read/wrtie INI file in Delphi ?

3,125

Delphi provides useful function to access INI file.With TIniFile class,you can read and write easily.Below is the simple example writing INI files. And below is the example to read data from INI file. As you can see above,you can read and write data with m...

When subject is crashing in TIdSMTP VCL

622

In case of using Delphi 2009 with Indy 10,when I try to send an email with TIdSMTP,on the received email this text arrived as questions marks '?????'.This is caused by TIdSMTP VCL bug.You can fix it by upgrading Indy10 at ftp: / / indy.fulgan.com download...

How to get parameter string ?

1,251

Just like main(argv,argc) in C,Delphi also has the similar variables to get parameter string coming from command line.Following is the simple example to display parameter list by showmessage function. As you can see above,you can know the total number of p...

Convert a mapped drive to a full UNC path

838

Universal / Uniform Naming Convention.A UNC path describes the location of a volume,directory,or file.The format for a UNC path is \servervolumedirectoryfile and is not case-sensitive.For example:Rather than describe the location of a file or directory by ...

Get File 'Last Modified' attribute

473

This function is useful to get file attribute.Usage: .In addition,below function must be included in order to use above function.

Browse for Computers, Folders, Files and Printers

575

By using the SHBrowseForFolder Windows API function and Delphi we can invoke a Windows system dialog used to browse for files and folders on users hard drive as well as network computers and printers. First,let's look at what SHBrowseForFolder needs.Here's...

Disable Mouse and Keyboard from Delphi Code

806

The BlockInput API function blocks keyboard and mouse input events from reaching applications.Place a Button (name: "Button1") on a form (name: "Form1") and use this code for the button's OnClick event handler.Once you click the button your mouse and keybo...

How can I hide the caption bar on a form?

1,404

To hide the caption bar you need to override on of the default form methods CreateParams (this also exists for other objects).The CreateParams method initializes a window-creation parameter record passed in the Params parameter (ref:Delphi Help).Go to the ...

How Do I Remove The Application Icon From The Taskbar?

1,104

To remove the icon from the taskbar,you need to call a Windows API call:Delphi makes it very easy to use this command.All you need to do is supply the Application.handle and SW_HIDE to remove the icon from the taskbar. To display the icon on the taskbar us...

How To Force The Correct Decimal Separator

1,789

Some English speaking countries use the "point" as decimal separator,while the rest of the world is using the "comma".How can you make sure that the user will press the correct key when entering a number with a decimal fraction? With the code in this examp...

How can I modify aliases programmatically ?

1,318

Take a look at TDatabase.You can set the Alias property to the physical path at runtime.InstallShield Express,which ships with D2 and D3 (and greater)lets you define new aliases with paths relative to the directory where the user installs the program.The c...

Setting TQuery SQL Statement

12,165

This source code sets the SQL String in Query1.As it fits on one line we just use SQL[0].The SQL statement finds all the fields from the Article table where the user_id field is equal to a varaible Text value dbtUser.Text.A better way would be to use Param...