Jambon28 Posted August 6, 2021 Share Posted August 6, 2021 Hi everyone, First of all, thank you for having me onboard, that's my first message here, and I'm not sure I'm posting in the correct section so, I apology if this is not the correct section. Here is an explanation of what I try to do: I find myself changing my display settings several times a day, so I'm currently looking for a way to record these actions in a kind of macro-command. The idea is to record what I'm doing in an executable file so that all I have to do is execute the file to have all the actions automatically done in one step, instead of doing them manually one by one. Basically the actions I'm taking and I'd like to record in my macro-command are: _ I right click on the desktop _ I choose "Display settings" _ I choose "Multiple displays", and I change from "Show only on 1" to "Extend these displays" (or vice versa) Can you please tell me if AutoIt would be a good fit for this purpose, and what would be the steps to take in order to achieve my goal? I have very basic coding skills (I did a bit of Python) and I first want to know is AutoIt is able to do this or not before I even try to use it. Thanks a lot in advance! Link to comment Share on other sites More sharing options...
Earthshine Posted August 6, 2021 Share Posted August 6, 2021 Sure it should be able to do that but it is interesting that you change your settings multiple times a day. I find that puzzling. You’re going to want to search for UI automation in the FAQ 31 area My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Danp2 Posted August 6, 2021 Share Posted August 6, 2021 I haven't researched this, but I imagine that it is possible to complete these actions without resorting to scripting the GUI. Maybe a registry edit or a setting you can toggle using an existing command line utility. Earthshine 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Earthshine Posted August 6, 2021 Share Posted August 6, 2021 (edited) yeah, go with that instead of UI Automation if you can. from what I have seen in google search UIAutomation looks like the way Edited August 6, 2021 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
seadoggie01 Posted August 6, 2021 Share Posted August 6, 2021 (edited) 1 hour ago, Earthshine said: it is interesting that you change your settings multiple times a day I actually used to do this as well. I have two computers and two monitors. In the morning I switch to my work computer by moving the cords from my personal computer. Windows politely remembers your last screen setup, but if you don't plug them in simultaneously then it's two changes. DisplaySwitch.exe is what you're looking for from what I can tell. It won't let you select your primary display, but you can choose how your second screens are used. DISPLAYSWITCH - Windows CMD - SS64.com If you do want to change your primary display at the same time, I think UI Automation or some 3rd party apps are required. StackOverflow is failing me by providing the same answer repeatedly Edit: This will jump you directly to the display settings screen rundll32.exe shell32.dll,Control_RunDLL desk.cpl Edited August 6, 2021 by seadoggie01 Musashi and Jambon28 2 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 August 6, 2021 Share Posted August 6, 2021 That code could give you a head start... Earthshine 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...
Solution Earthshine Posted August 6, 2021 Solution Share Posted August 6, 2021 (edited) Yeah I found this utility from that thread https://www.nirsoft.net/utils/control_my_monitor.html You can control it via the command line so you could do it in AutoIT very easily Edited August 6, 2021 by Earthshine Jambon28 and Musashi 2 My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Jambon28 Posted August 8, 2021 Author Share Posted August 8, 2021 Thanks a lot @Earthshine, it works like a charm! I now use MultiMonitorTool.exe to enable/disable monitors and on Nirsoft website I also found this very handy utility: soundvolumeview-x64 I use it to quickly swap my sound output device. Thanks a lot to all of you guys, what an awesome community! Earthshine 1 Link to comment Share on other sites More sharing options...
Nine Posted August 8, 2021 Share Posted August 8, 2021 For those who may be interested, just made an example script using the same API as the tool mentioned by @Earthshine, but without any external software... Earthshine 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...
Nine Posted August 8, 2021 Share Posted August 8, 2021 Just noticed there is a small bug in nirsoft tool. In the VCP string of capabilities of my primary monitor, there is no space between one capability and the next : Quote (vcp(02 04 05 08 10 12 14(01 05 06 08 0B) 16 18 1A 60(01 03)6C 6E 70 C8 9B 9D 9F 9C A0 9EB0 B6 DF)prot(monitor)type(LCD)cmds(01 02 03 07 0C F3)mccs_ver(2.1)asset_eep(64)mpu_ver(V2.00)model(SA240Y bid)mswhql(1)) Nirsoft omits the 6C capability ! Funny... “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...
argumentum Posted August 15, 2021 Share Posted August 15, 2021 On 8/8/2021 at 4:10 AM, Jambon28 said: I also found this very handy utility: soundvolumeview-x64 😛 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. 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