Hi guys, I need to know if there is a way to determine the active application. What I mean is, how can I tell if my application has focus ???

I wanna have a global help key for my application and I am using API function GetAsyncKeystate to trap when the user press the F1 key, the problem is, even though another application has the focus my program responds to that keystroke and my help for my app is shown.

The app contains an MDI form and 100+ other forms(mdi-childs and standard forms).

I am calling shellexecute to display a .pdf-helpfile whenever the user press the F1 key.

So basicly, I want to Call a function or sub that displays my .pdf file when a user press the F1 key, regardless of which form that has got the focus, but NOT if another application has got the focus. ANY help would be appreciated.....

thank you in advance