Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Win32 hooks (WH_MOUSE)

Posted on 1998-11-06
3
Medium Priority
?
1,441 Views
Last Modified: 2009-06-10
Hello all!

I have problem establishing Win32 hook for mouse events (WH_MOUSE). When mouse cursor is in main frame window boundaryes everithing is ok, my hook is called, but when
mouse cursor leaves window, my hook function is not called.
Who can explain me wats metter?
Thenk you beforehend. George.
0
Comment
Question by:george_777
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 320 total points
ID: 1177115
Yes. The problem is, that when you want to capure events that are not related to your application's window, the hook proc must reside in a DLL, as system-wide hooks are simply mapped into the other processes' addres spaces. Additionally, when calling 'SetWindowsHookEx()', you'll have to set the thread id to '0' and provide the DLL's instance handle (obtained via 'LoadLibrary()'). If you need an example, feel free to ask and i'll mail it to you.
0
 

Author Comment

by:george_777
ID: 1177116
Thank you very much jkr!
Everything works good!
0
 

Expert Comment

by:sergiob2004
ID: 12653785
No way, at least under Windows XP + SVP2 WH_MOUSE won't go global, you must use WH_MOUSE_LL instead.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

598 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question