CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2001
    Location
    charlotte,nc
    Posts
    84

    App Detection of Receive or Lose Focus

    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

    Elizabeth

  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: App Detection of Receive or Lose Focus

    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
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured