By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,077 Members | 1,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,077 IT Pros & Developers. It's quick & easy.

Detective work on Application.Idle event.

P: n/a
Hello,

I have a dozen 3rd party controls on my form. I am trying to detect
when the application is idle. But even after the mouse and the keyboard
are no longer moving, something is still triggering the Application.Idle
event. There are no Timers on the form (i removed them all after
realizing that WM_TIMER message will cause the event to fire). Anyway,
how can I figure out which control is triggering the application_idle event?

Thanks.
Nov 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Frank Rizzo" <no****@nospam.com> wrote in message
news:OP**************@TK2MSFTNGP09.phx.gbl...
Hello,

I have a dozen 3rd party controls on my form. I am trying to detect when
the application is idle. But even after the mouse and the keyboard are no
longer moving, something is still triggering the Application.Idle event.
There are no Timers on the form (i removed them all after realizing that
WM_TIMER message will cause the event to fire). Anyway, how can I figure
out which control is triggering the application_idle event?
The Applicatiob.Idle event is not sent by any control, but is sent by
Windows when your message queue is empty. You can then use that event to
provide background processing.
Thanks.

Nov 17 '05 #2

P: n/a

"Frank Rizzo" <no****@nospam.com> wrote in message
news:OP**************@TK2MSFTNGP09.phx.gbl...
Hello,

I have a dozen 3rd party controls on my form. I am trying to detect when
the application is idle. But even after the mouse and the keyboard are no
longer moving, something is still triggering the Application.Idle event.
There are no Timers on the form (i removed them all after realizing that
WM_TIMER message will cause the event to fire). Anyway, how can I figure
out which control is triggering the application_idle event?

Thanks.


Try Spy++ or this Winspy available for download from
http://www.windows-spy.com/ and watch the messages posted/sent to your
visible/hidden windows.

Willy.
Nov 17 '05 #3

P: n/a
"Frank Rizzo" <no****@nospam.com> wrote in message
news:OP**************@TK2MSFTNGP09.phx.gbl...
Hello,

I have a dozen 3rd party controls on my form. I am trying to detect when
the application is idle. But even after the mouse and the keyboard are no
longer moving, something is still triggering the Application.Idle event.
There are no Timers on the form (i removed them all after realizing that
WM_TIMER message will cause the event to fire). Anyway, how can I figure
out which control is triggering the application_idle event?


Take a look at the API call GetLastInputInfo for idle detection - it sounds
like what you're after.

Marc
Nov 17 '05 #4

P: n/a
"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:eN**************@TK2MSFTNGP10.phx.gbl...

"Frank Rizzo" <no****@nospam.com> wrote in message
news:OP**************@TK2MSFTNGP09.phx.gbl...
Hello,

I have a dozen 3rd party controls on my form. I am trying to detect when
the application is idle. But even after the mouse and the keyboard are
no longer moving, something is still triggering the Application.Idle
event. There are no Timers on the form (i removed them all after
realizing that WM_TIMER message will cause the event to fire). Anyway,
how can I figure out which control is triggering the application_idle
event?

Thanks.


Try Spy++ or this Winspy available for download from
http://www.windows-spy.com/ and watch the messages posted/sent to your
visible/hidden windows.


The Application.Idle event is raised when the IMsoComponent.FDoIdle method
is called on ThreadContext. I'm not sue what does the calling, but I suspect
it's the runtime, not window messages.
Nov 17 '05 #5

P: n/a

"Sean Hederman" <em*******@codingsanity.blogspot.com> wrote in message
news:d2**********@ctb-nnrp2.saix.net...
"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:eN**************@TK2MSFTNGP10.phx.gbl...

"Frank Rizzo" <no****@nospam.com> wrote in message
news:OP**************@TK2MSFTNGP09.phx.gbl...
Hello,

I have a dozen 3rd party controls on my form. I am trying to detect
when the application is idle. But even after the mouse and the keyboard
are no longer moving, something is still triggering the Application.Idle
event. There are no Timers on the form (i removed them all after
realizing that WM_TIMER message will cause the event to fire). Anyway,
how can I figure out which control is triggering the application_idle
event?

Thanks.


Try Spy++ or this Winspy available for download from
http://www.windows-spy.com/ and watch the messages posted/sent to your
visible/hidden windows.


The Application.Idle event is raised when the IMsoComponent.FDoIdle method
is called on ThreadContext. I'm not sue what does the calling, but I
suspect it's the runtime, not window messages.


I know, OP's description is misleading - <something is still triggering the
Application.Idle >
It should read - something is preventing the Application.Event to be fired -
, simply because some window messages are still arriving on the message
queue(s). Using something like Spy++ makes it possible to trace these
messages and find-out their source.

Willy.

Nov 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.