0

I have a LowLevelMouseProc implemented. When the user clicks the center mouse button I call WindowFromPoint to get the window at that point.

What I want to do is be able to get the object that is actually being clicked on within the window at that point.

For example, if a user center clicks on a directory within a file browser window, I'd like to be able to get the name of the directory.

Sean
  • 447
  • 1
  • 4
  • 15
  • In the general case, that is impossible. The app could be drawing its UI using whatever mechanism / framework it wants. – Peter Torr - MSFT Apr 07 '15 at 01:32
  • OK, but at some level the object I'm center clicking on has to be represented as some windows GUI struct or object in memory. Along with that object would be some type and an associated string if the object has text. So how would I get to that text. I don't even really care about the type. I'd really just like to get the text of what I'm clicking on. If I need to write a kernel mode driver to do it, I will. I just figured I could do it from user land. – Sean Apr 07 '15 at 02:01
  • I essentially want to be able to take a POINT struct with an X and a Y and be able to get the displayed text, if any, of the object occupying those coordinates. – Sean Apr 07 '15 at 02:03
  • What is your end goal? For an example of what is possible, look at Spy++ in the Windows SDK. As more and more apps move away from using basic Windows controls, it gets harder and harder. – Peter Torr - MSFT Apr 07 '15 at 04:56
  • 1
    Your best bet is probably to use an accessibility API but it's not guaranteed to give you what you want if the app didn't take that into consideration. – Peter Torr - MSFT Apr 07 '15 at 06:11

0 Answers0