How do you simulate a key press? (ie: left and right arrow keys)
The SendKeys Function might be what you are looking for.
You might have to select the window u want to send them to aswell?
If they're inside your own program, just call the _KeyPress or _KeyDown event for the object you want the keys to be pressed on. You may need to experiment (ie Debug.Print KeyAscii) to figure out what the arguments should be.
Quote from: effect on April 09, 2005, 01:15 AM
You might have to select the window u want to send them to aswell?
The SendKeys function will work like a macro, it just sends keys to the computer as if you were typing them in through your keyboard. What window is being focused on will be the one that receives the keys.
If you want to send keys to non-active windows, you can sometimes use SendMessage or PostMessage with WM_KEYDOWN, WM_KEYUP and/or WM_CHAR.
It just matters on what the purpose of his program is. Whether it be built to send key strokes to specific programs, or if it functions like a macro.
Tontow did anyone answer your question? Some asked for more information. How about do the community a favor and say you got your answer (maybe even which method you chose) or answer their questions so they can help you.
Alot of programs(games) protect agienst bots and that nature by disabling the sendkeys function in their program... not sure about those other methods but maybe you could create a fake keyboard device and make a program that causes this fake device to send keys ( just a though ) i mean like not a physical device i mean like a driver that can be manipulated by a program
Even though many games (Runescape, Eternal Lands) have protection from automated tasks by 3rd party programs, I highly doubt that they can stop the SendKeys function from your program. SendKeys sends keys directly to the computer as if you were typong them through your keyboard. Nothing can detect if you are typing or if it is a program.
Quote from: Yegg on April 20, 2005, 01:37 PM
Even though many games (Runescape, Eternal Lands) have protection from automated tasks by 3rd party programs, I highly doubt that they can stop the SendKeys function from your program. SendKeys sends keys directly to the computer as if you were typong them through your keyboard. Nothing can detect if you are typing or if it is a program.
You oviously dont know what your talking about then... We will use something i recently worked on as an example Guildwars you can download the client from their site http://guildwars.com make a code that will log you in completely and prove me wrong using only the sendkeys api
Why would I want to waste my time proving you wrong? I'm working on other projects.
Quote from: Yegg on April 21, 2005, 10:26 AM
Why would I want to waste my time proving you wrong? I'm working on other projects.
Maybe you are wrong. Maybe you're ignorant. Maybe you lose?
Maybe not?
Since you're not going to take your time I guesss you will never know and will be assume wrong :p
Failure to answer a challenge based off of a previous statement made by yourself makes you wrong?
Well, my Algebra 2 teacher is in for some exciting new interpretations of our conversations. Thanks for the tip, Adron.
Um, what?
Quote from: LivedKrad on April 22, 2005, 07:08 PM
Failure to answer a challenge based off of a previous statement made by yourself makes you wrong?
Well, my Algebra 2 teacher is in for some exciting new interpretations of our conversations. Thanks for the tip, Adron.
Absolutely. A math teacher should be able to prove all the theorems being taught or be able to point to existing proofs if the proof is too long to write on the blackboard. Math teachers should never rely on saying: "This is the way it, because I
say so", because then they're turning math into something as vague as religion - based on belief and speculation.
In my maths lesson, im the best in it :P
The teacher explains it, but then i go into more detail than she can, and the class listen carefully, and say "No i dont understand what the teacher says", but when i explain they say, "Yes i kind of understand this".
If i feel my teacher hasn't explained it well, i will explain it back to her in more detail. My maths teacher (Is a she) is actually very good.
I learn more from http://math.com than school math classes.
Quote from: Adron on April 25, 2005, 10:02 AM
Quote from: LivedKrad on April 22, 2005, 07:08 PM
Failure to answer a challenge based off of a previous statement made by yourself makes you wrong?
Well, my Algebra 2 teacher is in for some exciting new interpretations of our conversations. Thanks for the tip, Adron.
Absolutely. A math teacher should be able to prove all the theorems being taught or be able to point to existing proofs if the proof is too long to write on the blackboard. Math teachers should never rely on saying: "This is the way it, because I say so", because then they're turning math into something as vague as religion - based on belief and speculation.
My Chemistry teacher frequently says such things. Apparently, if we get an answer wrong on the test but the answer book says otherwise, weare completely wrong and there is no room for discussion or for proving the answer false.
"I thought you said the delta H of a substance was its exothermic or endothermic temperature change.."
"The answer is A, damnit!"
Sounds like you've been given simplified explanations. Besides, there's a huge difference between math and chemistry!
Agreed. There is a substantial difference between math and chemistry in most areas, however the teaching styles at my school for chemistry and math are one in the same: don't ask don't tell.
You should try asking your math teacher for more proofs. Since math is based purely on theory, you can generally prove things. Unlike chemistry which is somewhat empirical.
How would I send the keys to a single program regardless of weather it was full screen or minimized?
What about data injection? - (Note: I have no clue what data injection is)
BTW, I'm not makeing a cheating micro bot, I'm trying to make a tourney program that can interface with and send text through any or most game clients, but I'm focusing on getting it to work with starcraft first. - kinda like that one program that truned your starcraft into a moderation bot.
Quote from: Tontow on May 09, 2005, 03:17 PM
How would I send the keys to a single program regardless of weather it was full screen or minimized?
What about data injection? - (Note: I have no clue what data injection is)
BTW, I'm not makeing a cheating micro bot, I'm trying to make a tourney program that can interface with and send text through any or most game clients, but I'm focusing on getting it to work with starcraft first. - kinda like that one program that truned your starcraft into a moderation bot.
Quote from: Adron on April 09, 2005, 01:27 PM
If you want to send keys to non-active windows, you can sometimes use SendMessage or PostMessage with WM_KEYDOWN, WM_KEYUP and/or WM_CHAR.
(I realize that this thread has gone way off-topic, but you could have looked through the responses ;))
Both SendMessage (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/messagesandmessagequeues/messagesandmessagequeuesreference/messagesandmessagequeuesfunctions/sendmessage.asp) and PostMessage (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/messagesandmessagequeues/messagesandmessagequeuesreference/messagesandmessagequeuesfunctions/sendmessage.asp) are documented in MSDN.
I'm sure pscode.com and vbcode.com have some perfect examples on doing this.