Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
General hook
#1
Hello Gintaras, hello all

i'd like to setup a general hook system, the higher as possible, based on the LL keyboard hooks example in QM.

For the hook function, it should catch all messages, and be a function launched at QM start.

I put SetWindowsHookEx(WH_GETMESSAGE &GeneralProc _hinst 0)

in GeneralProc function I put

Function GeneralProc
Code:
Copy      Help
;/
function# code wParam MSG*m
if(code<0) ret CallNextHookEx(0 code wParam m)
out "filtered"
ret CallNextHookEx(0 code wParam m)

It is supposed catch all events, mouse, keyboard, windows creation or activation (the purpose of it at the moment),
and i want to make action depending on event. I use separate keyboard or mouse hooks that work fine, but need a general one
or at last a function to hook windows events.

But filtered is never
shown, so i suppose it's a wrong framework code.

Any help?
#2
Global WH_GETMESSAGE hook function must be in a dll.
QM does not create dlls in QM language. It's possible with __Tcc class, in C language. But better create dll with MS Visual Studio Express, in C++ language.
Don't need dll only for hooks that work in a single thread in QM process, ie when thread id used with SetWindowsHookEx.
#3
Ok, I think about another way.

Call a filter function, but how to make a function triggered
by *any* window call that filter function?

Setting *.* in class or windows name doesn't work.
#4
window class:
?*
#5
Damned, unusual one, but should have known..

Is there a way anyway to mimic LL keyboard hooks with
only window related messages (like WM_ACTIVATE, WM_QUERYENDSESSION WA_ACTIVE etc)?

I could create a toolbar to handle the messages, or use QM one,
those function won't be deployed as exe, only on my laptop when QM is running.
#6
For all windows - no, need a hook.
For window messages can use another type of hooks - SetWinEventHook. Dll not necessary. QM uses it for window and accessible triggers.
#7
OK, so I presume that QM is using a dll hook to feed the window trigger events?
No way to rely on it or the same feature?

I speak about a trigger like this:

!a"Information." "#32770" "The message was sent successfully." "Static"
#8
Can use only existing triggers. For more events need hooks.
#9
Seems the ?* in filter function does not work either.

Need to find something else.


Forum Jump:


Users browsing this thread: 5 Guest(s)