Components for Delphi

by Harry Kakoulidis

Welcome to my components page. Before you browse my work, I would like to say a few words about the idea behind all of these components. I am mostly a program-writer, not a component-writer. That means that the all of the following, where not created without a specific purpose, but where a product of necessity. They were not made to dazzle up your program or to add new features. They are made only shorten the coding time of the ideas you already have, utilizing Delphi' s capabilities for object oriented programming.

HKSafeForm v1.5

37 kb

For Delphi 2,3,4,5 & BCB4. HKSafeForm is a component that you can add on any form. Just add, nothing else. After that all of the form's controls captions will be protected from editing with a hex editor. EVERYTHING with a caption property gets protected, even non Borland components. By default, if some one edits the exe, HKSafeForm will automatically terminate the program. Or if you want assign an event handler to do something else. It compares the CRC-32 result of all the captions in design-time with the corresponding result of it at runtime The test is called when the form is created.

The code adds 2.5 kb to the EXE.

FileMenuHandler v1.0

205 kb

Component for handling Recent files list and Open, Save, Save As, Exit Commands. Has a recent list (MRU) if wanted with ini saving. Will call your file handlers only when needed so you don't have to worry about changed files, loading Open/Save dialog boxes, history lists, terminating, querying user to save changes, changing the form caption, runtime parameters etc. Extremely customizable for every environment. Appends the history list to your selected MenuItem. Minimize error checking, just load, save, and make new.

If you have ever implemented a user interface with the above commands, you must have experienced the fact that it looks simple but it is pretty complicated. For example: User creates new file, makes some changes, selects Exit forgetting to Save, (Here the program should call Save, which should call Save As) and then presses Cancel in the SaveDialog box so he will cancel his/her exit from your program... Believe me, for the program to correctly handle cases like this it takes about 100 lines of code if you don't use a history list in the menu. Or what if you want to associate your program with an extension, and you have to load parameters?

With this component, you only have to write 3 input/output routines. One to create a new object (a new memo, picture, empty database, etc). One to save it to disk, and one to read it. Everything else is handled by FileMenuHandler. These events are called only when needed.

The zip includes an exe demo.

HKMessageReceiver v1.0

5 kb

HKMessageReceiver is a non visual component, that added to a form, makes it able to receive messages sent or posted at application.handle. It has an event that is called when all WM_USER messages are broadcast. This way you can give large programs polymorphism, and make and forget about forms or datamodules that do something when something has changed in your program. If the form is not open, no harm done, the message is ignored.

If you have a program that when something is done in one form or datamodule, that should be known any where in your program, I think this very simple component is necessary.

Also includes a demo. (not compiled).

HKProgressBar v1.5

170 kb

HKProgressbar is a completely different approach to long loops that you might do sometime. You set up the component and it starts your process in a different thread, so you can continue using your program if wanted. If you want, a progress bar is shown, optionally with a cancel button. This way you can implement with very little code secondary threads, that can handle a cancel from the user. Can adopt to every situation. You don't have to worry about opening and closing the progress form.

This is another heavy code-saver component. As you may see in the demo, something that would take lot' s of code to implement, can be done with a few lines, so you can focus on your task.

Source & Demo with EXE included.

THKStreams v1.7

203 kb

HKStreams is a component that enables you to easily save and load many streams into one file. The streams can be stored with LHA compression if wanted, and can also be encrypted with blowfish. THKStreams is also smart, if you load afterwards an encrypted or compressed (or both) file, it will know how to read it, and can also call your event that asks the user for a password if needed.Can also handle wrong passwords or corrupt files.

This program works by saving the streams in a file with a 10 byte header that contains information whether encryption and/or compression exists, and also a series of bytes that are used for a test if the correct password was entered, in the case of encryption (of course only those 8 bytes are known).

With this you can implement with little code the ability for users to protect their files if they want it, and also compress their data. However you will have to warn them that if they forget the password, there will be no way to regain the data.

Source and EXE demo included. Now compiles with D6.

HKSetup v1.1

45 kb

HKSetup is a template project to create self-extracting zip files. The program Unzip's the zip with internal routines in the windows temporary directory, asks for confirmation, and executes (all of these are options) a exe file. This is perfect for making Install Shield's setups into one Self-setup Exe file. These routines are NOT encapsulated in a component, nor is the forms unit loaded, so only 80kb are added to the zip file.

I hate to use InstallShield, but I found it necessary when developing BDE enabled applications. But the setup it makes usually contains more files than the original program! One option is to ZIP or to use a Zip to EXE program, but that would need a more experienced user to select a temporary directory, and the again run the Setup.

So this project solves the problem. It has analytical instruction on how to use (very easy). The main logic is the loading of the ZIP file (which you made) into the Delphi program as a resource. When run, the zip is unzipped (with routines that are in the program) into windows temporary dir, and then a program is run. All this is done in the background.

I have taken special care, using only windows api calls to implement, so that the EXE will not be 300+ kb but only 80kb (without of course the merged zip).

HKHelp v1.1

209 kb

HKHelp is a pseudo-visual component to add help to any program, without help compilers etc. When a user selects a control, a customized pop-up window opens which can contain any text, even with different bullets, fonts, sizes, colors. Can also be used parallely with HLP's. The text displayed can be edited in a program like MS-Word or from HTML and the formatting is kept the same. All the data is compiled together in the exe. Very simple to use, only 1 line of code, everything is previewed in design time. Exe demo included.

I have seen that often many programs are released without any help file. This happens because it is really a pain to create HLP files, even if you have the best help compiler (not to mension that you have to ship more files). So I made this component that combines the rich formating of HLP files with the comfort of designing in Delphi. You can tightly integrate your help system in design time with your program, previewing how it will look in Delphi. You will only need a program like MS-Word or Frontpage or any editor to create the text which will be used, that will later be combined into the exe.