Active Application?

q1w2e3r4t7

Freshman
Joined
Nov 15, 2005
Messages
30
Hi,

trying to create a program to log what programs i have open.

i'd like to be able to get a list of all open applications, however most importantly, the active application.

this way i can log what applications i use, and what % of the day i use each.

does anyone know the code to get this information?


thanks
 
Finally found the code, however i have to use a time to keep checking ...

is there anyway to hook onto the change active window process ? rather than continuously checking?

ta.
 
Finally found the code, however i have to use a time to keep checking ...

If you find a solution to a question you have posted, then please post the solution for others to see. That way everyone visiting this forum can benefit from it.
 
Finally found the code, however i have to use a time to keep checking ...

is there anyway to hook onto the change active window process ? rather than continuously checking?

ta.


Hi, I guess if you don't want to use a VB timer try using the Windows API Timer. The API is SetTimer/KillTimer. Just create a callback to the method you want fired at the end of the specified interval. It won't really use any of your applications resources and allows Windows to deal with the timing.

I have a example on how to access and program the Windows timer at my website under the VB.NET - Examples page. www.vbcodesource.com . Maybe this will help you? :)

Edit: I also wanted to mention that you can use the API call:

Code:
Private Declare Function GetActiveWindow Lib "user32" () As Int32

- To get the Top Level Window.



Jason
 
Last edited:
Back
Top