dranzer006 Posted January 14, 2021 Share Posted January 14, 2021 (edited) Hi, I am using SetValue method to input text into a ComboBox > TextBox the input does works however the string isn't found by the software as it says its invalid value The comobox is a search box which auto completes text sent by the user. I tried using Send("text") but its replaced by 1 in textbox UIA Spy info https://pastebin.com/E05Ux505 i tried using junkew method where _UIA_action($oUIElement,Send("text")) does works however i can't use it for controlling other parts Edited January 14, 2021 by dranzer006 Link to comment Share on other sites More sharing options...
Nine Posted January 14, 2021 Share Posted January 14, 2021 (edited) Normal. Send("anything") returns 1. So it seems that it is working but you do not use it properly. Next time, please post a runable code so we do not have to guess what you are trying to achieve... Edited January 14, 2021 by Nine dranzer006 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
dranzer006 Posted January 15, 2021 Author Share Posted January 15, 2021 Hi this is my code instead of sending "mytext" in editbox it sends 1 there. ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition0 $oUIAutomation.CreatePropertyCondition( $UIA_AutomationIdPropertyId, "PART_EditableTextBox", $pCondition0 ) If Not $pCondition0 Then Return ConsoleWrite( "$pCondition0 ERR" & @CRLF ) ConsoleWrite( "$pCondition0 OK" & @CRLF ) Local $pEdit1, $oEdit1 $oWindow2.FindFirst( $TreeScope_Descendants, $pCondition0, $pEdit1 ) $oEdit1 = ObjCreateInterface( $pEdit1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) If Not IsObj( $oEdit1 ) Then Return ConsoleWrite( "$oEdit1 ERR" & @CRLF ) ConsoleWrite( "$oEdit1 OK" & @CRLF ) Local $pValuePattern1, $oValuePattern1 $oEdit1.GetCurrentPattern( $UIA_ValuePatternId, $pValuePattern1 ) $oValuePattern1 = ObjCreateInterface( $pValuePattern1, $sIID_IUIAutomationValuePattern, $dtag_IUIAutomationValuePattern ) If Not IsObj( $oValuePattern1 ) Then Return ConsoleWrite( "$oValuePattern1 ERR" & @CRLF ) ConsoleWrite( "$oValuePattern1 OK" & @CRLF ) $sValue = Send("mytext") $oValuePattern1.SetValue($sValue) ConsoleWrite( "$oValuePattern1.SetValue()" & @CRLF ) Link to comment Share on other sites More sharing options...
Nine Posted January 15, 2021 Share Posted January 15, 2021 You are doing the same error. Remove the whole Send line, as it returns 1 like I already told you. And use : $oValuePattern1.SetValue("myText") dranzer006 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
dranzer006 Posted January 15, 2021 Author Share Posted January 15, 2021 Thanks, This method does works however the software I am using it won't recognize it as valid text. usually it auto completes the text as I type the first 2/3 words for it. Link to comment Share on other sites More sharing options...
Nine Posted January 15, 2021 Share Posted January 15, 2021 I see. Then remove the whole setValue line and replace it with : Send("myText") It is not the nicest way to set a field but this should work in your situation... dranzer006 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
dranzer006 Posted January 15, 2021 Author Share Posted January 15, 2021 Thanks its working just a one more question, how do i keep oValuePattern1 active or selected ? Link to comment Share on other sites More sharing options...
Nine Posted January 15, 2021 Share Posted January 15, 2021 Try : $oEdit1.SetFocus() BTW, you do not need that ValuePattern portion of your code if you are not using .setValue method... dranzer006 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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