View previous topic :: View next topic |
Author |
Message |
the the the Master Cheater
Reputation: 46
Joined: 15 Jun 2008 Posts: 429
|
Posted: Sat Apr 04, 2009 9:30 pm Post subject: Visual C++ 2008 SendKeys help |
|
|
Hey, how can I send keys with vis c++2008? I can't figure it out.. And I don't want it to send to a specific app, I want it to send to the current active app window...
+REP (If I can)
Please help, I want to make an autotyper!
Code: | private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Enabled=true;
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
timer1->Enabled=false;
}
private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e) {
timer1->Interval=(textBox2->Text);
SendKeys.send(textBox1->Text);
timer2->Enabled=true;
}
private: System::Void timer2_Tick(System::Object^ sender, System::EventArgs^ e) {
timer2->Interval=80;
SendKeys("{ENTER}");
timer2->Enabled=false;
} |
I think that is right, but I am not sure, I get these errors on build: Code: |
1>c:\REMOVED\asciicatautotyper\Form1.h(181) : error C2664: 'System::Windows::Forms::Timer::Interval::set' : cannot convert parameter 1 from 'System::String ^' to 'int'
1> No user-defined-conversion operator available, or
1> There is no context in which this conversion is possible
1>c:\REMOVED\asciicatautotyper\Form1.h(182) : error C2143: syntax error : missing ';' before '.'
1>c:\REMOVED\asciicatautotyper\Form1.h(182) : error C2143: syntax error : missing ';' before '.'
1>c:\REMOVED\asciicatautotyper\Form1.h(187) : error C2440: '<function-style-cast>' : cannot convert from 'const char [8]' to 'System::Windows::Forms::SendKeys'
1> No constructor could take the source type, or constructor overload resolution was ambiguous |
this is mostly double clicking the timer and editing code etc..
|
|
Back to top |
|
 |
Jorg hi I post too much
Reputation: 7
Joined: 24 Dec 2007 Posts: 2276 Location: Minnesota
|
Posted: Sun Apr 05, 2009 6:52 am Post subject: |
|
|
Hide your window and bring focus to the application you want to sendkeys to. Like Microsoft.VisualBasic.AppActivate("Text Of The Window To Activate") I wonder if this is outdated. Opps it vb..
_________________
CEF will always stay alive. |
|
Back to top |
|
 |
the the the Master Cheater
Reputation: 46
Joined: 15 Jun 2008 Posts: 429
|
Posted: Sun Apr 05, 2009 8:36 am Post subject: |
|
|
VB
I made an auto typer before, and it sent the keys to whatever the current application was, which is how I want it. But if thats not possible, tell me how to send it to firefox.exe...
would I do firefox.sendkeys...?
|
|
Back to top |
|
 |
Jorg hi I post too much
Reputation: 7
Joined: 24 Dec 2007 Posts: 2276 Location: Minnesota
|
Posted: Sun Apr 05, 2009 10:54 am Post subject: |
|
|
asciicat wrote: | VB
I made an auto typer before, and it sent the keys to whatever the current application was, which is how I want it. But if thats not possible, tell me how to send it to firefox.exe...
would I do firefox.sendkeys...? |
Sendkeys sends keys to the current focused window so to send it to firefox you must bring it into focus using Microsoft.VisualBasic.AppActivate(title) title is the name of the window.
|
|
Back to top |
|
 |
the the the Master Cheater
Reputation: 46
Joined: 15 Jun 2008 Posts: 429
|
Posted: Sun Apr 05, 2009 11:37 am Post subject: |
|
|
ok, I'll try that
|
|
Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Sun Apr 05, 2009 11:48 am Post subject: |
|
|
Code: |
SendKeys.send(textBox1->Text);
|
wat? SendKeys has a class?
|
|
Back to top |
|
 |
Jorg hi I post too much
Reputation: 7
Joined: 24 Dec 2007 Posts: 2276 Location: Minnesota
|
Posted: Sun Apr 05, 2009 12:08 pm Post subject: |
|
|
Lol didn't see that
private: System::Void timer2_Tick(System::Object^ sender, System::EventArgs^ e) {
timer2->Interval=80;
SendKeys("{ENTER}");
timer2->Enabled=false;
}
|
|
Back to top |
|
 |
|