View previous topic :: View next topic |
Author |
Message |
Chobito1337 Expert Cheater Reputation: 2
Joined: 06 May 2008 Posts: 197
|
Posted: Sat Mar 12, 2011 5:42 pm Post subject: Auto Text Typer (Visual Basic) |
|
|
So I want to make a program that when I press F6 will say what I've put into the text box.
Like say I put the word "Hello" in the box, then I press F6 the program will automatically type "Hello" (each time i press F6)
_________________
.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI |
|
Back to top |
|
|
Radiation Grandmaster Cheater Reputation: 14
Joined: 17 Jun 2009 Posts: 842 Location: Chernobyl
|
Posted: Sat Mar 12, 2011 5:59 pm Post subject: |
|
|
Use this API:
Code: | Private Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer |
Now create a timer and put this inside:
Code: | If GetKeyPress(vbKeyF6) Then
SendKeys Text1.Text & "{enter}"
End If |
Assuming Text1 is your text field.
_________________
|
|
Back to top |
|
|
Chobito1337 Expert Cheater Reputation: 2
Joined: 06 May 2008 Posts: 197
|
Posted: Sat Mar 12, 2011 6:17 pm Post subject: |
|
|
I'm using VB2008, does that change anything?
_________________
.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI
Last edited by Chobito1337 on Sat Mar 12, 2011 6:44 pm; edited 2 times in total |
|
Back to top |
|
|
Radiation Grandmaster Cheater Reputation: 14
Joined: 17 Jun 2009 Posts: 842 Location: Chernobyl
|
Posted: Sat Mar 12, 2011 6:42 pm Post subject: |
|
|
yes, i believe the api declaration might be slightly different.
and i'm not too sure about the SendKeys function in 2008... try it, see what result you get. we will go on from there
_________________
|
|
Back to top |
|
|
Chobito1337 Expert Cheater Reputation: 2
Joined: 06 May 2008 Posts: 197
|
Posted: Sat Mar 12, 2011 6:44 pm Post subject: |
|
|
These are the errors I get:
Error 1 Name 'vbKeyF6' is not declared.
Error 2 'SendKeys' is a type and cannot be used as an expression
_________________
.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI |
|
Back to top |
|
|
Radiation Grandmaster Cheater Reputation: 14
Joined: 17 Jun 2009 Posts: 842 Location: Chernobyl
|
Posted: Sat Mar 12, 2011 7:15 pm Post subject: |
|
|
dang it.
i don't code in 2008, just vb6. i should start though.
anyways, look up "sendkeys" in vb 2008 on google
and look up "GetAsyncKeyState" for vb 2008 on google
_________________
|
|
Back to top |
|
|
Chobito1337 Expert Cheater Reputation: 2
Joined: 06 May 2008 Posts: 197
|
Posted: Sat Mar 12, 2011 8:03 pm Post subject: |
|
|
OK, so I got vb6, but it still didn't work. like, I typed whatever in the text box and pressed f6 but nothing happened.
_________________
.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI |
|
Back to top |
|
|
Radiation Grandmaster Cheater Reputation: 14
Joined: 17 Jun 2009 Posts: 842 Location: Chernobyl
|
Posted: Sat Mar 12, 2011 8:36 pm Post subject: |
|
|
where are you sending text? have you tried sending it to a simple application like notepad?
_________________
|
|
Back to top |
|
|
Chobito1337 Expert Cheater Reputation: 2
Joined: 06 May 2008 Posts: 197
|
Posted: Sat Mar 12, 2011 8:38 pm Post subject: |
|
|
I'm sending it into the same text box, but i tried notepad and it didnt work there either.
it also says method or data member not found when i do run with full compile.
_________________
.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI |
|
Back to top |
|
|
hcavolsdsadgadsg I'm a spammer Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sat Mar 12, 2011 11:27 pm Post subject: |
|
|
API + pinvoke.net = win
|
|
Back to top |
|
|
Radiation Grandmaster Cheater Reputation: 14
Joined: 17 Jun 2009 Posts: 842 Location: Chernobyl
|
Posted: Sat Mar 12, 2011 11:37 pm Post subject: |
|
|
Chobito1337 wrote: | it also says method or data member not found when i do run with full compile.
|
on what part of code does that show up?
_________________
|
|
Back to top |
|
|
Chobito1337 Expert Cheater Reputation: 2
Joined: 06 May 2008 Posts: 197
|
Posted: Sat Mar 12, 2011 11:43 pm Post subject: |
|
|
the text1.text part
_________________
.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI |
|
Back to top |
|
|
hcavolsdsadgadsg I'm a spammer Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Mar 13, 2011 1:50 am Post subject: |
|
|
case sensitive
|
|
Back to top |
|
|
Chobito1337 Expert Cheater Reputation: 2
Joined: 06 May 2008 Posts: 197
|
Posted: Sun Mar 13, 2011 3:20 pm Post subject: |
|
|
Auto typer complete, thanks itapa.
_________________
.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI |
|
Back to top |
|
|
Radiation Grandmaster Cheater Reputation: 14
Joined: 17 Jun 2009 Posts: 842 Location: Chernobyl
|
Posted: Sun Mar 13, 2011 4:47 pm Post subject: |
|
|
no problem, i'm glad we were able to resolve this
_________________
|
|
Back to top |
|
|
|