🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8152

Re: Several ways to define 2 system-wide hotkeys, without to install keyboard-hook..

#8152
From: Jim Dodd
Date: Fri, 19 Nov 2004 14:24
57 lines
3120 bytes
Oren Halvani wrote:
> 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
> 
> 
I just noticed a component (recently updated) on Torrie's site for
setting system-wide hotkeys. It is here (listed as HotKeyManager
v.1.7.0 by Troels Jakobsen)

http://www.torry.net/pages.php?id=238

and on the author's homepage at

http://subsimple.com/delphi.asp

I haven't used it but his other components are good. Written in Delphi 
but you get source so it can be installed in Builder.

Regards,

Jim Dodd
Onset Computer Corp.
Technical Details
Message-ID: <419e0215$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <419ceea1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,9a94ec9a8ef193c6
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Fri, 19 Nov 2004 09:24:22 -0500
From: Jim Dodd <bcbuilderboy@yahoo.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.1) Gecko/20040707
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Several ways to define 2 system-wide hotkeys, without to install
 keyboard-hook..
References: <419ceea1@newsgroups.borland.com>
In-Reply-To: <419ceea1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 24.75.243.228
Message-ID: <419e0215$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1100874261 24.75.243.228 (19 Nov 2004 06:24:21 -0700)
Lines: 57
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail