Mbee Posted March 12, 2019 Share Posted March 12, 2019 I use Comodo's free firewall, and I'd love to be able to operate it's GUI using the normal Windows methods, but it was developed using Comodo's own idiosyncratic, non-standard GUI system (jerks!). But since that won't work, I'd appreciate some knowledgeable help. Some history and context: Comodo's Firewall (henceforth CFW) doesn't respond to the normal AutoIt control manipulation for the reason given above. Roughly a year ago, I created a thread regarding this issue: Anything new to help control non-standard GUIs? @Orbs replied with an oblique reference to something wholly unfamiliar to me: the "IUIAutomation UDF". But that was far over my head, and I couldn't even find out if it would work with CFW. A few days ago, I discovered this thread: Using UI Automation Code in AutoIt, by @Larsj, and her/his staggeringly powerful tool, UIASpy. I've tried it out with CFW, but the information it provided was so extensive it was as if it came out of a fire hose! I haven't begun the tutorial because I still can't figure out if it would do what I need easier than simply using the MouseClick() function. So what I'd greatly appreciate knowing whether Larsj's powerful system can readily work with this non-standard GUI. If the answer is a pretty confident "Yes", I'll start learning through the tutorials at first. What do you wise people think? Thanks! BTW: Here's a link to the official Comodo Free Firewall page (not a direct download link): Comodo Free Firewall 2019 Link to comment Share on other sites More sharing options...
caramen Posted March 12, 2019 Share Posted March 12, 2019 (edited) I will help you to give it a try. Me and some other helpers I am sure. Please can you provide us some elements to help us to help you : -First of all start any windows from comodo's firewall. A windows where you have any button. -Then you spy this button information with simple spy then you provide us the complete information from SimpleSpy. -If no one do it before me; I ll give you a line that should work with it and good syntax. (If it work with that kind of GUI.*) Edited March 12, 2019 by caramen Mbee 1 My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Earthshine Posted March 12, 2019 Share Posted March 12, 2019 UIAutomation is what you need to learn My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Mbee Posted March 12, 2019 Author Share Posted March 12, 2019 Thank you, @caramen ! I'm very grateful for your reply and assistance! SimpleSpy is vastly easier to comprehend than UIASpy (no criticism of LarsJ or her/his work intended), so that's very nice indeed. Here's the output of SimplySpy for an important window I need to control... expandcollapse popuphttps://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/?do=findComment&comment=1156373 At least we have an element title: [Advanced Settings Screen] class: [skin_ConfigEditor] Having the following values for all properties: Title is: <Advanced Settings Screen> Class := <skin_ConfigEditor> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) 133;55;1056;681 *** Parent Information top down *** 0: Title is: <COMODO Advanced Settings> Class := <CisMainWizard> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) 133;55;1056;681 "Title:=COMODO Advanced Settings;controltype:=UIA_PaneControlTypeId;class:=CisMainWizard"" ;~ *** Standard code maintainable *** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) _UIA_setVar("oP1","Title:=COMODO Advanced Settings;controltype:=UIA_PaneControlTypeId;class:=CisMainWizard") ;COMODO Advanced Settings ;~ $oUIElement=_UIA_getObjectByFindAll("AdvancedSettingsScreen.mainwindow", "title:=Advanced Settings Screen;ControlType:=UIA_PaneControlTypeId", $treescope_subtree) _UIA_setVar("oUIElement","Title:=Advanced Settings Screen;controltype:=UIA_PaneControlTypeId;class:=skin_ConfigEditor") ;ControlType:=UIA_PaneControlTypeId;classname:=skin_ConfigEditor") ;~ Actions split away from logical/technical definition above can come from configfiles ;~_UIA_Action("oP1","highlight") _UIA_Action("oP1","setfocus") _UIA_action("oUIElement","highlight") ;~_UIA_action("oUIElement","click") ;~ *** Standard code Flexible*** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) Local $oP0=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=COMODO Advanced Settings;controltype:=UIA_PaneControlTypeId;class:=CisMainWizard", $treescope_children) _UIA_Action($oP0,"setfocus") ;~ First find the object in the parent before you can do something ;~$oUIElement=_UIA_getObjectByFindAll("AdvancedSettingsScreen.mainwindow", "title:=Advanced Settings Screen;ControlType:=UIA_PaneControlTypeId", $treescope_subtree) Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=Advanced Settings Screen;ControlType:=UIA_PaneControlTypeId", $treescope_subtree) ;~_UIA_action($oUIElement,"highlight") _UIA_action($oUIElement,"click") *** Detailed properties of the highlighted element *** UIA_title:= <Advanced Settings Screen> UIA_text:= <Advanced Settings Screen> UIA_regexptitle:= <Advanced Settings Screen> UIA_class:= <skin_ConfigEditor> UIA_regexpclass:= <skin_ConfigEditor> UIA_iaccessiblevalue:= < @import url(styles.css); @import url(settings.css); @import url(skin.css); html { prototype: CisHotKey url(HotKey.tis); } div#CE_MainTree { prototype: MainTree; } include "SkinScript.tis"; function doShowTreeItem(srcFrame) { var element = self.select("a[href=\""+srcFrame+"\"]"); if (element) element.postEvent(Event.HYPERLINK_CLICK); } function doCollapseCurrentItem () { var tree = self.select("#CE_MainTree"); var result = false; if(tree) { tree.doCollapsed(tree.currentTreeItem); result = true; } return result; } function doCollapseAllItems() { var tree = self.select("#CE_MainTree"); if(!tree) return false; //Search first level "General Settings" /* var frst = tree.select(".ce_maintree_lvl"); if (frst && frst.expanded) { tree.doCollapsed(frst.first); } */ for(var frst in tree.selectAll(".ce_maintree_lvl")) { if(frst.expanded) tree.doCollapsed(frst.first); } //Search second level items in "Security Settings" for (var par in tree.selectAll(".ce_maintree_lvl_second")) { if (!par.expanded) continue; var chld = par.select(".ce_maintree_lvl_third"); if (chld && chld.expanded) { tree.doCollapsed(chld.first); continue; } tree.doCollapsed(par.first); } return true; } function doActivatePrevLi() { var tree = self.select("#CE_MainTree"); if(tree) { if(tree.prevTreeItem) { tree.doCollapsed(tree.currentTreeItem); tree.doExpanded(tree.prevTreeItem); tree.ActivatePrevLi(); } } } function doSetActiveLi(srcFrame) { var tree = self.select("#CE_MainTree"); if (tree) { var element = self.select("a[href=\""+srcFrame+"\"]"); if(element) { var li = element.parent; if(li.tag == "li") { tree.SetActiveLi(li); tree.doExpanded(li); } else { var div = element.$p(div); if(div) { tree.SetActiveLi(div); tree.doExpanded(div); } } } } } class MainTree: Behavior { var currentTreeItem; var prevTreeItem; function deActivate(element) { if(element) { element.@["active"] = undefined; } } function SetActiveLi(element) { this.deActivate(this.currentTreeItem); this.prevTreeItem = this.currentTreeItem; this.currentTreeItem = element; if(element) { element.@["active"] = "true"; } } function ActivatePrevLi() { if(this.prevTreeItem) { this.SetActiveLi(this.prevTreeItem); } } function doExpanded(item) { var parent = item.parent; if(parent==null) return; switch(parent.@#class) { case "ce_maintree_lvl": { parent.expanded = true; break; } case "ce_maintree_lvl_second": case "ce_maintree_lvl_third": { parent.expanded = true; this.doExpanded(parent); break; } default: this.doExpanded(parent); } } function doCollapsed(item) { var parent = item.parent; if(parent==null) return; //stdout.println("doCollapsed: ", parent, parent.expanded); switch(parent.@#class) { case "ce_maintree_lvl": { parent.expanded = false; break; } case "ce_maintree_lvl_second": case "ce_maintree_lvl_third": { parent.expanded = false; this.doCollapsed(parent); break; } default: this.doCollapsed(parent); } } } Advanced Settings General Settings 1 User Interface N Updates Q Logging O Configuration C Antivirus 2 Realtime Scan C Scans N Firewall 3 Firewall Settings W Application Rules C Global Rules O Rulesets N Network Zones Z Portsets Q HIPS 4 HIPS Settings H HIPS Rules Q Rulesets J Protected Objects K HIPS Groups O Containment 5 Containment Settings N Auto-Containment X File Rating 6 File Rating Settings N File Groups O File List W Submitted Files Q Trusted Vendors V Advanced Protection 7 VirusScope V Scan Exclusions X Device Control C Miscellaneous N Secure Shopping O Website Filtering 8 @import url(forms.css); [hidden] {display: none;} function doShowErrorMsg(errMsg) { var span=self.$(span#errmsg); if (span) { if (!errMsg) { span.style#display = "none"; return; } span.style#display = "block"; span.value = errMsg; } } User Interface Theme: Lycia Theme Classic Theme Arcadia Theme Lycia Theme Modern Theme Language: English (United States) - By COMODO English (United States) - By COMODO ??????? - By Community Português (Brasil) - By Community ????????? - By Community ??(??) - By COMODO ???? - By Community Hrvatski (Croatian) - By Community Ceština - By Community Dansk - By Community Nederlands - By Community Eesti keel - By Community Français - By Community Deutsch - By Community E??????? - By Community Magyar - By Community Italiano - By Community ??? - By Community ????? - By Community Polski - By Community Româna - By COMODO ??????? - By COMODO ?????? - By Community Español - By Community Svenska - By Community Türkçe - By COMODO ?????????? – By Community Ti?ng Vi?t - By Community Show messages from COMODO Message Center Show notification messages Show welcome screen on startup Show desktop widget Show information messages when tasks are minimized/sent to background Play sound when an alert is shown Show the 'Upgrade' button in the main window Show notification messages Enable access only for administrators Password Protection Enable password protection Set Password Please wait... OK Cancel > UIA_iaccessiblechildId:= <2> UIA_handle:= <0> UIA_RuntimeId:= <42;525804;2;2> UIA_BoundingRectangle:= <133;55;1056;681> UIA_ProcessId:= <1264> UIA_ControlType:= <50033> UIA_LocalizedControlType:= <pane> UIA_Name:= <Advanced Settings Screen> UIA_HasKeyboardFocus:= <False> UIA_IsKeyboardFocusable:= <False> UIA_IsEnabled:= <True> UIA_ClassName:= <skin_ConfigEditor> UIA_Culture:= <0> UIA_IsControlElement:= <True> UIA_IsContentElement:= <True> UIA_IsPassword:= <False> UIA_NativeWindowHandle:= <0> UIA_IsOffscreen:= <False> UIA_Orientation:= <0> UIA_IsRequiredForForm:= <False> UIA_IsDockPatternAvailable:= <False> UIA_IsExpandCollapsePatternAvailable:= <False> UIA_IsGridItemPatternAvailable:= <False> UIA_IsGridPatternAvailable:= <False> UIA_IsInvokePatternAvailable:= <False> UIA_IsMultipleViewPatternAvailable:= <False> UIA_IsRangeValuePatternAvailable:= <False> UIA_IsScrollPatternAvailable:= <False> UIA_IsScrollItemPatternAvailable:= <False> UIA_IsSelectionItemPatternAvailable:= <False> UIA_IsSelectionPatternAvailable:= <False> UIA_IsTablePatternAvailable:= <False> UIA_IsTableItemPatternAvailable:= <False> UIA_IsTextPatternAvailable:= <False> UIA_IsTogglePatternAvailable:= <False> UIA_IsTransformPatternAvailable:= <False> UIA_IsValuePatternAvailable:= <False> UIA_IsWindowPatternAvailable:= <False> UIA_ValueIsReadOnly:= <True> UIA_RangeValueValue:= <0> UIA_RangeValueIsReadOnly:= <True> UIA_RangeValueMinimum:= <0> UIA_RangeValueMaximum:= <0> UIA_RangeValueLargeChange:= <0> UIA_RangeValueSmallChange:= <0> UIA_ScrollHorizontalScrollPercent:= <0> UIA_ScrollHorizontalViewSize:= <100> UIA_ScrollVerticalScrollPercent:= <0> UIA_ScrollVerticalViewSize:= <100> UIA_ScrollHorizontallyScrollable:= <False> UIA_ScrollVerticallyScrollable:= <False> UIA_SelectionCanSelectMultiple:= <False> UIA_SelectionIsSelectionRequired:= <False> UIA_GridRowCount:= <0> UIA_GridColumnCount:= <0> UIA_GridItemRow:= <0> UIA_GridItemColumn:= <0> UIA_GridItemRowSpan:= <1> UIA_GridItemColumnSpan:= <1> UIA_DockDockPosition:= <5> UIA_ExpandCollapseExpandCollapseState:= <3> UIA_MultipleViewCurrentView:= <0> UIA_WindowCanMaximize:= <False> UIA_WindowCanMinimize:= <False> UIA_WindowWindowVisualState:= <0> UIA_WindowWindowInteractionState:= <0> UIA_WindowIsModal:= <False> UIA_WindowIsTopmost:= <False> UIA_SelectionItemIsSelected:= <False> UIA_TableRowOrColumnMajor:= <2> UIA_ToggleToggleState:= <2> UIA_TransformCanMove:= <False> UIA_TransformCanResize:= <False> UIA_TransformCanRotate:= <False> UIA_IsLegacyIAccessiblePatternAvailable:= <True> UIA_LegacyIAccessibleChildId:= <2> UIA_LegacyIAccessibleName:= <Advanced Settings Screen> UIA_LegacyIAccessibleValue:= < @import url(styles.css); @import url(settings.css); @import url(skin.css); html { prototype: CisHotKey url(HotKey.tis); } div#CE_MainTree { prototype: MainTree; } include "SkinScript.tis"; function doShowTreeItem(srcFrame) { var element = self.select("a[href=\""+srcFrame+"\"]"); if (element) element.postEvent(Event.HYPERLINK_CLICK); } function doCollapseCurrentItem () { var tree = self.select("#CE_MainTree"); var result = false; if(tree) { tree.doCollapsed(tree.currentTreeItem); result = true; } return result; } function doCollapseAllItems() { var tree = self.select("#CE_MainTree"); if(!tree) return false; //Search first level "General Settings" /* var frst = tree.select(".ce_maintree_lvl"); if (frst && frst.expanded) { tree.doCollapsed(frst.first); } */ for(var frst in tree.selectAll(".ce_maintree_lvl")) { if(frst.expanded) tree.doCollapsed(frst.first); } //Search second level items in "Security Settings" for (var par in tree.selectAll(".ce_maintree_lvl_second")) { if (!par.expanded) continue; var chld = par.select(".ce_maintree_lvl_third"); if (chld && chld.expanded) { tree.doCollapsed(chld.first); continue; } tree.doCollapsed(par.first); } return true; } function doActivatePrevLi() { var tree = self.select("#CE_MainTree"); if(tree) { if(tree.prevTreeItem) { tree.doCollapsed(tree.currentTreeItem); tree.doExpanded(tree.prevTreeItem); tree.ActivatePrevLi(); } } } function doSetActiveLi(srcFrame) { var tree = self.select("#CE_MainTree"); if (tree) { var element = self.select("a[href=\""+srcFrame+"\"]"); if(element) { var li = element.parent; if(li.tag == "li") { tree.SetActiveLi(li); tree.doExpanded(li); } else { var div = element.$p(div); if(div) { tree.SetActiveLi(div); tree.doExpanded(div); } } } } } class MainTree: Behavior { var currentTreeItem; var prevTreeItem; function deActivate(element) { if(element) { element.@["active"] = undefined; } } function SetActiveLi(element) { this.deActivate(this.currentTreeItem); this.prevTreeItem = this.currentTreeItem; this.currentTreeItem = element; if(element) { element.@["active"] = "true"; } } function ActivatePrevLi() { if(this.prevTreeItem) { this.SetActiveLi(this.prevTreeItem); } } function doExpanded(item) { var parent = item.parent; if(parent==null) return; switch(parent.@#class) { case "ce_maintree_lvl": { parent.expanded = true; break; } case "ce_maintree_lvl_second": case "ce_maintree_lvl_third": { parent.expanded = true; this.doExpanded(parent); break; } default: this.doExpanded(parent); } } function doCollapsed(item) { var parent = item.parent; if(parent==null) return; //stdout.println("doCollapsed: ", parent, parent.expanded); switch(parent.@#class) { case "ce_maintree_lvl": { parent.expanded = false; break; } case "ce_maintree_lvl_second": case "ce_maintree_lvl_third": { parent.expanded = false; this.doCollapsed(parent); break; } default: this.doCollapsed(parent); } } } Advanced Settings General Settings 1 User Interface N Updates Q Logging O Configuration C Antivirus 2 Realtime Scan C Scans N Firewall 3 Firewall Settings W Application Rules C Global Rules O Rulesets N Network Zones Z Portsets Q HIPS 4 HIPS Settings H HIPS Rules Q Rulesets J Protected Objects K HIPS Groups O Containment 5 Containment Settings N Auto-Containment X File Rating 6 File Rating Settings N File Groups O File List W Submitted Files Q Trusted Vendors V Advanced Protection 7 VirusScope V Scan Exclusions X Device Control C Miscellaneous N Secure Shopping O Website Filtering 8 @import url(forms.css); [hidden] {display: none;} function doShowErrorMsg(errMsg) { var span=self.$(span#errmsg); if (span) { if (!errMsg) { span.style#display = "none"; return; } span.style#display = "block"; span.value = errMsg; } } User Interface Theme: Lycia Theme Classic Theme Arcadia Theme Lycia Theme Modern Theme Language: English (United States) - By COMODO English (United States) - By COMODO ??????? - By Community Português (Brasil) - By Community ????????? - By Community ??(??) - By COMODO ???? - By Community Hrvatski (Croatian) - By Community Ceština - By Community Dansk - By Community Nederlands - By Community Eesti keel - By Community Français - By Community Deutsch - By Community E??????? - By Community Magyar - By Community Italiano - By Community ??? - By Community ????? - By Community Polski - By Community Româna - By COMODO ??????? - By COMODO ?????? - By Community Español - By Community Svenska - By Community Türkçe - By COMODO ?????????? – By Community Ti?ng Vi?t - By Community Show messages from COMODO Message Center Show notification messages Show welcome screen on startup Show desktop widget Show information messages when tasks are minimized/sent to background Play sound when an alert is shown Show the 'Upgrade' button in the main window Show notification messages Enable access only for administrators Password Protection Enable password protection Set Password Please wait... OK Cancel > UIA_LegacyIAccessibleRole:= <16> UIA_LegacyIAccessibleState:= <0> UIA_IsDataValidForForm:= <False> UIA_ProviderDescription:= <[pid:1264,hwnd:0x0 Main(parent link):Unidentified Provider (unmanaged:cmdhtml.dll)]> UIA_IsItemContainerPatternAvailable:= <False> UIA_IsVirtualizedItemPatternAvailable:= <False> UIA_IsSynchronizedInputPatternAvailable:= <False> At this point, I need to pull down the "Application Rules" pseudo-menu, which it looks like I can bring up with an "Alt C". This looks exceptionally helpful -- thank you enormously! Link to comment Share on other sites More sharing options...
Mbee Posted March 12, 2019 Author Share Posted March 12, 2019 7 hours ago, Earthshine said: UIAutomation is what you need to learn Thanks! That's just what I needed... Link to comment Share on other sites More sharing options...
caramen Posted March 13, 2019 Share Posted March 13, 2019 (edited) ScreenShot of the inspected Control please. (Sry i forgot to ask for it.) Edited March 13, 2019 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Mbee Posted March 13, 2019 Author Share Posted March 13, 2019 (edited) 13 hours ago, caramen said: ScreenShot of the inspected Control please. (Sry i forgot to ask for it.) If the attached screen shots aren't what you are asking for, please let me know and I'll try again. The top one is the target window I want to control. The second is the child window; the other is the main window. Edited March 13, 2019 by Mbee Link to comment Share on other sites More sharing options...
Mbee Posted March 13, 2019 Author Share Posted March 13, 2019 By the way, I tried copying the ";~ *** Standard code maintainable ***" section of the output shown in post 4 above, but while I saw a red rectangle surrounding the window in question and tried to send an Alt C, nothing happened... Link to comment Share on other sites More sharing options...
Mbee Posted March 16, 2019 Author Share Posted March 16, 2019 How should I proceed? 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