hiepkhachsg Posted May 21, 2016 Posted May 21, 2016 Hi all, i want to find a top level of displaying control class at a point in the window, how can i do it? Any body can give me some advices or suggestions. Thanks in advance.
Moderators JLogan3o13 Posted May 21, 2016 Moderators Posted May 21, 2016 @hiepkhachsg you need to be a bit more specific in your request. If you want to find control and class names you would use the Window Info Tool located in the same directory where you installed AutoIt. How about a detailed example of the window, and what information you're trying to get - help us help you "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
hiepkhachsg Posted May 21, 2016 Author Posted May 21, 2016 (edited) I mean that a function (not W.I.T.) to find a class at a point in the window. I can find what classes have area containing that point but, when it have many layer classes (more than 2 classes) at that point, i don't know what class is the top level layer of displaying (it mean this class will take effect when you click or press a key). Edited May 21, 2016 by hiepkhachsg
mikell Posted May 21, 2016 Posted May 21, 2016 ? #include <WinAPI.au3> HotKeySet("{ESC}", "_exit") Global $g_tStruct = DllStructCreate($tagPOINT) While 1 DllStructSetData($g_tStruct, "x", MouseGetPos(0)) DllStructSetData($g_tStruct, "y", MouseGetPos(1)) ToolTip(_WinAPI_GetClassName(_WinAPI_WindowFromPoint($g_tStruct))) Sleep(100) WEnd Func _exit() Exit EndFunc
hiepkhachsg Posted May 22, 2016 Author Posted May 22, 2016 Thank mikell. I known that, but it use for a window (or point) is displayed on screen. I want to find in window which is hidden behind the others. I stuck when there are many class layers at a point, how to know what class is on top?
junkew Posted May 22, 2016 Posted May 22, 2016 See faq 31 refernces to iuiautomation where you can see in example 1 some ui treewalkers. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
hiepkhachsg Posted May 23, 2016 Author Posted May 23, 2016 (edited) Thank junkew, i've seen your example but it do not solve my problem, you may misunderstand my matter. For example, at a point in the window (of a program) i found 3 classes, with 3 classes containing that point i want to know what a class is on top of displaying !? Edited May 23, 2016 by hiepkhachsg
junkew Posted May 23, 2016 Posted May 23, 2016 Treewalker normally can handle that if you check the boundaries of each traversed window in the three. Simplespy will learn you the windowfrompoint function to give you the class on top. Studying sources from WINE for windowfrompoint will teach you how travrrsing tree work. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now