how to set journal hook?
-
hello everyone, I want to write a program to record the event of keyboard, sb advise me to use journal hook. //g_hLogHook is a global hook if (g_hLogHook==NULL) g_hLogHook=SetWindowsHookEx(WH_JOURNALRECORD, (HOOKPROC)JournalLogProc,AfxGetInstanceHandle(),0); It will not return until I press Ctrl-Alt-Del to cancel the hook. It then has a valid handle for g_hLogHook.I'm at a loss as to why this hangs? can anyone give me a answer? ps:msdn Unlike most other global hook procedures, the JournalRecordProc and JournalPlaybackProc hook procedures are always called in the context of the thread that set the hook. now,now that JournalProc is always called in the context of the thread that set the hook,why all the threads on the desktop are hanging before I press Ctrl-Alt-Del ? thanks for your answer
-
hello everyone, I want to write a program to record the event of keyboard, sb advise me to use journal hook. //g_hLogHook is a global hook if (g_hLogHook==NULL) g_hLogHook=SetWindowsHookEx(WH_JOURNALRECORD, (HOOKPROC)JournalLogProc,AfxGetInstanceHandle(),0); It will not return until I press Ctrl-Alt-Del to cancel the hook. It then has a valid handle for g_hLogHook.I'm at a loss as to why this hangs? can anyone give me a answer? ps:msdn Unlike most other global hook procedures, the JournalRecordProc and JournalPlaybackProc hook procedures are always called in the context of the thread that set the hook. now,now that JournalProc is always called in the context of the thread that set the hook,why all the threads on the desktop are hanging before I press Ctrl-Alt-Del ? thanks for your answer
Here is an article on Journal hooks http://www.codeproject.com/KB/applications/winmacro.aspx[^]
It is a crappy thing, but it's life -^ Carlo Pallini