active window of previous application


I want to know the handle of the active window of the application that was
active before the current program was activated.
I want to use it to send to it a few keyboard-strokes.
Does anyone know how to find out this window-handle?
I am working currently in Delphi-3, but code for Delphi-1 will also be fine.

Anton Bil,
(visit my download-page: )