| NO GUI Delphi applications | ||||||||||||||||||||
| Page 1: Setting up a console mode application with Delphi. | ||||||||||||||||||||
Console applications are pure 32-bit Windows programs that run without a graphical interface. When a console application is started, Windows creates a text-mode console window through which the user can interact with the application. These applications typically don't require much user input. All the information a console application needs can be provided through command line parameters. New ... Console application
While you could create console mode applications in all 32-bit versions of Delphi, it's not an obvious process. Let's see what you need to do in Delphi versions <=4 to create an "empty" console project. When you start Delphi, a new project with one empty form is created by default. You have to remove this form (a GUI element) and tell Delphi that you want a console mode app. This is what you should do: 0. Select "File | New Application" You are now left with a very small program which looks much like a Turbo Pascal program which, if you compile it will produce a very small EXE. Note that a Delphi console program is not a DOS program because it is able to call Windows API functions and also use its own resources. No matter how you have created a skeleton for a console application your editor should look like:
This is nothing more than a "standard" Delphi project file, the one with the .dpr extension. . The program keyword identifies this unit as a program's main source unit. When we run a project file from the IDE, Delphi uses the name of the Project file for the name of the EXE file that it creates - Delphi gives the project a default name until you save the project with a more meaningful name. Ok. Now when you know how a console application looks like it's time for a real example. Let's create a simple game! Next page > A console mode Delphi example; Cosole applications: Tips & Tricks > Page 1, 2 |
||||||||||||||||||||

If you have a Delphi version newer than 4, than all you have to do is to use the Console Application Wizard. Delphi 5 introduced the console application wizard. You can reach it by pointing to File|New, this opens up a New Items dialog - in the New page select the Console Application. Note that in Delphi 6 the icon that represents a console application looks different. Double click the icon and the wizard will setup a Delphi project ready to be compiled as a console application.