Catorcio63 Posted September 27, 2016 Posted September 27, 2016 I started using AutoIt (v3.3.14.2) a couple of weeks ago. I notice a problem with Au3Info. After setting the mouse coordinates mode to "client", I click in an entry in the menu bar of an application (whatever application with a menu bar) and I notice that the mouse coordinates are relative to the client area of the main window of that application, as expected. The click on the menu bar entry causes the corresponding menu list to pop up and now I move the mouse cursor on an entry of that menu list. This time I notice that the mouse coordinates are relative to the client area of the menu list (vs the client area of the main window). The problem rises when using those coordinates in an AutoIt script. So, in the script, I set Opt("MouseCoordMode", 2) ; 0=relative, 1=absolute, 2=client then I activate the application, then I issue a first mouse click (MouseClick function) with the coordinates of the menu bar entry, and the script clicks in the right place and opens the menu list, then I issue a second mouse click with the coordinates of the menu list entry detected with Au3Info. But in the script execution, those coordinates are relative to the client area of the main window (vs the client area of the menu list detected with Au3Info), so the click ends up in the wrong place. The same problem occurs by setting the mouse coordinates mode of Au3Info to "window".
bloopie Posted September 27, 2016 Posted September 27, 2016 (edited) Hello Catorcio63 and welcome, Have you tried setting the Opt with MouseCoordMode = 0 ?...like this: Opt("MouseCoordMode", 0) <-- This sets coords relative to the active Window. ...Or you can do the following, which is the same thing: AutoItSetOption("MouseCoordMode", 0) Then also set Au3Info to "Window", so the finder tool knows what coordinates you're looking for. ...Then by using the "Position" coordinates under the Mouse Tab in Au3Info, you should get the correct clicks. Let us know how it goes! bloopie Edited September 27, 2016 by bloopie clarification Malware Response Instructor @ BC
Catorcio63 Posted September 28, 2016 Author Posted September 28, 2016 Dear bloopie, as I wrote in my original post, the same problem occurs by setting Au3Info to "Window". The problem is that in Au3Info, setting "Coord Mod" to "Client" or "Window" refers to the client or window area of the control under the mouse, while in a script, setting Opt("MouseCoordMode", 0 or 1) refers to the client or window area of the main window of the active application. Which is inconsistent. Unfortunatelty, it is not possible to report the Au3Info version. Help > About just shows this text: --------------------------- About --------------------------- AutoIt v3 Window Information. ©2003-2015 Jonathan Bennett & AutoIt Team Web: http://www.autoitscript.com/autoit3/ Email: support@autoitscript.com --------------------------- OK --------------------------- However, I downloaded Au3Info from the AuoIt site about 2 weeks ago (middle of September 2016). Regards.
bloopie Posted September 28, 2016 Posted September 28, 2016 (edited) Hello again, While sometimes inconsistent, I just wanted to let you know what usually works for me. Could you post some of the Au3Info summaries and maybe the whole part of the script related to the clicks, so we can see what you're working with? ...MouseClicks aren't always the best for some applications. I usually steer clear of MouseClicks and use ControlClicks whenever possible, so with some more information, we'll see what else we have to work with to come up with a solution. bloopie Edited September 28, 2016 by bloopie Malware Response Instructor @ BC
Catorcio63 Posted September 29, 2016 Author Posted September 29, 2016 Hello Bloopie, as (I hope) you can see in the picture, the x mouse coordinate 52 is clearly relative to the menu pane. Using that coordinate in the script issues a click at x coordinate 52 with respect to the main window, i.e. in the black area of the picture. After looking at the Au3Info summary, which control ID do you suggest to use with ControlClick? About finding a solution, I just calculated "manually" the right coordinates. Regards.
bloopie Posted September 29, 2016 Posted September 29, 2016 (edited) Hello again, Quote After looking at the Au3Info summary, which control ID do you suggest to use with ControlClick? Ahhh, it doesn't look like the tool can see much of the application in the first place, so you're better off using MouseClicks with this particular one.... Had there been some instances listed there, I would use the "Advanced (Class):" control. It seems to be the most reliable with ControlClick, and I've had much success with that ID. Quote About finding a solution, I just calculated "manually" the right coordinates. Excellent...I'm glad you got it sorted! Just out of curiosity, what were the coordinates you used? ========== After seeing the summary, I don't think this issue was with the Finder Tool, or with Autoit...it looks like the application itself that was causing it (but that's just a guess). Thanks for posting the screenshot and summary, it helped quite a bit! Best Regards, bloopie Edited September 29, 2016 by bloopie smiley issue :( Malware Response Instructor @ BC
Catorcio63 Posted October 4, 2016 Author Posted October 4, 2016 Hello Bloopie, unfortunately, this Au3Info problem does not occur only with that particular application. Can we agree that it is a bug? By the way, are you part of the AutoIt team? I mean, can you present this problem to the developers? I have another problem, for which I open a separate post. Best regards.
bloopie Posted October 4, 2016 Posted October 4, 2016 Hello again, No, I'm not part of the AutoIt team, and this doesn't really need to be elevated to the developers because I'm sure it's not a bug with Au3Info, or with AutoIt. This thread is public, and I'm sure some of the developers have already seen it. The Au3Info finder tool can't possibly work with every application (this is noted in the documentation)...and the tool is only reporting back what it can "see" in a given window or application. It's up to the applications themselves to present more information that the finder tool can "see", and that you can then utilize. bloopie Malware Response Instructor @ BC
Catorcio63 Posted October 5, 2016 Author Posted October 5, 2016 Well, I'll try to be proactive, hoping that a Au3Info developer will read and consider the following. I think that the problem would be fixed by implementing the following requirement: " If Au3Info is in "Window" (or "Client") "Coord Mod" and Au3Info cannot get any information about the control currently under the mouse cursor, then the mouse coordinates presented in the Au3Info GUI are relative to (client area of) the main window of the application currently under the mouse cursor". Regards.
Moderators Melba23 Posted October 5, 2016 Moderators Posted October 5, 2016 Catorcio63, I suggest you open a Trac ticket, then the matter will definitely be seen by the Devs - you can also use the "BugTracker" tab in the menu at the top of the page M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
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