Board index » delphi » Delphi translation of VB SendKey

Delphi translation of VB SendKey

Hello,

I have been a Visual Basic user. But I discover Delphi and I prefer
Delphi to VB.

But I have a problem.
In VB, there is a function (SendKey), that can send a key-code in
another application.
For Exemple, in a VB program, you run a application and with SendKey, it
is possible to control application by sending key-code.

Is there a same function in Delphi?

Thank you.

 

Re:Delphi translation of VB SendKey


No, there is not a native Delphi function to do this.
However, there is a routine to do that in Delphi
Developer Guide an excellent book BTW.
--
Don Weiss, President
Step 1, Inc.
10551 Barkley, Suite 117
Overland Park, KS  66212
(913) 383-1965 voice
(913) 39\83-3607 fax
www.step1inc.com

Ludovic DE FREITAS <defr...@worldnet.fr> wrote in article
<321256E0.7...@worldnet.fr>...

Quote
> Hello,

> I have been a Visual Basic user. But I discover Delphi and I prefer
> Delphi to VB.

> But I have a problem.
> In VB, there is a function (SendKey), that can send a key-code in
> another application.
> For Exemple, in a VB program, you run a application and with SendKey, it
> is possible to control application by sending key-code.

> Is there a same function in Delphi?

> Thank you.

Re:Delphi translation of VB SendKey


Quote
Ludovic DE FREITAS wrote:

> Hello,

> I have been a Visual Basic user. But I discover Delphi and I prefer
> Delphi to VB.

> But I have a problem.
> In VB, there is a function (SendKey), that can send a key-code in
> another application.
> For Exemple, in a VB program, you run a application and with SendKey, it
> is possible to control application by sending key-code.

> Is there a same function in Delphi?

> Thank you.

Delphi doesn't have a SendKey function, but you can use
SendMessage(TheControl.Handle, WM_CHAR, Ord('A'), 0); which would send
an A to TheControl.

Re:Delphi translation of VB SendKey


Quote
Ludovic DE FREITAS wrote:

> Hello,

> I have been a Visual Basic user. But I discover Delphi and I prefer
> Delphi to VB.

> But I have a problem.
> In VB, there is a function (SendKey), that can send a key-code in
> another application.
> For Exemple, in a VB program, you run a application and with SendKey, it
> is possible to control application by sending key-code.

> Is there a same function in Delphi?

  Yes, and no.  You can do it in Delphi, but there's no 'SENDKEY'
function...  One of the Delphi Books is rumored to have this function
spelled out in it...  However, I don't know the name of the book...
However, if you do get it, please let me know...

Jason

Re:Delphi translation of VB SendKey


....<snip>...
  One of the Delphi Books is rumored to have this function

Quote
> spelled out in it...  However, I don't know the name of the book...
> However, if you do get it, please let me know...

I don't remember the title, but it's a blue book by Peter Norton.  
It includes full source to implement SendKeys.

Re:Delphi translation of VB SendKey


I found these Delphi units on the news group a couple of months ago!

Chris Arscott

// DRS Data & Research  Services plc,    Sunrise Parkway
// Linford Wood,   Milton Keynes,   MK14 6LR.    England
// Phone: +44 1908 666088           Fax: +44 1908 607668
// E-Mail: chr...@drs.co.uk    Web Page: www.drs.co.uk

  PASCAL1.ZIP
9K Download

  PASCAL.ZIP
9K Download

Other Threads