active windows timer

To keep track of my time online, I would like to make a C program in Visual Studio Express for Windows 8.1.
It would be a timer that would run when the foreground window is not an internet application such as Firefox. And the timer would stop when the foreground window is Firefox, IE, etc.
There's a function GetForegroundWindow that I would probably be using.
Is there some program that could be adapted to do what I want?
Thanks
Well, that was easier than I expected.
Last edited on
Topic archived. No new replies allowed.