Article View: borland.public.cppbuilder.nativeapi
Article #15042Re: Sending several keystrokes to a window via keybd_event( )
From: Remy Lebeau (TeamB)
Date: Tue, 22 Jul 2003 22:54
Date: Tue, 22 Jul 2003 22:54
25 lines
2011 bytes
2011 bytes
"Oren (Halvani.de)" <neroniker@gmx.de> wrote in message news:3f1db326@newsgroups.borland.com... > because I have to send application specific hotkey-keystrokes.. CTRL-C and CTRL-V are hardly application-specific. for other > example: > > CTRL + F (File open...) > or > ALT + S (for choosing a command that beginns with &S below a menu...) There are better ways to accomplish that, such as sending WM_COMMAND messages instead. Dropping down to the keydb_event() is not a very reliable way to accomplish things. Besides, if the focus ever shifts to another window while you are still outputing keystrokes, then some strokes will go to one window while other strokes go to the new window instead. Sending messages is more reliable as you can obtain the desired HWND ahead of time and send everything to that same HWND regardless of focus. Gambit
Technical Details
Message-ID:
<3f1dbf4b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!wn14feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3f1daedc@newsgroups.borland.com> <3f1db0aa$1@newsgroups.borland.com> <3f1db326@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,5f450e96226173c8 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-22 16:09:26 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f1daedc@newsgroups.borland.com> <3f1db0aa$1@newsgroups.borland.com> <3f1db326@newsgroups.borland.com> Subject: Re: Sending several keystrokes to a window via keybd_event( ) Date: Tue, 22 Jul 2003 15:54:17 -0700 Lines: 27 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3f1dbf4b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1058914123 207.175.226.26 (22 Jul 2003 15:48:43 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!wn14feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail