Get last active window in vb 6.0


I need to get the last active window. Is there any api for finding that?
When the user focuses on my vb 6.0 application, I want to know what application was activated before that.

Thank you!

Who is Participating?
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
costinuAuthor Commented:
Thank you for your answer!
I already knew that I could use hooking.
A timer who checks at every moment the active window, will also solve the problem.

But, isn't there any other method ? Because I didn't want to use a hook , neither a timer...
If there is no other way I don't have what else to do, but to use one of these methods.
Mike TomlinsonMiddle School Assistant TeacherCommented: GetForegroundWindow() is already in your bag of tools, and you're wondering if there is a "secret" tool called GetLastForegroundWindow()?

As far as I know, no such beast exists...  =\
costinuAuthor Commented:

That is what I was looking for...
If there isn't such a beast :)) I will use what I have.
Thank you!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.