Kharizmah Posted March 30, 2015 Share Posted March 30, 2015 (edited) junkewI've been researching pretty extensively through your wrapper examples and concepts in order to automate a program I am working with and have come across a snag.I'm hoping you can help me out with this. If I use inspect I can see the toggle state is clearly off. Unfortunately, if I use SimpleSpy I see this. This State does not change whether the button is enabled or disabled. Therefore, this number is unusable.TogglePattern is set to False. So I'm thinking it's not detecting the toggle state at all.I can access the Toggle ID but the result is as expected (2). It's not seeing what inspect.exe is seeing.This is the code I'm using. From the SDK I only pulled Inspect.exe, so I'm going to try installing the entire SDK to see if that updates any of the drivers the wrapper is using.Until then I hope you can contact me with any possible ideas. Thanks In Advance Edited March 31, 2015 by Melba23 Link to comment Share on other sites More sharing options...
LarsJ Posted March 31, 2015 Share Posted March 31, 2015 Are you sure, that you are looking at the same controls with Inspect.exe and SimpleSpy? Several values are different: Inspect.exe SimpleSpy ToggleState 0 2 LegacyIAccessibleRole 43 40 LegacyIAccessibleState 0x100000 0I have compared data between Inspect.exe and SimpleSpy many times. It is my experience that the values are the same for the same controls.You should show the full output from both programs (in textboxes).If you want junkew's attention, you should add "UIAutomation" to the topic title. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Kharizmah Posted March 31, 2015 Author Share Posted March 31, 2015 I don't know how to change the title without starting a new forum. If I need to that please let me know. The programs I am comparing are WinSDK_Inspect_exe_x86.exe and SimpleSpy Perhaps that is different from the inspect.exe you are referring to? I found it by following the directions off of http://stackoverflow.com/questions/8154169/inspect-exe-missing-in-windows-sdk-for-server-2008 Perhaps you are referring to: "C:Program FilesMicrosoft SDKsWindowsv7.0Binx64Inspect.exe" Which is even less useful than Simple Spy. Simple Spy's "cognitive" ability seems to fall into some middle ground between the two. I just need to know if there is a way to bridge the gap? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 31, 2015 Moderators Share Posted March 31, 2015 Kharizmah, I don't know how to change the titleEdit the first post and use the "Full Editor" option to be able to edit the title. But I have done it for you this time - and moved the thread to GH&S. 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 Link to comment Share on other sites More sharing options...
Kharizmah Posted March 31, 2015 Author Share Posted March 31, 2015 @Melba23 Awesome. Thanks . @LarsJ It doesn't seem to matter whether I look at: LegacyIAccessibleRole LegacyIAccessibleState ToggleState The problem is they don't change when the button is enabled or disabled. If any of these or any other values did show an active response, I certainly would use it. Link to comment Share on other sites More sharing options...
Solution Kharizmah Posted March 31, 2015 Author Solution Share Posted March 31, 2015 Nevermind, The problem lies with the coder - as usual. It's true simple spy is not registering the Toggle.state but that could be due to the continuing depths of the WPF framework. However, it turned out I was just at the wrong level on the path. The wrapper was able to sense the toggle state - even if it isn't reporting it. That's really all that matters. Link to comment Share on other sites More sharing options...
junkew Posted April 1, 2015 Share Posted April 1, 2015 although answered alternate ways are 1. to watch the events that are happening sometimes they reveal more 2. simplespy uses the plain iuiAutomation logic to determine a window and sometimes that gives wrong directions (for understanding this use simplespy on an MS Access Form textbox and press ctrl+w and compare it to the tree of inspect.exe). To circumvent this you should scan the whole tree and check all controls and compare the location of mouse to location of all controls (far slower then getelementfrompoint) 3. for togglestate logic not implemented on many controls I fall back to checking the area for a certain color like pixelgetcolor or pixelchecksum to now if its on/off/true/false FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
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