[icq-devel] Input event, was(no subject)



ggr ggr at bak.rr.com
Fri Jan 3 22:41:32 CET 2003


1/2/2003 2:46:02 PM, Remy Lebeau <gambit47 at yahoo.com> wrote:


Turns out that GetLastInputInfo is the way to go, from it you get the number of ticks since last input event (for any input in windows , keyboard, mouse, form any app). With a quick call to GetTickCount in a timer that fires once a 
minute it is easy to set the AutoAway.

Here's my code:

  Lii.cbSize := SizeOf(Lii);
  If GetLastInputInfo(Lii) then Begin
    If (GetTickCount - Lii.dwTime) > (fAutoAwayCnt * 60000) Then
      ChangeMyStatus(S_AWAY);


Thanks for the help, it pointed me in the right direction.

Gene

>You will probably need a global WH_MOUSE hook via the
>Win32 API function SetWindowsHookEx() implemented
>inside a DLL.
>
>The simplier alternative would be to simply call
>GetCursorPos() in a loop or separate thread and track
>when its current position changes.
>
>
>Gambit
>
>--- ggr <ggr at bak.rr.com> wrote:
>
>> How do I tell if someone moves the mouse (under
>> winNT/XP) while my program does not have focus?
>> 
>> I need to implement the auto away, but the
>> SetMouseCapture does not work the same in
>> winNT/XP as Win32.
>
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
>http://mailplus.yahoo.com
>-------------------------------------------------
>icq-devel - The forum for ICQ protocol discussion
>For unsubscribe and other mailing list info, see:
>http://www.d.kth.se/~d95-mih/icq/icq-devel/
>
>






More information about the icq-devel mailing list