active window of previous application

Hello,

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,
email:a...@mail.HZeeland.nl
(visit my download-page:
http://www.HZeeland.nl/~abil/download/download.html )