Insert Username with UIA (UI automation)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
daywalker
Posts: 32
Joined: 18 Jun 2019, 01:37

Insert Username with UIA (UI automation)

01 Jul 2020, 05:52

I used this wrapper from jethrow
https://github.com/jethrow/UIA_Interface/blob/master/UIA_Interface.ahk
trying to insert with UIA the username to windows security question.
Unfortunalty username does not insert. Anyone who has a idea?
Thank you!

Code: Select all

#include UIA_Interface.ahk

hwnd:= WinExist("Windows-Sicherheit ahk_class Credential Dialog Xaml Host")

uia := UIA_Interface()
xd := uia.ElementFromHandle(hwnd)
condition_user := uia.CreateAndConditionFromArray([uia.CreatePropertyCondition(UIA_ControlTypePropertyId := 30003, button := 50004, VT_I4 := 3), uia.CreatePropertyCondition(UIA_NamePropertyId := 30005, "Benutzername", VT_BSTR := 8)])
element_user := xd.FindFirst(condition_user, TreeScope_Element := 0x1)
IAccessible := element_user.GetCurrentPatternAs("LegacyIAccessible")
IAccessible.SetValue(A_username)
Attachments
Security.jpg
Security.jpg (16.86 KiB) Viewed 793 times

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: gongnl, hedehede81, ThePeter and 245 guests