Results 1 to 4 of 4

Thread: Catching a change in Application

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Posts
    82

    Exclamation

    Is there a way for me to catch that my application is no longer the active application?

  2. #2
    Addicted Member
    Join Date
    Feb 2001
    Location
    Upstate NY
    Posts
    210
    Code:
    Declare Function GetActiveWindow Lib "user32" Alias "GetActiveWindow" () As Long
    
     If GetActiveWindow <> Form1.hWnd then 
     'what happens if your application isn't the active one
     end if
    \
    you can change the form1 to whatever form is your main form
    < o >

  3. #3
    Megatron
    Guest
    Make sure you place that code in a Timer, otherwsie the code with not execute.

  4. #4
    Matthew Gates
    Guest
    You can also subclass the form to detect when your form has lost focus, take a look at this post for an example.

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