Morten Brendefu 28 Light Poster

Hmm.. it looks like WinRar or a RAR file can not be added.
I am trying to add Zip file now :-)

Enjoy.

DelphiGuy commented: Thanks, some very useful code in that package +1
Morten Brendefu 28 Light Poster

That link was indeed a nice one for my personal purposes.:*

However.
As it goes, the hook is inserted in some Windows API.
I am pretty sure that some viruses can access the keyboard directly via hardware.
All in all, Windows API does just that too, and if you ask a windows API for keyboard events, then this is controlled by this API first. In other words, your program will not be the first to read the keyboard.

Without actually knowing 100% sure, I think the method to use is best done via Assembler code and redirecting Keyboard scan interrupt to your own assembler routines for then to direct the flow of control back to original address of original interrupt.

Back in the old days, before I fell in love with Turbo Pascal, I wrote some simple ASM code on the commodore 64 that redirected interrupts.
A much simpler computer with easier memory handling, but the basics of computers has not changed. Even the most advanced and sophisticated computer today depends on the same basic stuff of interrupts for many actions.
With the layer of Windows on top, it is not easy to find the right information on how to be allowed to change such an interrupt after Windows have started up.

My best suggestion is to write an assembler program, A kind of Keyboard Driver, one that loads into computer memory BEFORE windows starts up.
Windows Keyboard API should …

Morten Brendefu 28 Light Poster

To pass parameters as a variant record works to a certain degree.
The procedure VarType(Variant) returns Double on TDate and TTime though.
In a way, it does make sense because TDate and TTime is actually a Double.
It is just strange that the variant holds VarDate as an identifier, but can not identify it :-)

Similarily I have problems when passing a STRING as a parameter. VarType(Name) does not recognize that Name is a variable of type STRING. SHORTSTRING however is no problem.

There seem to be a few caveeats with parameters as variant because it does not necessarily recognize the actual type given in the array of parameters.
...
I moved on to trying out ARRAY OF CONST as a parameter.
This seem to work better.
Strings are recognized. Double is recognized as Extended. but then again. I think this is where I will continue my development. I need strings to be recognized, but a double to be extended, that is just a minor triviality that can be solved easily in my routines as I know which types to be expected in the array of parameters.

Many thanks for pointing me in the somewhat right direction :-)

pritaeas commented: Thanks for the update. +14
Morten Brendefu 28 Light Poster

As a last comment, I would like to add that above link gave me the input needed in order to solve my problem successfully.

Instead of trying to make SQL queries involving a column name that may not exist and by that create an error of which creates the need of exception handling, I now simply list the tables and column names and search via Delphi.
If the column is not found, then I can add it via SQL and that will not create errors and the need of exception handling.
All done with Delphi/TurboPascal logic.

Indeed a very useful link as it gives ideas of what other things we can do too.

pritaeas commented: Thanks for sharing +13