How to make a hook global, (HSHELL_WINDOWCREATED , ...)

Started by RHL, February 07, 2012, 09:30:59 PM

Previous topic - Next topic

RHL

Hello all, for a week I have problems, I am trying to program
a global hook to capture messages on windows like these:

HCBT_ACTIVATE
HCBT_CREATEWND

or

HSHELL_REDRAW
HSHELL_WINDOWACTIVATED
HSHELL_WINDOWCREATED

I detect when an application is active (the window), when destroyed, and among other on windows.

I tried to make a hook with SetWindowLong api, but that does not api
global hook (not for all windows, only one)

then try the api SetWindowHookEx with the constants:
WH_CBT
WH_SHELL

but Neither I achieve , can you help me please, I have time with the problem and I'm annoyed  :(

qWord

you must place the hook procedure in a DLL - see the documentation. Using your favourite search engine, you will find more than enough examples (c,c++,...)
FPU in a trice: SmplMath
It's that simple!

RHL

yes thanks, look at an example using a dll. but do not want to use a dll, it seems simple I want to do, but it not is  :(