Apparently you need to merge the two suggestions on the table. First, since
Idle fires when your message queue is exhausted, then you should hook that
because it identifies the moment immediately following all user input having
been processed... In the idle event, reset your timer so that it restarts. If
your
timer fires an event, then you can assume the user has been idle for some
period of time.
You have to be careful with this, since exhausting the message queue is
required. You can hook into an LRO or long running operation that allows
your timer to expire. Another option is to hook up a message filter and
examine messages as they come through. This allows you to stop the timer
when you see an operation getting ready to start, followed by starting it
again when the idle event hits.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog:
http://weblogs.asp.net/justin_rogers
"ShaneB" <stormfire1@yahoo.com> wrote in message
news:unoChr3wEHA.3976@TK2MSFTNGP09.phx.gbl...[color=blue]
> This is normal behaviour for the Application.Idle event. As soon as the
> application's message queue is empty, the event is fired. This means that
> after each mouse movement, timer event, keypress, etc...you get this event.
> That's because the message queue got a message in it, processed it, and now it
> is empty again. Remember, most applications spend 99% of their time in an
> idle state...waiting on us. You will get tons of these messages during the
> life of your application
>
> What exactly are you trying to do at idle?
>
> ShaneB
>
> "Frank Rizzo" <nospam@nospam.com> wrote in message
> news:eT6tX81wEHA.3808@TK2MSFTNGP15.phx.gbl...[color=green]
>> ShaneB wrote:[color=darkred]
>>> How are you coming to the conclusion that it is firing too much?[/color]
>>
>> I write to the log everytime it fires. So everytime, I move a mouse or use a
>> keyboard or a timer event fires, the Idle event goes off. I could live with
>> it, however, I have a bunch of timers in the application.
>>
>>[color=darkred]
>>>
>>> ShaneB
>>>
>>> "Frank Rizzo" <nospam@nospam.com> wrote in message
>>> news:%23IM%23i80wEHA.3840@tk2msftngp13.phx.gbl...
>>>
>>>>cody wrote:
>>>>
>>>>>Use static event Application.Idle
>>>>
>>>>I tried, but it seems to fire all the time (even when a timer event is
>>>>processed) and the arguments are empty.
>>>
>>>[/color][/color]
>[/color]