When does Win7 remove a hook from the chain?

Nov 23, 2011 at 2: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 10:28 AM

Interesting.

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

Jan 24, 2013 at 10: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 12:25 PM

The accepted answer on msdn might be the cleanest approach?

http://social.msdn.microsoft.com/Forums/en-US/windowscompatibility/thread/f6032ca1-31b8-4ad5-be39-f78dd29952da