🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#8136
From: Remy Lebeau (TeamB)
Date: Thu, 18 Nov 2004 19:03
37 lines
2620 bytes
"Oren Halvani" <Spam@Me-Please.com> wrote in message
news:419ceea1@newsgroups.borland.com...

> using a keyboard hook is also a problem because i
> need to create a standalone exe..

Sorry, but if you cannot use hotkeys then you must use a global hook inside
a DLL.  That is the only other way to intercept keystrokes across multiple
applications.  Unless you write your own keyboard device driver, which I do
not recommend for this situation.

> 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..?

Makes no difference where your application is.  All you need is the HWND for
the target and destination RichEdit's.

> i cannot use FindWindow( ) because the user has to decide
> where he want to send the WM_COPY / WM_PASTE...

Then you will have to enumerate the active windows and provide the user with
a list to pick from, or else you will just have to make the user bring the
desired window to the front and then simply copy/paste to/from the active
windows.

> 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...?

What gave you that idea?  SendInput() doesn't allow you to specify the
target window to send the keystrokes to.  It injects the keystrokes directly
into the keyboards input buffer, just as keybd_event() does.


Gambit
Technical Details
Message-ID: <419cf173$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!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
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
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <419ceea1@newsgroups.borland.com>
Subject: Re: Several ways to define 2 system-wide hotkeys, without to install keyboard-hook..
Date: Thu, 18 Nov 2004 11:03:00 -0800
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <419cf173$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1100804467 68.69.17.41 (18 Nov 2004 11:01:07 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!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