| View previous topic :: View next topic |
| Author |
Message |
Christophe MINETTI Guest
|
Posted: Mon Oct 09, 2006 8:03 pm Post subject: How to simulate a key press |
|
|
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
|
Posted: Tue Oct 10, 2006 1:27 am Post subject: Re: How to simulate a key press |
|
|
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
|
Posted: Tue Oct 10, 2006 8:10 am Post subject: Re: How to simulate a key press |
|
|
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
|
Posted: Wed Oct 11, 2006 2:01 am Post subject: Re: How to simulate a key press |
|
|
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
|
Posted: Tue Oct 24, 2006 12:50 am Post subject: Re: How to simulate a key press |
|
|
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
|
Posted: Tue Oct 24, 2006 2:18 pm Post subject: Re: How to simulate a key press |
|
|
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 |
|
 |
|