News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Keylogging... Extended :)

Started by htek, January 09, 2005, 01:06:22 PM

Previous topic - Next topic

htek

Hmm... now i suppose this is a bit of a unique request... BUT..

say my process doesn't have it's own window, or it's invisible. now what i want to acheive is that whenever i type something like "fuck", it'll replace it with "fsck" or something to that effect - and the words can't be of fixed length either [i may want to replace longer or shorter words]

i was thinking of buffers to store the last few characthers typed and work that way - any suggestions or ideas?

thanks,


'tek

hutch--

I doubt you can do it without at least partial word recognition and that will have to be done on the fly if I understand your posting. What you have to design is the keyboard handling process where you can read the current output and do work replacements when you match a word you want changed.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

sluggy

Or subclass all edit controls, and as soon as any word separating character is typed you can scan the word just typed and change it if necessary.

htek

hmm.. subclassing all edit controls. joy. considering this is to be a system-wide hook. so say i take what hutch mentioned, like on-the-fly partial word recognition [which i T.H.I.N.K would be closest to my purposes... ], apart from sending VK_DELETE, how else could i "take back" a word and replace it with my own?

thanks,


'tek

Tedd

Checking after whitespace/punctuation/newline would be okay, but could easily be defeated by typing "fck" and then moving back and inserting the offended vowel ;)

If you're subclassing, then you'd be able to access the whole contents. Also, you'd know when and which characters are being modified, so you could check only those. Although this doesn't stop words that were already there (for a loaded file) but you could just check the whole text once on load.
Note though, if you subclass edit controls, this doesn't affect other (custom) 'text-input' controls; I'm not sure to what extent this applies to already subclass/superclassed edit controls. (And you might also want to consider RichEdit controls.)
No snowflake in an avalanche feels responsible.