Click here to Skip to main content
15,916,435 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Preprocessor Pin
Paul Ranson30-Apr-04 1:26
Paul Ranson30-Apr-04 1:26 
GeneralRe: Preprocessor Pin
David Crow29-Apr-04 3:08
David Crow29-Apr-04 3:08 
GeneralHelp needed: Swapping large data sets to file Pin
f.o.b27-Apr-04 4:56
f.o.b27-Apr-04 4:56 
GeneralRe: Help needed: Swapping large data sets to file Pin
f6427-Apr-04 6:14
f6427-Apr-04 6:14 
GeneralCharge Images from a PATH Pin
Hugo_Javier_Bertorello27-Apr-04 4:52
Hugo_Javier_Bertorello27-Apr-04 4:52 
GeneralRe: Charge Images from a PATH Pin
David Crow27-Apr-04 5:38
David Crow27-Apr-04 5:38 
GeneralRe: Charge Images from a PATH Pin
PJ Arends27-Apr-04 7:00
professionalPJ Arends27-Apr-04 7:00 
GeneralSystem wide CBT-Hook reacts only to windows in creating process Pin
Nick Nougat27-Apr-04 4:05
Nick Nougat27-Apr-04 4:05 
Hi!

I need to be able to control the life time of a window that was created in a different process. For that purpose I set a CBT-hook to check for the HCBT_DESTROYWND notification. The problem is that I only get notifications for destroyed windows that were created by threads in my own process.

The hook callback function is, as the docs request, in a separate dll.
I use this function call to set the hook:

::SetWindowsHookEx(WH_CBT, _CBTProc, hInstance, NULL);

Here, hInstance is the handle to the loaded separate dll and _CBTProc is the pointer to my callback inside that dll.
As I said: it works, I get notifications, but ONLY for windows owned by threads in my process. That's not what I consider a "system wide" hook!
As a workaround I also tried to get the ID of thread owning the window I want to be informed about via GetWindowThreadProcessID() and used that ID instead of the NULL parameter when setting the hook - to no avail...
In this same separate dll I use a system wide mouse hook. This mouse hook _does_ work however.

So my question is: did I miss something important concerning CBT hooks? How can I get a really system wide CBT hook installed?

Thanks in advance
Nick
GeneralCFormView in a Dialog Based Aplication Pin
Carlos Sánchez García27-Apr-04 4:00
Carlos Sánchez García27-Apr-04 4:00 
GeneralThere's a simple solution Pin
Nitzan Shaked27-Apr-04 4:43
Nitzan Shaked27-Apr-04 4:43 
GeneralRuntime Error Pin
rrrado27-Apr-04 3:08
rrrado27-Apr-04 3:08 
GeneralRe: Runtime Error Pin
David Crow27-Apr-04 3:15
David Crow27-Apr-04 3:15 
GeneralRe: Runtime Error Pin
rrrado27-Apr-04 3:21
rrrado27-Apr-04 3:21 
GeneralRe: Runtime Error Pin
David Crow27-Apr-04 3:28
David Crow27-Apr-04 3:28 
GeneralRe: Runtime Error Pin
rrrado27-Apr-04 3:32
rrrado27-Apr-04 3:32 
GeneralRe: Runtime Error Pin
David Crow27-Apr-04 3:44
David Crow27-Apr-04 3:44 
GeneralRe: Runtime Error Pin
rrrado27-Apr-04 4:00
rrrado27-Apr-04 4:00 
GeneralRe: Runtime Error Pin
David Crow27-Apr-04 4:07
David Crow27-Apr-04 4:07 
GeneralRe: Runtime Error Pin
Paul Ranson27-Apr-04 4:55
Paul Ranson27-Apr-04 4:55 
GeneralRe: Runtime Error Pin
rrrado27-Apr-04 5:13
rrrado27-Apr-04 5:13 
GeneralRe: Runtime Error Pin
toxcct27-Apr-04 5:45
toxcct27-Apr-04 5:45 
GeneralRe: Runtime Error Pin
Paul Ranson27-Apr-04 7:22
Paul Ranson27-Apr-04 7:22 
GeneralRe: Runtime Error Pin
toxcct27-Apr-04 8:09
toxcct27-Apr-04 8:09 
GeneralRe: Runtime Error Pin
Cedric Moonen27-Apr-04 20:41
Cedric Moonen27-Apr-04 20:41 
Questionhow can i get RGB value from an image Pin
Member 41696027-Apr-04 2:55
Member 41696027-Apr-04 2:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.