BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to simulate a key press

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API)
View previous topic :: View next topic  
Author Message
Christophe MINETTI
Guest





PostPosted: Mon Oct 09, 2006 8:03 pm    Post subject: How to simulate a key press Reply with quote



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
Back to top
JF Jolin
Guest





PostPosted: Tue Oct 10, 2006 1:27 am    Post subject: Re: How to simulate a key press Reply with quote



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 (AT) ulb (DOT) ac.be> wrote:

Quote:
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
Back to top
Christophe MINETTI
Guest





PostPosted: Tue Oct 10, 2006 8:10 am    Post subject: Re: How to simulate a key press Reply with quote



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


Quote:

Why would i, keybd_event does that for me.

09 Oct 2006 11:03:57 -0400, Christophe MINETTI <cminetti (AT) ulb (DOT) 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
Back to top
JF Jolin
Guest





PostPosted: Wed Oct 11, 2006 2:01 am    Post subject: Re: How to simulate a key press Reply with quote

10 Oct 2006 01:49:51 -0400, Christophe MINETTI <cminetti (AT) ulb (DOT) ac.be> wrote:

Quote:
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
Back to top
Harold Howe [TeamB]
Guest





PostPosted: Tue Oct 24, 2006 12:50 am    Post subject: Re: How to simulate a key press Reply with quote

Christophe MINETTI wrote:
Quote:
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
Back to top
Christophe MINETTI
Guest





PostPosted: Tue Oct 24, 2006 2:18 pm    Post subject: Re: How to simulate a key press Reply with quote

Many thanks. It works perfectly !

Christophe

"Harold Howe [TeamB]" wrote:

Quote:
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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API) All times are GMT
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.