WH_JOURNALPLAYBACK and WH_JOURNALRECORD hooks

Y

yaktipper

WH_JOURNALPLAYBACK and WH_JOURNALRECORD

These hooks are difficult to get working in C#, but after much piecing
together of various code snippets from different language examples
across the Net, I have working code.

If anyone is interested in the code, please email me. It's not
perfect, but it does work.

I had a need to send keys and mouse events to an app that checked the
asynchkeystate (system level key state), which SendInput, SendKeys,
keybd_event, and mouse_event don't handle. The playback hook sets the
event state at a system level, not the thread level like these other
methods.

Some of the resources I used:

1) An almost complete JournalPlayback example, in Delphi. This
doesn't have the scancode shifted into the high byte of paramL, which
is an error that will affect some apps, but will work for most apps.
http://safariexamples.informit.com/0672321157/Ebooks/D5DG/chapter13.pdf

2) C# examples, see the hooks section near the bottom.
http://www.codeproject.com/dll/

3) MSDN -- C# class, wrapper for hooks and tech doc.
http://msdn.microsoft.com/msdnmag/issues/02/10/cuttingedge/
http://msdn.microsoft.com/library/d...sUserInterface/Windowing/Hooks/AboutHooks.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top