in reply to Windows 98: track the current user's idle time

Well... I've been searching a lot now, using and modifying the search terms offered. I've read complete threads on forums, many MSDN articles but I just don't see what I should do. The one article on Code Project doesn't tell which DLL to import from.
Don't get me wrong, I of course appreciate your help. The only thing is... it doesn't help :)
Any more suggestions, or should I just give up? (Long time ago I did that :D)
  • Comment on Re: Windows 98: track the current user's idle time

Replies are listed 'Best First'.
Re: Re: Windows 98: track the current user's idle time
by flyingmoose (Priest) on Mar 24, 2004 at 00:47 UTC
    Reading that again, it does look messy. There are a lot of functions to import and some structures are involved as well! Ugh! It first looked like you want SetWindowsHookEx in User32.lib according to the bottom of the MSDN page if you were going by the CodeProject article. MSDN usually lists header files and libraries at the bottom of these pages, along with the applicable versions of Windows.

    I will say, from reading the article again, this is implementing a timer and using some callbacks, which is going to get really ugly FAST. I'm sorry, but my help now isn't helping any more either.

    Did I tell you how much I hated Microsoft API's?

    We know this is possible (at least using undocumented API's) since Windows screensavers do this. Can I ask why you are trying to get this info? It might be possible to do something sneaky like (DARE I SAY IT?) find some Windows screensaver source on the internet, and install your program as a screensaver (using pure C++ code) embedding a Perl interpreter when neccessary? Do you enjoy pain?

    The last bit of brainstorming I have is to just check the mouse position and snoop on the keyboard, but I have no idea exactly how that is possible either without a huge performance drain. It _really_ sounds like you want to register for callbacks or to find a way to query this info -- but where?

      We know this is possible (at least using undocumented API's) since Windows screensavers do this.
      No they don't. Screensavers are launched by the system. So it's the system that keeps track of user activity.

      And they just check their Windows messages, just like any normal Windows app, to detect if there's any mouse or keyboard activity, to know when to exit.

        No they don't. Screensavers are launched by the system. So it's the system that keeps track of user activity.

        I know this.... The screensaver doesn't know idle time, but the system that LAUNCHES the screensavers knows the idle time. Hence if you make your application into a screensaver (oh, the pain), you could be launched at a certain point in time... but man, that would be quite annoying work :)