Click to See Complete Forum and Search --> : App Detection of Receive or Lose Focus


EAK
March 28th, 2001, 02:54 PM
Is there an event or a way for my vb6 application to detect a receive focus (activate app?) and/or a lose (deactivate) app??

Thank you to all!

E

Clearcode
March 30th, 2001, 03:27 AM
Yes there is.
Suibclass the application's main window and look for the WM_ACTIVATEAPP message.
If the wParam is True, your app is gaining the focus.
If the wParam is false, your app is losing the focus.

I have written a DLL that makes this whole subclassing stuff a lot easier and it wraps this in a VB event:

public Event ActiveApplicationChanged(byval ActivatingThisApp as Boolean, byval hThread as Long, Cancel as Boolean)




Drop me a private message with an email address and I'll send it to you.

HTH,
Duncan

-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com