Article View: borland.public.cppbuilder.nativeapi
Article #8135Several ways to define 2 system-wide hotkeys, without to install keyboard-hook..
From: Oren Halvani
Date: Thu, 18 Nov 2004 18:43
Date: Thu, 18 Nov 2004 18:43
37 lines
2620 bytes
2620 bytes
dear builders, i need to to generate 2 system-wide hotkeys for copy / paste text into / from RichEdit controls..the hotkeys must be: F8 for copy and F9 for pasting (the customers order) later i will need to define more as only 2 system-wide hotkeys, but for now just those 2... now, i don't want to use RegisterHotkey because i've been told very often not to use it..also the same for the like keybd_event( ) function.. one big reason why i cannot use the RegisterHotKey( ) is that it want overwrite existing hotkeys like F12 because that key is reserved for use by the debugger at all times, correct..? and the reason not to use keybd_event( ) is that an unknown window could come to the foreground will receive the pressed keys and than = FATAL problem :-( using a keyboard hook is also a problem because i need to create a standalone exe.. Remy says in the earlier posts to use the WM_COPY / WM_PASTE messages via: SendMessage( ) but how do i use them for the current active window, if my application works in the background..? i cannot use FindWindow( ) because the user has to decide where he want to send the WM_COPY / WM_PASTE... another option is to use the new function SendInput( ) i've heard it's simillar to the "old fashioned" keybd_event( ) but it's more safer, right...? so, can someone maybe drop me some suggestions what to choose to solve that problem..? Oren
Technical Details
Message-ID:
<419ceea1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!news-out2.kabelfoon.nl!83.128.0.10.MISMATCH!newsfeed.kabelfoon.nl!213.218.66.70.MISMATCH!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,9a94ec9a8ef193c6,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Oren Halvani" <Spam@Me-Please.com> From: "Oren Halvani" <Spam@Me-Please.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Several ways to define 2 system-wide hotkeys, without to install keyboard-hook.. Date: Thu, 18 Nov 2004 19:43:45 +0100 Lines: 39 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 217.234.106.191 Message-ID: <419ceea1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1100803745 217.234.106.191 (18 Nov 2004 10:49:05 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!news-out2.kabelfoon.nl!83.128.0.10.MISMATCH!newsfeed.kabelfoon.nl!213.218.66.70.MISMATCH!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail