Article View: borland.public.cppbuilder.nativeapi
Article #9297Re: How to simulate the keyboard input
From: Bob Gonder
Date: Tue, 13 Jul 2004 21:58
Date: Tue, 13 Jul 2004 21:58
24 lines
1755 bytes
1755 bytes
Sky wrote:
This has been asked several times before. A Google search might turn
up an answer.
>I have simulated some simple keyboard input in my application before.
>just like input some character or simple control key(Enter, Space etc.)
>WM_CHAR was used for character key and WM_KEYDOWN for control key
>
>2. how to simulate a hotkey input, for example Ctrl+V
>I think of the WM_HOTKEY, post a WM_HOTKEY message to the text box,
Did you try sending the Ctrl+V with WM_KEYDOWN?
Scan Code = 0x2f
VirtualKey=0x56 ('V')
WM_KEYDOWN
nVirtKey = (int) wParam; // virtual-key code Probably VK_V or 'V'
Might also try
nVirtKey = VkKeyScan( 0x16 ); // In the old days, Ctrl-V was 0x16
lKeyData = lParam; // key data
= ScanCode<<16 | (count and other flags)
Technical Details
Message-ID:
<i0l8f0ptd6g4acmft7inkqfr90ebm49l16@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.zanker.org!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40f38120$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d6e3f7cb717ce2e X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: How to simulate the keyboard input Date: Tue, 13 Jul 2004 14:58:15 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <i0l8f0ptd6g4acmft7inkqfr90ebm49l16@4ax.com> References: <40f38120$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: 65.40.148.194 X-Trace: newsgroups.borland.com 1089755893 65.40.148.194 (13 Jul 2004 14:58:13 -0700) Lines: 28 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.zanker.org!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail