seadoggie01 Posted January 14, 2021 Share Posted January 14, 2021 (edited) Does UI Automation work with hidden windows? I've never needed to interact with one before, so I haven't tried Edit: Nope, completely hidden windows (set with @SW_Hide) don't appear in the tree anymore. There may be another fancy way to find them, but that's beyond me. Mentioned here Edited January 14, 2021 by seadoggie01 All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
Nine Posted January 14, 2021 Share Posted January 14, 2021 (edited) Yes you can if the object has the InvokePatternAvailable, you can use the invoke method to click or select the control. Retracting you cannot, as far as my current test goes... Edited January 14, 2021 by Nine “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...
seadoggie01 Posted January 14, 2021 Share Posted January 14, 2021 UI Automation does work if you move the window completely off the screen, however. It's not as nice as hidden, but it could work. Has anyone tried executing code in a new/separate desktop (like in Windows 10)? I'd be interested to see how well it works. It would be annoying if there were flashing icons from activating windows though. All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
Nine Posted January 14, 2021 Share Posted January 14, 2021 Agree, but if you invoke secondary windows (like save as) it will appear on your screen. seadoggie01 and PHAK 2 “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...
PHAK Posted January 14, 2021 Author Share Posted January 14, 2021 @Nine Finally, what do you suggest for Installer there is no silent switch And let there be hidden windows ? Link to comment Share on other sites More sharing options...
Earthshine Posted January 14, 2021 Share Posted January 14, 2021 Yes, if you can hide it, he says it should work, or you could move it off screen so it isn't visible. PHAK 1 My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
PHAK Posted January 14, 2021 Author Share Posted January 14, 2021 (edited) 2 hours ago, Earthshine said: Yes, if you can hide it, he says it should work, or you could move it off screen so it isn't visible. Well How do I hide? Of course, also install 😀 I would love an example Thank you Edited January 14, 2021 by PHAK Link to comment Share on other sites More sharing options...
abberration Posted January 14, 2021 Share Posted January 14, 2021 What about just minimizing the window? I haven't tried this, but maybe that could be an option. PHAK 1 Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
Earthshine Posted January 15, 2021 Share Posted January 15, 2021 (edited) I don’t even know what application you want to minimize or hide so how could I give you an example? Edited January 15, 2021 by Earthshine PHAK 1 My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
JockoDundee Posted January 15, 2021 Share Posted January 15, 2021 8 hours ago, PHAK said: for Installer there is no silent switch... and in space no one can hear you scream. Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
Nine Posted January 15, 2021 Share Posted January 15, 2021 1 hour ago, abberration said: What about just minimizing the window? Depends on the selected solution. For example, with UIAutomation, some actions cannot be done on a minimized window. Of course, send and mouseClick will not work...Unfortunately, there is no general guidelines. Just use the solution that works on that specific installer. abberration and PHAK 1 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...
JockoDundee Posted January 15, 2021 Share Posted January 15, 2021 13 hours ago, PHAK said: Well How do I hide? Of course, also install 😀 I would love an example Thank you PHAK 1 Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
PHAK Posted January 15, 2021 Author Share Posted January 15, 2021 11 hours ago, abberration said: What about just minimizing the window? I haven't tried this, but maybe that could be an option. Not good for me Only hide window Not to see 9 hours ago, Earthshine said: I don’t even know what application you want to minimize or hide so how could I give you an example? Take for example https://www.goldwave.com/download.php?file=gw (I know it has a quiet switch) This is just an example to understand idea What to do for software that does not have a silent switch Install Hidden Link to comment Share on other sites More sharing options...
Earthshine Posted January 15, 2021 Share Posted January 15, 2021 look here to move the window off screen Function WinMove (autoitscript.com) PHAK 1 My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
PHAK Posted January 16, 2021 Author Share Posted January 16, 2021 (edited) 23 hours ago, Earthshine said: look here to move the window off screen Function WinMove (autoitscript.com) Not good not helping Need to hide What to do? You have an idea? With ControlClick possible? Edited January 16, 2021 by PHAK Link to comment Share on other sites More sharing options...
JockoDundee Posted January 16, 2021 Share Posted January 16, 2021 3 hours ago, PHAK said: Need to hide WinMove($myWindow, "", -10000, -10000) Can you still see $myWindow? PHAK 1 Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
Subz Posted January 16, 2021 Share Posted January 16, 2021 Been software packager for a number of years and in my experience when you come across software with no switches, we just repackage the software completely, we install the software, identify the changes on the system (registry, files/folders) and then use something like InnoSetup (free) to recreate the installer, this gives us the benefit of installing/uninstalling silently. Software like InstallShield can also do this for you however it's expensive (we pay approx $20k per license), but this allows us to repackage software as an msi, although we only do this if an exe doesn't have silent switches. The issue with functions like ControlClick, ControlSend etc... is that users can break the install easily. Just my 2 cents. PHAK and Earthshine 2 Link to comment Share on other sites More sharing options...
PHAK Posted January 17, 2021 Author Share Posted January 17, 2021 How to use the ControlClick function? #RequireAdmin RunWait(@ScriptDir & '\A.exe') $hWindow = WinWait("Install") $iReturnValue = ControlClick($hWindow, "", "[CLASS:Button; INSTANCE:4]") #RequireAdmin RunWait(@ScriptDir & '\A.exe') Local $hWnd = WinWait("[CLASS:#32770]", "", 10) ControlClick($hWnd, "", "Button4") Nothing good how do I do it? And what do I add That it will be hidden from beginning to end 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