| View previous topic :: View next topic |
| Author |
Message |
torpin005 Master Cheater
Reputation: 0
Joined: 19 Nov 2007 Posts: 255
|
Posted: Fri Mar 07, 2008 11:47 pm Post subject: [Question] C# |
|
|
In C# how can i send keys? like tell the computer to type a key when pressing a button?
+rep if it works
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Mar 07, 2008 11:53 pm Post subject: |
|
|
managed way: SendKeys class, though it will only send to the currently active window I think.
possibly smarter way: SendInput or PostMessage
|
|
| Back to top |
|
 |
torpin005 Master Cheater
Reputation: 0
Joined: 19 Nov 2007 Posts: 255
|
Posted: Fri Mar 07, 2008 11:55 pm Post subject: |
|
|
| ok thanks
|
|
| Back to top |
|
 |
Henley Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 671
|
Posted: Sat Mar 08, 2008 12:41 am Post subject: |
|
|
google it
I like it cause its short and easy to type out
|
|
| Back to top |
|
 |
malfunction Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Jan 2007 Posts: 1015 Location: http://www.behindthecorner.com/
|
Posted: Sat Mar 08, 2008 7:12 am Post subject: |
|
|
In C++ SendKeys, I think pretty much same in C Sharp
In C++
| Code: | if(GetKeyState('c') & 0x8000)
{
//Code to execute
} |
_________________
|
|
| Back to top |
|
 |
Michel Expert Cheater
Reputation: 0
Joined: 16 May 2007 Posts: 214 Location: The Netherlands
|
Posted: Sat Mar 08, 2008 9:11 am Post subject: |
|
|
| I never used C++, but shouldnt it be GetAsyncKeyState(VK_balbal)
|
|
| Back to top |
|
 |
Pseudo Xero I post too much
Reputation: 0
Joined: 16 Feb 2007 Posts: 2607
|
Posted: Sat Mar 08, 2008 9:13 am Post subject: |
|
|
| Micheltjuh wrote: | | I never used C++, but shouldnt it be GetAsyncKeyState(VK_balbal) |
There's a GetKeyState and GetAsyncKeyState API.
_________________
| haxory' wrote: | can't VB do anything??
windows is programmed using VB right? correct me if im wrong.
so all things in windows you have like the start menu is a windows form too. |
|
|
| Back to top |
|
 |
|