Func MainForm()
; Create UI Automation object
Local $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtag_IUIAutomation )
If Not IsObj( $oUIAutomation ) Then Return ConsoleWrite( "$oUIAutomation ERR" & @CRLF )
Local $pDesktop, $oDesktop
$oUIAutomation.GetRootElement( $pDesktop )
$oDesktop = ObjCreateInterface( $pDesktop, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement )
If Not IsObj( $oDesktop ) Then Return ConsoleWrite( "$oDesktop ERR" & @CRLF )
; --- Find window/control ---
Local $pCondition0
$oUIAutomation.CreatePropertyCondition( $UIA_NamePropertyId, "Континент TLS-клиент", $pCondition0 )
If Not $pCondition0 Then Return ConsoleWrite( "$pCondition0 ERR" & @CRLF )
Local $pWindow1, $oWindow1
$oDesktop.FindFirst( $TreeScope_Children, $pCondition0, $pWindow1 )
$oWindow1 = ObjCreateInterface( $pWindow1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement )
If Not IsObj( $oWindow1 ) Then Return ConsoleWrite( "$oWindow1 ERR" & @CRLF )
; --- найти кнопку Управление сертификатами
Local $pCondition1
$oUIAutomation.CreatePropertyCondition( $UIA_NamePropertyId, "Управление сертификатами", $pCondition1 )
If Not $pCondition1 Then Return ConsoleWrite( "$pCondition1 ERR" & @CRLF )
Local $pText1, $oText1
$oWindow1.FindFirst( $TreeScope_Descendants, $pCondition1, $pText1 )
$oText1 = ObjCreateInterface( $pText1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement )
If Not IsObj( $oText1 ) Then Return ConsoleWrite( "$oText1 ERR" & @CRLF )
UIA_MouseClick( $oText1 )
Sleep(100)
; --- найти кнопку Создать запрос
Local $pCondition1
$oUIAutomation.CreatePropertyCondition( $UIA_NamePropertyId, "Создать запрос", $pCondition1 )
If Not $pCondition1 Then Return ConsoleWrite( "$pCondition1 ERR" & @CRLF )
Local $pText1, $oText1
$oWindow1.FindFirst( $TreeScope_Descendants, $pCondition1, $pText1 )
$oText1 = ObjCreateInterface( $pText1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement )
If Not IsObj( $oText1 ) Then Return ConsoleWrite( "$oText1 ERR" & @CRLF )
UIA_MouseClick( $oText1 )
EndFunc