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 


[Delphi] How Send Key?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
colo
Expert Cheater
Reputation: 1

Joined: 09 Apr 2005
Posts: 111

PostPosted: Mon Feb 16, 2009 9:30 am    Post subject: [Delphi] How Send Key? Reply with quote

Idk.. but i like send key (F1,F2,etc)

how can send Key?

_________________
Sorry my English very bad Sad
www.gamerztools.net
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Mon Feb 16, 2009 9:38 am    Post subject: Reply with quote

Map the key.
Use PostMessage
VK_F1
Back to top
View user's profile Send private message
colo
Expert Cheater
Reputation: 1

Joined: 09 Apr 2005
Posts: 111

PostPosted: Mon Feb 16, 2009 10:03 am    Post subject: Reply with quote

Me use this:

Code:
PostMessageA(Wnd, WM_KEYDOWN, ord(VK_F1),0);


but in process have error, Is correct?

_________________
Sorry my English very bad Sad
www.gamerztools.net
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Mon Feb 16, 2009 10:45 am    Post subject: Reply with quote

I believe you have to map the key for the last parameter.
Back to top
View user's profile Send private message
colo
Expert Cheater
Reputation: 1

Joined: 09 Apr 2005
Posts: 111

PostPosted: Mon Feb 16, 2009 11:41 am    Post subject: Reply with quote

dnsi0 wrote:
I believe you have to map the key for the last parameter.


Please can make example.

Thanks Embarassed

_________________
Sorry my English very bad Sad
www.gamerztools.net
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
alexNx
Master Cheater
Reputation: 0

Joined: 23 Nov 2008
Posts: 313

PostPosted: Mon Feb 16, 2009 12:17 pm    Post subject: Reply with quote

This is chunk of code from my bot and you can see very clear how to do so.
i hope this can help you. Also if you like my code download the thing i attached so your program can run properly .

MY CODE:
Code:
unit botts;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Timer1: TTimer;
    Timer2: TTimer;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Timer3: TTimer;
    Timer4: TTimer;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Timer5: TTimer;
    Timer6: TTimer;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    GroupBox2: TGroupBox;
    Button1: TButton;
    procedure Timer1Timer(Sender: TObject);
    procedure Timer2Timer(Sender: TObject);
    procedure Timer3Timer(Sender: TObject);
    procedure Timer4Timer(Sender: TObject);
    procedure Timer5Timer(Sender: TObject);
    procedure Timer6Timer(Sender: TObject);
    procedure Edit1Change(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function PostMessageX(
hWnd:HWND;
MSG:UINT;
WPARAM:wParam;
LPARAM:lParam):BOOL;stdcall;
external 'PMX.dll' name 'PostMessageX'


procedure TForm1.Timer1Timer(Sender: TObject);
begin
if odd(GetAsyncKeyState(VK_F1)) then  //When u press f1 it will begin
begin
label1.caption:='On';
label1.font.color:=clLime;
Timer2.Enabled:=true;
end;
if odd(GetAsyncKeyState(VK_F2)) then  //when u press f2 it will stop
begin
label1.caption:='On';
label1.font.color:=clRed;
Timer2.Enabled:=false;
end;

end;

procedure TForm1.Timer2Timer(Sender: TObject);
var
MS: HWND;
A:DWORD;
begin
A:=MapVirtualKey($5A,0);
A:=A shl 16;
MS := FindWindow('MapleStoryClass', nil);
  if MS <>0 then  begin
PostMessageX(MS,WM_KEYDOWN, $5A, A);
  end;

end;



The Extension 'zip' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________
[BELLOCAN]


Bellocan:
10x Priest 1month banned.
5x Sin Active.
3x Bow Active.
Back to top
View user's profile Send private message
colo
Expert Cheater
Reputation: 1

Joined: 09 Apr 2005
Posts: 111

PostPosted: Mon Feb 16, 2009 12:35 pm    Post subject: Reply with quote

Thanks Very Happy, alexNx.

My idea is correct Very Happy

_________________
Sorry my English very bad Sad
www.gamerztools.net
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
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