How do I record keystrokes when keyboard logging is not available?

After installing a C ++ application initially using the MS logging hook (WH_JOURNALRECORD), we find that it doesn't work in Vista unless started by an administrator with uiAccess enabled. MSDN question - catching logs in Vista?

We want to record the key sequence from the user in a friendly manner that will repeat at a later date. User clicks record button, dialog pops up with stop button and recorded keys.

One of the advantages of using the hook for logging was that you only had keystrokes doing something. Holding down shift did not report 100 toggle keys, but reported usage when you hit a letter. Another benefit was that you can set focus to an area outside of the application, tell another application window, and record the action when user interacts.

How to make the keyboard capture part of an existing application as a separate executable that runs with uiAccess, I am looking for other ideas on how to record keystrokes that work with windows for 2K, 2K3, 2K8, XP, Vista.

Edit: I know there is a security issue just logging something, obviously if you could do such a thing without notifying users you have your typical hack keystroke logger. Soooooo .....

Is there a way to make journalism work, for that user and their applications, to work at the same level (or lower) and capture keystrokes? if you have a vista security popup, you are sure the dialog will be complete, but the process cannot be flagged with uiAccess (otherwise it will not interact correctly with the rest of the system) and it will be launched 98% of the time by non-promoted users administrator.

0


source to share


2 answers


We worked on the main issues using SetWindowsHook instead.

const HMODULE hDLL = ::GetModuleHandle(DLL_NAME);
::SetWindowsHookEx(WH_KEYBOARD_LL, myKeyboardProcCallback, hDLL, 0);

      



The callback should now manage the keystroke information and translate it into the sequences it uses - that is, not record multiple ctrl keystrokes when pressing the ctrl + key.

0


source


Even if you could, you would probably find Microsoft fixing this bug in the next patch. The change in Vista was deliberate and there is a clear way (uiAccess == true) to do what you want.



+1


source







All Articles