There is no way to find out (from msdn ):
The hook procedure should process the message in less time than the data record specified in the LowLevelHooksTimeout value in the following registry key: HKEY_CURRENT_USER \ Control Panel \ Desktop
If the hook procedure ends, the system passes the message to the next hook. However, in Windows 7 and later, it is deleted without a call. It does not exist for the application to know if the hook is being removed.
One way you can get around this is to keep the timestamp of the last message received and use a background timer to add a new hook some time after the previous message.
In addition, to minimize this, your hook processing method should only collect the minimum required information and leave the actual data processing in a different thread.
source share