System hooks? 
Author Message
 System hooks?


Quote:
> Is it possible to write system-wide hooks (Such as WH_MOUSE.) in MC++? If
so
> can someone point me to sample code?

> On a related note - I alredy have an unmaneged C++ DLL containing a system
> hook. Is it possible for the unmanaged system hook to call into the MC++
> code to notify it of mouse events? If so anyone have sample code?

> Thanks for any information!

George,

There is no explicit support in the runtime for system-wide hooks.  However,
w/ MC++ and its native inter-op, you can roll your own easily from your
native
version.

We're going to assume you already have the normal SDK level information
on window system level hooks. (the link is included below too).  All that
information should apply.  Basically, your existing code should work when
compiling with /CLR and that will give you access to the runtime functions.

Of course ALL normal system hook caveats apply.  You impact the
whole system so be careful out there.

http://www.*-*-*.com/

--
Mukul Kumar
Bob Davidson

Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no rights.



Tue, 22 Mar 2005 02:51:38 GMT  
 System hooks?
Thank you Mukul. I'll complie the unmanaged .DLL with /CLR.



Quote:



> > Is it possible to write system-wide hooks (Such as WH_MOUSE.) in MC++?
If
> so
> > can someone point me to sample code?

> > On a related note - I alredy have an unmaneged C++ DLL containing a
system
> > hook. Is it possible for the unmanaged system hook to call into the MC++
> > code to notify it of mouse events? If so anyone have sample code?

> > Thanks for any information!

> George,

> There is no explicit support in the runtime for system-wide hooks.
However,
> w/ MC++ and its native inter-op, you can roll your own easily from your
> native
> version.

> We're going to assume you already have the normal SDK level information
> on window system level hooks. (the link is included below too).  All that
> information should apply.  Basically, your existing code should work when
> compiling with /CLR and that will give you access to the runtime
functions.

> Of course ALL normal system hook caveats apply.  You impact the
> whole system so be careful out there.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winu...

- Show quoted text -

Quote:
> /windowsuserinterface/windowing/hooks.asp

> --
> Mukul Kumar
> Bob Davidson

> Visual C++ Team
> This posting is provided "AS IS" with no warranties, and confers no
rights.



Tue, 22 Mar 2005 21:38:48 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. system hook

2. Keyboard System Hook: where?

3. System hooks in NT

4. Generating keypress...after getting input from system hook

5. norton/system hook incompatibility?

6. System hooks in NT

7. 32 bit Global Subclassing win System Hook Proc.

8. System wide Message Hook not working when caller app loses focus

9. Creating system wide keyboard Hooks with c#

10. Hook file-system activity

11. system wide hook

12. CBT Hook & weird system behavior

 

 
Powered by phpBB® Forum Software