Find which MFC child window would receive a mouse click
Posted
by tfinniga
on Stack Overflow
See other posts from Stack Overflow
or by tfinniga
Published on 2010-05-19T17:02:39Z
Indexed on
2010/05/19
17:10 UTC
Read the original article
Hit count: 228
So, I have a plugin to an MFC program. I'm using a mouse event hook (from SetWindowsHookEx) to capture clicks. The host application can have any number of (possibly overlapping) child windows open, but I only want to intercept clicks in a particular child window.
Is there a way to figure out in the hook proc which of the child windows would process the click? I guess it's something like enumerate all child windows, looking at Z-order, but I'm very unfamiliar with the MFC/Win32 libraries, and I'm not able to find any good discussion about how to enumerate all children and calculate which is topmost.
© Stack Overflow or respective owner