Is it possible to work out what program is in use

tim.baker

New member
Joined
Nov 13, 2011
Messages
1
Programming Experience
1-3
Hi,

I am trying to build a program that monitors how other programs are being used and as part of it I need to figure out if it is possible to work out using VB code what window, program or process the user is currently using or Focused on. If anyone has any way of doing this please point me in the right direction - thank you!

Tim
 
You can use the GetForegroundWindow function from the Windows API to get the handle of the top-level window that currently has focus. A search should produce examples. You can then use that handle to determine other things, also using the Windows API.
 
Back
Top