SendKeys - Windows Message {Now Resolved, but, Freaky Update}
Hey all, this will be a different question from your normal SendKeys questions, but does anyone know for sure which Windows Messages SendKeys uses? The best I can find is that it uses WM_KEYDOWN/CHAR/KEYUP.
Is this accurate?
Re: SendKeys - Windows Message
May be the SendInput API ?
Re: SendKeys - Windows Message
No, that is not what I am looking for. SendKeys uses Window Messages to put the desired text into a text field, I am sure the ones I have listed are correct. I was just wondering if anyone here had some different information.
Thanks.
Re: SendKeys - Windows Message
Just to give more information, I need this information to know whether or not it is possible to block SendKeys from placing text into the textbox of a program.
So if anybody knows if the messages are different, please let me know.
Thanks.
Re: SendKeys - Windows Message
You still want the user to be able to edit info, but just block sendkeys?
Re: SendKeys - Windows Message
That is the idea, my friend and I are testing it now. Just as an FYI I will post the results here. I fear that I am right and inthat case, will not be able to block SendKeys withing blocking keyboard input.
Re: SendKeys - Windows Message {Now Resolved}
Success! It turns out there is a slight difference between SendKeys and an actual keyboard event...
If you're actually typing, it goes WM_KEYDOWN WM_CHAR WM_KEYUP.... yet, sendkeys does those three as WM_KEYDOWN WM_KEYUP WM_CHAR
So, it can be singled out and blocked. Thanks for your help David & Prank.
Re: SendKeys - Windows Message {Now Resolved Freaky Update}
Odd, it turns out the original finding of the WM_ Messages being out of order from a normal keystroke was a one time fluke or an every now and then fluke. 99.9999% of the time the WM_ Messages are identical to a keystroke form the keyboard.
Just thought I would share.
Re: SendKeys - Windows Message {Now Resolved Freaky Update}
Quote:
Originally Posted by Spajeoly
Odd, it turns out the original finding of the WM_ Messages being out of order from a normal keystroke was a one time fluke or an every now and then fluke. 99.9999% of the time the WM_ Messages are identical to a keystroke form the keyboard.
Just thought I would share.
What OS did you test this under? I wonder if this is true across all Windows operating systems.
Re: SendKeys - Windows Message {Now Resolved, but, Freaky Update}
Sorry for the delay, Hack. This was Windows XP tested only.
Re: SendKeys - Windows Message {Now Resolved, but, Freaky Update}
Are you still looking for a solution to this?
If you sink a low-level keyboard hook then you can distinguish between the user pressing the keyboard (which will be registered by the hook) or using SendKeys (which won't register) - more info: http://www.codeguru.com/vb/gen/vb_sy...icle.php/c4829
Re: SendKeys - Windows Message {Now Resolved, but, Freaky Update}
Well, I don't know as it was resolved other ways... But thanks for the link, Bush. I am not sure my friend is looking to do a keyboard hook. Who knows though, he is a bit insane when it comes to his coding.