I am working on how to get the window handle by using the mouse cursor pointing on the window. The problem is I cannot get the button/text which is inside a tab dialog. I used Spy++ to get the hierarchy, there are 3 layers to reach the desired button. MainWindow (#32770) - Tab1 (#32770) - Btn1 (Button).
Instead of getting the Btn1, I always get the window which is SysTabControl32, it has the same hierarchy level with Tab1, which means I only can reach the SysTabControl32 (not my desired) and could not reach the Tab1.
If I used WindowFromPoint and point my mouse on Btn1, I will get SysTabControl32; using ChildWindowFromPoint, I will get 0 as return value; using RealChildWindowFromPoint, I will get SysTabControl32.
Spy++ only can detect MainWindow, SysTabControl32 and Tab1 but it cannot detect Btn1. I can get all the child windows by using EnumChildWindow but it just shows that those child windows are exist while the ...FromPoint function still cannot find Tab1 and those child windows.
Does anyone know what is the cause of this situation? It seems like the SysTabControl32 (TabCtrl) is blocking the Tab1 (TabDialog), is it? Or the tab structure created by the developer?
Please help.. Thanks