Rawling Posted December 16, 2009 Share Posted December 16, 2009 Hi,I've been automating a set of test for an application, and have had to access an object by its class, which for me is reliably [CLASS:WindowsForms10.window.20808.app.0.218f99c] across builds, different machines etc.However, for my boss, the class is [CLASS:WindowsForms10.window.808.app.0.218f99c], and presumably it'll be different for whoever's running the test.Can anyone point me in the direction of documentation about where these class identifiers come from, so I can try to come up with a better way of predicting what this value needs to be than having the user fire up an inspector and find it for themselves?Cheers. Link to comment Share on other sites More sharing options...
funkey Posted December 16, 2009 Share Posted December 16, 2009 I don't know why they are different, but you can use WinGetClassList th find the classes. You can also select a Control via the Coordinates instead of the ClassNameNN. Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
Rawling Posted December 16, 2009 Author Share Posted December 16, 2009 I don't know why they are different, but you can use WinGetClassList th find the classes. You can also select a Control via the Coordinates instead of the ClassNameNN. Unfortunately the objeect I'm accessing is some system window used as a parent for popup menus - I can't access it by name and text, only by this [CLASS]. Link to comment Share on other sites More sharing options...
Rawling Posted December 16, 2009 Author Share Posted December 16, 2009 Well, a bit more googling leads me to this page, which suggests the part in question is the window style. (Although that doesn't quite match as the article doesn't mention a period between "app" and the app domain.)Which leads me to this page which, combined with looking up those values in VS, leads me to belive that my window has "OptimizedDoubleBuffer" set while my boss's doesn't. I'm not convinced as the trailing 8 doesn't seem to have a corresponding flag. The first 8 is "SupportsTransparentBackColor". Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 16, 2009 Moderators Share Posted December 16, 2009 Rawling, Looking at the Window Titles and Text (Advanced) page in the Help file, I noticed that you can use Regular Expressions to ID windows by class: e.g. List windows matching a classname defined by a regular expression WinList("[REGEXPCLASS:#\d+]")A suitable SRE would be: (?i)(WindowsForms10\.window\..*\.app\.0\.218f99c) which matches both of your window class names. So perhaps you could try: "[REGEXPCLASS:(?i)(WindowsForms10\.window\..*\.app\.0\.218f99c)]" I hope this helps. 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...
Rawling Posted December 16, 2009 Author Share Posted December 16, 2009 Rawling, Looking at the Window Titles and Text (Advanced) page in the Help file, I noticed that you can use Regular Expressions to ID windows by class: A suitable SRE would be: (?i)(WindowsForms10\.window\..*\.app\.0\.218f99c) which matches both of your window class names. So perhaps you could try: "[REGEXPCLASS:(?i)(WindowsForms10\.window\..*\.app\.0\.218f99c)]" I hope this helps. M23 That seems to be working, although I'm having to tweak it to avoid hitting an annoyingly-similarly-named window instead of the correct one. Cheers Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 16, 2009 Moderators Share Posted December 16, 2009 Rawling, It is never simple, is it? Glad I could help. 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...
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