 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Thu Jan 10, 2008 1:15 pm Post subject: How do i send a keystroke to Notepad using delphi? |
|
|
Hi,
I was wondering if it was possible to make a program in delphi, wich when you click a button, i will write, lets say a "K", in a notepad
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Thu Jan 10, 2008 1:37 pm Post subject: |
|
|
You can use the sendkeys function.
Include the .pas file from attachment in your project, or put the .dcu in your lib folder.
|
|
| Back to top |
|
 |
Michel Expert Cheater
Reputation: 0
Joined: 16 May 2007 Posts: 214 Location: The Netherlands
|
Posted: Thu Jan 10, 2008 1:43 pm Post subject: |
|
|
procedure TForm1.Button1Click(Sender: TObject);
begin
AppActivate('Notepad - Untitled');
sleep(0);
sendkeys ('you fail' ,true);
|
|
| Back to top |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Thu Jan 10, 2008 2:13 pm Post subject: |
|
|
AWESOME! ty!
but i edited the code a little:
procedure TForm1.Button1Click(Sender: TObject);
begin
AppActivate('Notepad - Untitled');
sleep(0);
sendkeys ('woot, it works!' ,true);
is there a way to do this, without setting notepad as an active window?
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
|
| Back to top |
|
 |
iRiot Master Cheater
Reputation: 0
Joined: 03 Jul 2007 Posts: 395 Location: Aka RIOT
|
Posted: Thu Jan 10, 2008 7:02 pm Post subject: |
|
|
Here is the code to send a keystroke in delphi..just add edit1.text onto your form
| Code: | var
i : integer;
begin
for i := 1 to Length(Edit1.text) do
Postmessage(FindWindowex(FindWindow(nil,'Untitled - Notepad'),0,nil,nil),WM_Char,integer(pChar(Edit1.text[i])),1);
end;
|
Also if u wanted to press enter....
| Code: | | PostMessage(FindWindowex(FindWindow(nil,'Untitled - Notepad'),0,nil,nil),WM_KEYDOWN , $0D, 0); |
Complete code... Omg u just made a auto spammer just add this code to a timer and set the interval as 1...
| Code: | var
i : integer;
begin
for i := 1 to Length(Edit1.text) do
Postmessage(FindWindowex(FindWindow(nil,'Untitled - Notepad'),0,nil,nil),WM_Char,integer(pChar(Edit1.text[i])),1);
PostMessage(FindWindowex(FindWindow(nil,'Untitled - Notepad'),0,nil,nil),WM_KEYDOWN , $0D, 0);
end;
|
_________________
|
|
| Back to top |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Fri Jan 11, 2008 5:06 am Post subject: |
|
|
AWESOME!, ty guys! well... im at school right now, gonna check it l8er
edit: yea, it hell works! now, is there a way to "bypass" that into maplestory?
and, what if i want to make a left mouse click?
|
|
| Back to top |
|
 |
|
|
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
|
|