When does Win7 remove a hook from the chain?

Nov 23, 2011 at 3:01 PM

In another thread you said "Windows 7 x64 will remove a hook from the chain (i.e. destroy the handle) if hook processing takes too long."

My question are:

- What is the time period?

- How does an application determine if this has happened?

The reason I ask is I see some users experiencing a loss of events on Win 7 x64 after between 10 to 60 minutes apparently without any sign of trouble.  I'm wondering if in some cases I'm taking too long processing the event and perhaps this is why events stop.  WHen they stop I loose both keyboard and mouse events that I've been monitoring.

Jan 24, 2013 at 11:28 AM


I might be experiencing a similar problem. Did you find out anything more about this?

Jan 24, 2013 at 11:39 AM

Related: http://stackoverflow.com/questions/2655278/what-can-cause-windows-to-unhook-a-low-level-global-keyboard-hook

Under Remarks on msdn: http://msdn.microsoft.com/en-us/library/ms644985.aspx

Jan 24, 2013 at 1:25 PM

The accepted answer on msdn might be the cleanest approach?