SetWindowsHookEx
-
Does it have any constraint in MFC, because the same code works fine when I run on win32 console. Will be grateful.
-
Does it have any constraint in MFC, because the same code works fine when I run on win32 console. Will be grateful.
-
Does it have any constraint in MFC, because the same code works fine when I run on win32 console. Will be grateful.
-
Does it have any constraint in MFC, because the same code works fine when I run on win32 console. Will be grateful.
Mohsin Munawar wrote:
Does it have any constraint in MFC
Yes. The documentation for the SetWindowsHookEx function[^] states that calling the CallNextHookEx function[^] is optional. This is not always the case for MFC windows. You need to always call the CallNextHookEx function[^] because the MFC classes may have hooks such as WH_CBT hook. Best Wishes, -David Delaune
-
Mohsin Munawar wrote:
Does it have any constraint in MFC
Yes. The documentation for the SetWindowsHookEx function[^] states that calling the CallNextHookEx function[^] is optional. This is not always the case for MFC windows. You need to always call the CallNextHookEx function[^] because the MFC classes may have hooks such as WH_CBT hook. Best Wishes, -David Delaune
it works fine for some time on MFC. I get a feeling that it gets unhooked from the OS for some reason after approx 10 notifications
-
it works fine for some time on MFC. I get a feeling that it gets unhooked from the OS for some reason after approx 10 notifications
Post some code. Not reams of code if you expect an answer, a minimal program that shows your problem. I concede that at times this is easier said than done.
Steve