The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: htek on January 09, 2005, 01:06:22 PM

Title: Keylogging... Extended :)
Post by: htek on January 09, 2005, 01:06:22 PM
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
Title: Re: Keylogging... Extended :)
Post by: hutch-- on January 09, 2005, 03:02:31 PM
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.
Title: Re: Keylogging... Extended :)
Post by: sluggy on January 10, 2005, 12:49:31 PM
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.
Title: Re: Keylogging... Extended :)
Post by: htek on January 11, 2005, 11:13:29 AM
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
Title: Re: Keylogging... Extended :)
Post by: Tedd on January 11, 2005, 01:38:32 PM
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.)