Article View: borland.public.cppbuilder.nativeapi
Article #8140Re: Several ways to define 2 system-wide hotkeys, without to install keyboard-hook..
From: Remy Lebeau (TeamB)
Date: Fri, 19 Nov 2004 00:29
Date: Fri, 19 Nov 2004 00:29
42 lines
2677 bytes
2677 bytes
"Oren Halvani" <Spam@Me-Please.com> wrote in message news:419d2c69$1@newsgroups.borland.com... > so a hook is the only solution...? I believe so, yes. > what about the RegisterHotkey( ) does it overwrite existing hotkeys or not..? No, it fails if the requested hotkey is already registered. Also, I do not believe RegisterHotKey() works across processes, anyway. Each application registers its own hotkeys for its own use. When the user is typing, the system is checking only the active window for registered hotkeys. So if you wanted to register a hotkey in one application and have another application handle the hotkey when pressed, both application's would have to be programmed to work with each other. Otherwise, you would have to inject a hook into the other application to handle the hotkey receiving. So either way, you are using hooks anyway. > how can i get the HWND's of unknown controls..? By not allowing them to be unknown in the first place. Somewhere, somehow, your program has to be told which window to send to, and then you can retreive the HWND for it. If there is only one RichEdit control on a window, then finding it automatically is simple enough, just fine the parent window first and then enumerate its child windows looking for the RICHEDIT class name. But if there are multiple RichEdits in a window, then something has to tell your code which one to use. > if(GetWindowLong(hwnd, GWL_EXSTYLE) && WS_EX_APPWINDOW ); You need to use the '&' operator, not the '&&' operator. > sorry, didn't know how that function works.. That is why you have to start reading documentation. Gambit
Technical Details
Message-ID:
<419d3e01$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<419ceea1@newsgroups.borland.com> <419cf173$1@newsgroups.borland.com> <419d2c69$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 From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <419ceea1@newsgroups.borland.com> <419cf173$1@newsgroups.borland.com> <419d2c69$1@newsgroups.borland.com> Subject: Re: Several ways to define 2 system-wide hotkeys, without to install keyboard-hook.. Date: Thu, 18 Nov 2004 16:29:39 -0800 Lines: 44 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: <419d3e01$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1100824065 68.69.17.41 (18 Nov 2004 16:27:45 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail