Well, we get an absolute mountain of people too lazy to use the search button asking the same question:
"SENDKEYZ DUZ NAWT W0RK, WUT DO AI DU?"
So, in light of all this laziness and me having to type out the same answer in a bunch of different threads I decided to compile all the necessary stuff into a neat little .dll which can be used very simply to send string without use of SendKeys.
How do I use it?
It's very simple really, firstly you must add a reference to the .dll. To do this, simply press "Project -> Add Reference" as show below, then browse for wherever you saved the downloaded .dll.
Okay, you've now added a reference, good work. Now it's time to create an instance of the StringSender. This is really simple, just declare it globally so you can use it throughout your whole app, or locally if you just want to use it once. In this picture I declared it globally (NOTE: You don't have to call the variable "sSend", you can name it whatever you want.)
Okay, we now have an instance of the StringSenderClass, excellent. Now it's time to see what it can do. In the image below I have used all the StringSender procedures to show you how they work, I'll follow up with a brief explanation of how each one works in a moment.
Alright here's an overview of all the procedures:
TypeString: Type-string sends each character of the specified string separately with a user-defined interval, this can be used to create a realistic typing effect. The downside is that you can't use this to send words with different letter casings, i.e "Im So Cool" will simply become "im so cool" and symbols are not allowed either. Still, it has it's uses.
SendString: SendString sends your text exactly as you type it, this means you can even have symbols and capital letters! It uses the computers clipboard as well as the paste function to directly paste your text to wherever you want.
SendKey: Pretty self explanatory, this sends a single keystroke to an application.
SendTwoKeys: Again, this is fairly self explanatory, this procedure sends two keypresses at the same time to simulate two keys being held down (i.e Alt+F4), this is useful for hotkeys etc.
I think that's about it for the tutorial side of things.
Hmm, I think that's about all from me, I hope you guys enjoy this and get the chance to use it! I tried to make it as simple as possible yet effective. Please post in the thread if you have any sort of difficulties/errors and I'll do my best to help you get a solution.
I cba to test now. Can you only send strings or also keys?
Originally Posted by Blubb1337
I cba to test now. Can you only send strings or also keys?
Going to edit the DLL in a sec to have single keys and string. I completely forgot single keys haha.
Thanks for the sticky.
EDIT: Updated main post with a new DLL that supports single keypress as well so it'll need re-approval
Reapproved
Also I stickied this because you put some work into it, and it's a great release.
Originally Posted by lolland
Reapproved
Also I stickied this because you put some work into it, and it's a great release.
Haha thanks a lot man, although I must admit there wasn't a hell of a lot of work involved, you'd be surprised how simple class libraries are to write
I know how simple they are to write, I had to make one a few months ago
It's still a better release than most others we see in this section, and for that I salute you.
Well, I think I might update it for the third time, with another alternative to SendKeys but one that can support different letter casings + symbols. It's pretty simple in practice really, use Ctrl+V to send the specified text and it'll work in game I'm fairly sure and will save letter casings and symbols. Sorry lolland, I'll have another approval for you in a second
Originally Posted by J-Deezy
Going to edit the DLL in a sec to have single keys and string. I completely forgot single keys haha.
Thanks for the sticky.
EDIT: Updated main post with a new DLL that supports single keypress as well so it'll need re-approval
Good. That was my point
Originally Posted by Blubb1337
Good. That was my point
Added some more functionality to the little bastard, enjoy.
Pretty nice working with .dlls hu =D?
Not to be "bad" lol, but I have done something like this with in C++ (.dll) already ^^
Anyway it's a good job, and definitely useful.
Originally Posted by Blubb1337
Pretty nice working with .dlls hu =D?
Indeed it is
Originally Posted by Brinuz
Not to be "bad" lol, but I have done something like this with in C++ (.dll) already ^^
Anyway it's a good job, and definitely useful.
C++ != VB /
and thanks
Good Job Jdeezy, It's 10 lines of code, not really sure it deserves a sticky. Deff listed in tuts and/or snippets to be sure it can be found easily.
But if we sticky every "decent" .dll or release there are 100's more that should be be here.
Originally Posted by NextGen1
Good Job Jdeezy, It's 10 lines of code, not really sure it deserves a sticky. Deff listed in tuts and/or snippets to be sure it can be found easily.
But if we sticky every "decent" .dll or release there are 100's more that should be be here.
Hey, I didn't ask for the sticky and it's 69 lines of code oddly enough Although I tend to have a lot of gap lines /. Do with it what you will, I'm not too fussed.