Hi, your program constantly override a crucial windows setting about the mouse hook time out.
The registry key is HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout
You set a value of 10000 every time your program start.
This mean, instead of waiting 300ms for a hangeg low level hook, windows now wait 10 secondes before it unhook it .... this is an eternity.
Can you please stop overwriting this registry key? Or put an option.
The proper way of adressing the unhook "problem" in windows 7 is to have a watch dog, that will auto restart the hook once it think the hook is not working anymore, you can unhook and rehook as many time as you want.
Francis