The Other Side Of Delphi
This was a UK BUG MasterClass
held on 19th February and 23rd October, 1997 in Hammersmith, England.
Click here for the files that
accompany this seminar.
10:00 a.m. Introduction
Looking Through Windows
This section will focus on the Windows API. It will begin with
an overview of attempting to tackle the Windows API from the
perspective of a Delphi programmer unfamiliar with it, or
scared by it.
Sending Messages
Here we investigate the message-based model of Windows and
examine the approaches available in the API and natively in
Delphi for sending messages around the system.
- SendMessage
- PostMessage
- Perform
Receiving Messages
The tables are turned here and we look into the mechanisms
in place for receive messages for custom processing:
- Message handlers
- Window procedure methods
Non-standard VCL messages and their
raîson d'être:
- Component notifications for modifying normal Windows
notification message behaviour
- Component messages for VCL custom mechanics
The special case of application window messages, exemplified
by enabling a TScrollBar to correctly react to system user
interface changes.
11:30-11:45 a.m. Break
Launching Applications
Delphi does not support launching other applications with
any cosy VCL routines. It is not necessarily obvious how to
deal with the various APIs that help you out so we will look
at them here.
Win16 approaches to launching applications:
- LoadModule
- WinExec
- ShellExecute
Win32 preferred approaches:
- CreateProcess
- ShellExecuteEx
Waiting For Programs To Terminate
When you launch an application, you sometimes need to be
notified when it finishes. This is quite easy in Win32,
although there are a few choices to make for smooth
operation.
1:00-2:00 p.m. Lunch
Ensuring Only A Single Instance Of Your App
This explores a suitable approach to ensuring an application
can only have one instance executing at any one time:
Once you stop a second instance being executed, you need to
bring the first instance back to the foreground. We look for
a system that works in Delphi applications.
Sharing Data Between Processes
In Win32, applications are resident in separate address
spaces and so data cannot be readily exchanged. There are
numerous available operating system mechanisms to help. We
will look at some of them in this section:
- Disk-based files
- DDE
- Automation
- wm_CopyData message
- Memory mapped files
- Named pipes
- Anonymous pipes
- Mailslots
- Sockets
4:00-4:15 p.m. Break
The Windows Registration Database
Accessing the Windows registry is a necessity for many
applications now that INI files are passé. Delphi has full
support implemented in two VCL objects.
- RegEdit
- TRegIniFile
- TRegistry
The Windows 95/NT 4 Task Bar
In this part we look at how to put a task bar application
together in Delphi, and also how to ensure it gets loaded
when Windows starts.
Run-Time Type Information (RTTI)
What is it? Why is it? What can it do for you? Nuff said
Organised Filing
This section will be included if time permits.
Sometimes a database table is over the top and you just want
to store information in a normal disk file. Delphi has
complete support for this, but not everyone can find it. We
will browse through the support for:
- Text files
- Binary files
- File sharing
- File streams