Darren1 Posted June 19, 2020 Share Posted June 19, 2020 Hi, So I've tried to convert the first code block which uses ControlSend() to work on windows 10 file explorer. The first section of code I found works fine: Run("notepad.exe") $hWin = WinWaitActive("[CLASS:Notepad]") $hControl = ControlGetHandle($hWin,"",15) ControlSend($hWin,"",$hControl,"NEW TEXT!") ControlSend($hWin,"",$hControl,ControlGetText($hWin,"",$hControl) & " MORE TEXT!") But my attempt to use ControlSend on file explorer doesn't. I am trying to type " MORE TEXT!" in the file explorer searchbar. I have made several attempts over the past few hours but sadly nothing has worked (except Send() functions). $Path = "C:\Users\darren\Documents\Starter Pack" Run("C:\WINDOWS\EXPLORER.EXE /n,/e," & $Path) $hWin = WinWaitActive("[CLASS:CabinetWClass]") $hControl = ControlGetHandle($hWin,"",15) ControlSetText($hWin,"",$hControl,"{F3}") ControlSetText($hWin,"",$hControl,ControlGetText($hWin,"",$hControl) & " MORE TEXT!") If anyone knows how I could get a solution using the window's class (CabinetWClass) or search box's class (DirectUIHWND; Instance: 1) that would be great, but any help with ControlSend to file explorer is appreciated. I'm new to AUTOIT so please be gentle. Link to comment Share on other sites More sharing options...
Developers Jos Posted June 19, 2020 Developers Share Posted June 19, 2020 Moved to the appropriate forum, as the AutoIt Example Scripts forum very clearly states: Quote Share your cool AutoIt scripts, UDFs and applications with others. Do not post general support questions here, instead use the AutoIt Help and Support forums. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Darren1 Posted June 22, 2020 Author Share Posted June 22, 2020 Hi, So I've tried to convert the first code block which uses ControlSend() to work on windows 10 file explorer. The first section of code I found works fine: Run("notepad.exe") $hWin = WinWaitActive("[CLASS:Notepad]") $hControl = ControlGetHandle($hWin,"",15) ControlSend($hWin,"",$hControl,"NEW TEXT!") ControlSend($hWin,"",$hControl,ControlGetText($hWin,"",$hControl) & " MORE TEXT!") But my attempt to use ControlSend on file explorer doesn't. I am trying to type " MORE TEXT!" in the file explorer searchbar. I have made several attempts over the past few hours but sadly nothing has worked (except Send() functions). $Path = "C:\Users\darren\Documents\Starter Pack" Run("C:\WINDOWS\EXPLORER.EXE /n,/e," & $Path) $hWin = WinWaitActive("[CLASS:CabinetWClass]") $hControl = ControlGetHandle($hWin,"",15) ControlSetText($hWin,"",$hControl,"{F3}") ControlSetText($hWin,"",$hControl,ControlGetText($hWin,"",$hControl) & " MORE TEXT!") If anyone knows how I could get a solution using the window's class (CabinetWClass) or search box's class (DirectUIHWND; Instance: 1) that would be great, but any help with ControlSend to file explorer is appreciated. I'm new to AUTOIT so please be gentle. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 22, 2020 Moderators Share Posted June 22, 2020 Darren1, Why post the same question again when you have a thread already running? Merged. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
careca Posted June 22, 2020 Share Posted June 22, 2020 Indeed it's curious that the controlsettext function doesnt work, but the *gettext does work. What's up with that? For anyone to test, retrieves the text, and after 2 secs tries to write into it. Opt("SendKeyDelay", 1) $Path = "C:\Users\darren\Documents\Starter Pack" Run("C:\WINDOWS\EXPLORER.EXE /n,/e," & $Path) $hWin = WinWaitActive("[CLASS:CabinetWClass]") $hControl = ControlGetHandle($hWin,"",1001) ConsoleWrite(ControlGetText($hWin, "", 1001 ) &@CRLF) ControlSetText($hWin,"",1001,"Address: 123") Sleep(2000) ControlClick($hWin, "", 1001, "left", 1) Send($Path) That being said, i cant think of anything, any situation when i would need to automate something like that, that couldn't be done in a different way. Maybe if you explain the end goal, we can help in a better way. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe 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