Hello,
I'm interested how to catch mouse events with c++. I tried to use SetWindowsHookEx, but I catch only the events when the cursor is in my app.
My OS is Windows XP and I use Borland C++ Builder 6.0
Printable View
Hello,
I'm interested how to catch mouse events with c++. I tried to use SetWindowsHookEx, but I catch only the events when the cursor is in my app.
My OS is Windows XP and I use Borland C++ Builder 6.0
Sounds like your code is creating a local hook instead of a remote one...Did you include your hook procedure in a DLL (Global hooks require the procedure to be in a DLL)? It's also very import to use shared memory sections correctly when working with global hooks...There's a lot of information out there on this sort of thing, you just have to google for it...
I search for this, but found VB code and components. You say that I must include my hook procedure in dll. And that procedure to catch and work with the hooks?
Have you tried a mouse trap?
I'm sorry, I just couldn't help myself. Just thought I would help brighten the Monday morning.
-Deeboe
Your DLL would contain some basic functions like
InstallHook
UninstallHook
HookProc
The first two are self explanitory, HookProc is the code you want to execute qhwn your hook is called...
What are you catching mouse events for?