🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
6 messages
6 total messages Started by Christophe MINETTI Mon, 09 Oct 2006 15:03
How to simulate a key press
#3110
Author: Christophe MINETTI
Date: Mon, 09 Oct 2006 15:03
9 lines
1069 bytes
Hi all,

I would like to know how can I simulate a key down press in an
application. I suppose I have to send a message to this application but
I am not familiar with this kind of things.

Many thanks in advance.

Christophe
Re: How to simulate a key press
#3112
Author: JF Jolin
Date: Mon, 09 Oct 2006 20:27
19 lines
1329 bytes
I never tried to send directly a WM_KEYUP or WM_KEYDOWN message.

Why would i, keybd_event does that for me.


09 Oct 2006 11:03:57 -0400, Christophe MINETTI <cminetti@ulb.ac.be> wrote:

> Hi all,
>
> I would like to know how can I simulate a key down press in an
> application. I suppose I have to send a message to this application but
> I am not familiar with this kind of things.
>
> Many thanks in advance.
>
> Christophe

__
JF Jolin
Re: How to simulate a key press
#3113
Author: Christophe MINETTI
Date: Tue, 10 Oct 2006 05:49
25 lines
1660 bytes
I am using a commercial application that does full screen previews of files.
What I would like to do is to create an application with a timer that sends to
this commercial application a message as if I was cliking on Page Down (to
pass to the next file).

Christophe


>
> Why would i, keybd_event does that for me.
>
> 09 Oct 2006 11:03:57 -0400, Christophe MINETTI <cminetti@ulb.ac.be> wrote:
>
> > Hi all,
> >
> > I would like to know how can I simulate a key down press in an
> > application. I suppose I have to send a message to this application but
> > I am not familiar with this kind of things.
> >
> > Many thanks in advance.
> >
> > Christophe
>
> __
> JF Jolin
Re: How to simulate a key press
#3114
Author: JF Jolin
Date: Tue, 10 Oct 2006 21:01
20 lines
1573 bytes
10 Oct 2006 01:49:51 -0400, Christophe MINETTI <cminetti@ulb.ac.be> wrote:

> I am using a commercial application that does full screen previews of files.
> What I would like to do is to create an application with a timer that sends to
> this commercial application a message as if I was cliking on Page Down (to
> pass to the next file).

This actual information should have been provide on your first question !

keybd_event works inside an application, not outside.

Here is what i would try in such a situation.
Find the proper window's handle.
Instructions like FindWindow or EnumWindows could be used.
Post a pair of messages WM_KEYUP and WM_KEYDOWN.



__
JF Jolin
Re: How to simulate a key press
#2968
Author: Harold Howe [TeamB]
Date: Mon, 23 Oct 2006 19:50
14 lines
1583 bytes
Christophe MINETTI wrote:
> I am using a commercial application that does full screen previews of files.
> What I would like to do is to create an application with a timer that sends to
> this commercial application a message as if I was cliking on Page Down (to
> pass to the next file).

This link discusses keybd_event

http://web.archive.org/web/20040622202204/www.bcbdev.com/faqs/faq77.htm

In your case, it might be simpler to send scroll messages to the window, 
rather than keyboard events.

H^2
Re: How to simulate a key press
#2969
Author: Christophe MINETTI
Date: Tue, 24 Oct 2006 09:18
20 lines
1555 bytes
Many thanks. It works perfectly !

Christophe

"Harold Howe [TeamB]" wrote:

> Christophe MINETTI wrote:
> > I am using a commercial application that does full screen previews of files.
> > What I would like to do is to create an application with a timer that sends to
> > this commercial application a message as if I was cliking on Page Down (to
> > pass to the next file).
>
> This link discusses keybd_event
>
> http://web.archive.org/web/20040622202204/www.bcbdev.com/faqs/faq77.htm
>
> In your case, it might be simpler to send scroll messages to the window,
> rather than keyboard events.
>
> H^2
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads