Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Disabling a button in an Internet Explorer_Server instance using IUIAutomation

$
0
0

Hello everyone,

 

I support an application which has an Internet Explorer_Server instance in a pane of the application. There are a few buttons we would like to disable in the application, as it causes many an issue whenever users click on the buttons. The buttons which are part of the application/program are easy to disable (there was a "Print" button which we have disabled this way, thus forcing the user to use the "File->Print" option as that is the preferred method) but those which are part of the Internet Explorer_Server pane were inaccessible. Enter Junkew's IUIAutomation UDF.

 

I've been trying to follow the threads regarding IUIAutomation, and while I've been able to highlight the button (which in itself is a great accomplishment in my view) I can't find a way to disable said button. Is this even possible? If this were a regular button, I could get the handle of the control and manipulate it that way. I understand that the "automation" part doesn't include disabling items (who does that, right?) but I was wondering if someone savvier than myself knew of a method to do this.

 

Below is the code provided by simple spy (which I commented out to use the shorter version of the program at the end) Some information has been removed, but it was mostly to protect innocent servers. :-) Any guidance/assistance would be greatly appreciated.

 

Plain Text         
#include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) #cs Local $oP13=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=[Horizon Ambulatory Care];controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app4", $treescope_children) _UIA_Action($oP13,"setfocus") Local $oP12=_UIA_getObjectByFindAll($oP13, "Title:=Workspace;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.MDICLIENT.app4", $treescope_children) _UIA_Action($oP12,"setfocus") Local $oP11=_UIA_getObjectByFindAll($oP12, "Title:=Horizon Ambulatory Care;controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app4", $treescope_children) _UIA_Action($oP11,"setfocus") Local $oP10=_UIA_getObjectByFindAll($oP11, "Title:=;controltype:=UIA_PaneControlTypeId;class:=Shell Embedding", $treescope_children) _UIA_Action($oP10,"setfocus") Local $oP9=_UIA_getObjectByFindAll($oP10, "Title:=;controltype:=UIA_PaneControlTypeId;class:=Shell DocObject View", $treescope_children) _UIA_Action($oP9,"setfocus") Local $oP8=_UIA_getObjectByFindAll($oP9, "Title:=info.sys:12200/hac/clinical/frame/showMainFrame;controltype:=UIA_PaneControlTypeId;class:=Internet Explorer_Server", $treescope_children) _UIA_Action($oP8,"setfocus") Local $oP7=_UIA_getObjectByFindAll($oP8, "Title:=HAC;controltype:=UIA_PaneControlTypeId;class:=", $treescope_children) Local $oP6=_UIA_getObjectByFindAll($oP7, "Title:=info.sys:12200/hac/clinical/frame/showRootFrame;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children) Local $oP5=_UIA_getObjectByFindAll($oP6, "Title:=Root Frame Page;controltype:=UIA_PaneControlTypeId;class:=", $treescope_children) Local $oP4=_UIA_getObjectByFindAll($oP5, "Title:=info.sys:12200/hac/clinical/workFlow/worklist/tabBarHandler/showFrameSet?activeTab=0;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children) Local $oP3=_UIA_getObjectByFindAll($oP4, "Title:=;controltype:=UIA_PaneControlTypeId;class:=", $treescope_children) Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=info.sys:12200/hac/clinical/workFlow/worklist/showWorklist;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children) Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=Worklist;controltype:=UIA_PaneControlTypeId;class:=", $treescope_children) Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=;controltype:=UIA_CustomControlTypeId;class:=", $treescope_children) ;~ First find the object in the parent before you can do something ;~$oUIElement=_UIA_getObjectByFindAll("Delete.mainwindow", "title:=Delete;ControlType:=UIA_ButtonControlTypeId", $treescope_subtree) Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=Delete;ControlType:=UIA_ButtonControlTypeId", $treescope_subtree) ConsoleWrite("Value: " & _UIA_action($oUIElement,"right") & @CRLF) #ce _UIA_SetVAR("HACWindow","Title:=[Horizon Ambulatory Care];controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app4") _UIA_SetVAR("TaskListPane","Title:=Worklist;controltype:=UIA_PaneControlTypeId;class:=") _UIA_SetVAR("DeleteButton","title:=Delete;ControlType:=UIA_ButtonControlTypeId") ConsoleWrite("HAC? " & _UIA_Action("HACWindow","setfocus") & @CRLF) ConsoleWrite("Pane? " & _UIA_Action("TaskListPane","setfocus") & @CRLF) ConsoleWrite("Button? " & _UIA_Action("DeleteButton","highlight") & @CRLF)

 


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>