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 :(
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++,...)
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 :(
there is RegisterShellHookWindow
http://www.asmfr.com/codes/HOOK-SANS-DLL-DETECTER-DEMARRAGE-APPLICATION-REGISTERSHELLHOOKWINDOW_52639.aspx
thanks! I found! :clap: