🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#8138
From: Oren Halvani
Date: Thu, 18 Nov 2004 23:11
70 lines
3398 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> schrieb
 im Newsbeitrag news:419cf173$1@newsgroups.borland.com...

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

so a hook is the only solution...?
what about the RegisterHotkey( ) does it overwrite existing hotkeys or not..?

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

how can i get the HWND's of unknown controls..? that seems to be
tricky..


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

OK...look on the following function..

it only shows processes, but i just need the taskbar - windows..
what is wrong with:

 if(GetWindowLong(hwnd, GWL_EXSTYLE) && WS_EX_APPWINDOW );

/*****************************************************/
// in header -> public:  bool __fastcall ProzesseZaehlen(HWND hwnd);

in unit...

bool __fastcall TfrmTrashHate::ProzesseZaehlen(HWND hwnd)
{
   char Count[256];

   if(chkTaskbar->Checked)
   {
      if(GetWindowLong(hwnd, GWL_EXSTYLE) && WS_EX_APPWINDOW );
      {
        GetWindowText(hwnd,Count,256);
        AnsiString str = Count;
        if(str.IsEmpty()) return true;
        lstAktiveFenster->Items->Add(AnsiString(str));
      }
   }
   else
   {
     GetWindowText(hwnd,Count,256); AnsiString str = Count;
     if (str.IsEmpty()) return true;
     lstAktiveFenster->Items->Add(AnsiString(str));
   }
   return true;
}
/*****************************************************/

> 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

sorry, didn't know how that function works..


Oren
Technical Details
Message-ID: <419d2c69$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.zanker.org!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> <419cf173$1@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
Reply-To: "Oren Halvani" <Spam@Me-Please.com>
From: "Oren Halvani" <Spam@Me-Please.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <419ceea1@newsgroups.borland.com> <419cf173$1@newsgroups.borland.com>
Subject: Re: Several ways to define 2 system-wide hotkeys, without to install keyboard-hook..
Date: Fri, 19 Nov 2004 00:11:52 +0100
Lines: 72
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.123.210
Message-ID: <419d2c69$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1100819561 217.234.123.210 (18 Nov 2004 15:12:41 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.zanker.org!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