Article View: borland.public.cppbuilder.nativeapi
Article #10959Re: Send key press to another app-window.
From: Bob Gonder
Date: Mon, 08 Mar 2004 17:29
Date: Mon, 08 Mar 2004 17:29
23 lines
1808 bytes
1808 bytes
Graham Reeds wrote:
>Well that is something I am stuck on also. I need to send CTRL+R to the
>window.
>// send CTRL+R to start recording
> ::PostMessage(hWndPcView, WM_KEYDOWN, VK_CONTROL, 0x10FF);
> ::PostMessage(hWndPcView, WM_KEYDOWN, VkKeyScan('R'), 0);
> ::PostMessage(hWndPcView, WM_KEYUP, VkKeyScan('R'), 0);
> ::PostMessage(hWndPcView, WM_KEYUP, VK_CONTROL, 0x10FF);
>
Don't think 0x000010FF is correct.
The scan code for Ctrl is 29, not 16.
Not sure a repeat count of 255 for the control key is correct.
You could try VkKeyScan( 'R' & 0x1f ) /* control-R */
Or VkScan('R') | 0x0200 /* control key is pressed */
You might also need the scan code instead of 0
R is 19, so 0x00001301 might be appropriate.
Note: I've never used these, so just reading/thinking out loud.
Technical Details
Message-ID:
<neap40pivdp81o1vmuq5atebdppa5e4bfp@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40448e03@newsgroups.borland.com> <404c7f89$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,bc09f599c90f85b4 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-03-08 09:40:44 PST From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Send key press to another app-window. Date: Mon, 08 Mar 2004 09:29:23 -0800 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <neap40pivdp81o1vmuq5atebdppa5e4bfp@4ax.com> References: <40448e03@newsgroups.borland.com> <404c7f89$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.31.166.101 X-Trace: newsgroups.borland.com 1078766964 67.31.166.101 (8 Mar 2004 09:29:24 -0800) Lines: 26 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail