9/14/2023 0 Comments Norton power eraser stuck at 100![]() ![]() FindFirst ( $TreeScope_Descendants, $pCondition, $pButton ) $oButton = ObjCreateInterface ( $pButton, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) Click (invoke) "Accept" button Local $pInvoke, $oInvoke $oButton. ![]() CreateAndCondition ( $pCondition1, $pCondition2, $pCondition ) If Not $pCondition Then Return ConsoleWrite ( "Accept condition ERR" & ) ConsoleWrite ( "Accept condition OK" & ) Find "Accept" button Local $pButton, $oButton $oWindow. CreatePropertåondition ( $UIA_NamePropertyId, "Accept", $pCondition2 ) $oUIAutomation. ![]() CreatePropertåondition ( $UIA_ControlTypePropertyId, $UIA_ButtonControlTypeId, $pCondition1 ) $oUIAutomation. ![]() ElementFromHandle ( $hWindow, $pWindow ) $oWindow = ObjCreateInterface ( $pWindow, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj ( $oWindow ) Then Return ConsoleWrite ( "Automation element from window ERR" & ) ConsoleWrite ( "Automation element from window OK" & ) Condition to find "Accept" button Local $pCondition, $pCondition1, $pCondition2 $oUIAutomation. MainFunc ( ) Func MainFunc ( ) If ProcessExists ( "NPE.exe" ) = 0 Then ShellExecute ( "C:\temp\NPE.exe" ) EndIf Sleep ( 5000 ) WinWait ( "Norton Power Eraser" ) WinActivate ( "Norton Power Eraser" ) WinWaitActive ( "Norton Power Eraser" ) Sleep ( 5000 ) If WinExists ( "Norton Power Eraser" ) Then WinActivate ( "Norton Power Eraser" ) Local $hWindow = WinGetHandle ( "Norton Power Eraser" ) If Not $hWindow Then Return ConsoleWrite ( "Window handle ERR" & ) ConsoleWrite ( "Window handle OK" & ) Create UI Automation object Local $oUIAutomation = ObjCreateInterface ( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation ) If Not IsObj ( $oUIAutomation ) Then Return ConsoleWrite ( "UI Automation object ERR" & ) ConsoleWrite ( "UI Automation object OK" & ) Get UI Automation element from window handle Local $pWindow, $oWindow $oUIAutomation. Expand collapse popup #include #RequireAdmin ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |