Determining an active application

C

Charles Tam

From an application form, how do I determine whether the application is
active, i.e. running as a foreground task insteads of a background task?
 
M

Michel Walsh

Hi,


In Access? Screen.ActiveForm returns the FORM (object) having the
Focus.



Hoping it may help,
Vanderghast, Access MVP
 
C

Charles Tam

Thanks for your reply.
Yes, I would like the Access form to determine whether it is the active
window (i.e. it is running as a foreground task), and whether it is the
inactive window (i.e. it is running as a background task). Note that, the
application has only one form.
 
M

Michel Walsh

Hi,


GetForegroundWindow (Declare Function GetForegroundWindow Lib "user32" ()
As Long) returns the handle of the window with which interacts the user.



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top