Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Question] C#

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
torpin005
Master Cheater
Reputation: 0

Joined: 19 Nov 2007
Posts: 255

PostPosted: Fri Mar 07, 2008 11:47 pm    Post subject: [Question] C# Reply with quote

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
View user's profile Send private message AIM Address
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Mar 07, 2008 11:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
torpin005
Master Cheater
Reputation: 0

Joined: 19 Nov 2007
Posts: 255

PostPosted: Fri Mar 07, 2008 11:55 pm    Post subject: Reply with quote

ok thanks
Back to top
View user's profile Send private message AIM Address
Henley
Grandmaster Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 671

PostPosted: Sat Mar 08, 2008 12:41 am    Post subject: Reply with quote

Code:
SendKeys.SendWait

google it

I like it cause its short and easy to type out Very Happy
Back to top
View user's profile Send private message
malfunction
Grandmaster Cheater Supreme
Reputation: 0

Joined: 30 Jan 2007
Posts: 1015
Location: http://www.behindthecorner.com/

PostPosted: Sat Mar 08, 2008 7:12 am    Post subject: Reply with quote

In C++ SendKeys, I think pretty much same in C Sharp
In C++

Code:
if(GetKeyState('c') & 0x8000)
{
//Code to execute
}

_________________
Back to top
View user's profile Send private message
Michel
Expert Cheater
Reputation: 0

Joined: 16 May 2007
Posts: 214
Location: The Netherlands

PostPosted: Sat Mar 08, 2008 9:11 am    Post subject: Reply with quote

I never used C++, but shouldnt it be GetAsyncKeyState(VK_balbal)
Back to top
View user's profile Send private message
Pseudo Xero
I post too much
Reputation: 0

Joined: 16 Feb 2007
Posts: 2607

PostPosted: Sat Mar 08, 2008 9:13 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites