IanN1990 Posted November 18, 2011 Posted November 18, 2011 (edited) Heya, My pc has two audio cards inside, one for my main pc speakers and one for my wireless headphones. I have been using some software called "Coastal Audio Changer" which does kinda work but has always been a bit buggy. So i decided to write something in autoit to do the same task. but i run into a slight problem. Here is the code so far while 1 $a = ControlGetPos('[CLASS:#32770]','','') If IsArray($a) Then If $a[2] >250 And $a[3] >250 Then SendKeepActive("[CLASS:#32770]") Send("{HOME}") send("{Tab 2}") send("{Enter}") WEnd So it sends Home "which selects the top card", then sends 2 tabs and then enter for setting it as default. but i need a way to open this window "see picture below" Anyone have any ideas? *Extra Info Windows 7 Professional N (64bit) Edited April 14, 2012 by IanN1990
IanN1990 Posted November 18, 2011 Author Posted November 18, 2011 {Solved}Run("C:\Windows\System32\control.exe mmsys.cpl") is the answer
KaFu Posted November 18, 2011 Posted November 18, 2011 Maybe you want to take a look at SSD in my signature ... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
IanN1990 Posted November 18, 2011 Author Posted November 18, 2011 (edited) ? a interesting thing would of saved me some time but i have already written my code just needed the "/ to finish it off.I have a autoit.exe that runs at startup. I hot keyed F12 to my script running#NoTrayIcon HotKeySet("^{F12}", "_F12") local $Sound=0 Func _F12() if $Sound=0 Then $Sound=1 run("C:Program Files (x86)Scripts00¦ MiscellaneousMicrosoftWireless.exe") else $Sound=0 run("C:Program Files (x86)Scripts00¦ MiscellaneousMicrosoftMain.exe") EndIf EndFuncRun("C:\Windows\System32\control.exe mmsys.cpl") while 1 sleep(50) $a = ControlGetPos('[CLASS:#32770]','','') If IsArray($a) Then If $a[2] >250 And $a[3] >250 Then SendKeepActive("[CLASS:#32770]") Send("{End}") send("{Tab 2}") send("{Enter 2}") send("{VOLUME_DOWN 50}") Exit EndIf EndIf WEndwhich opens the sound, selects the bottom item which is my main speakers, sets as default, and then decreases the volume by 100andRun("C:\Windows\System32\control.exe mmsys.cpl") while 1 sleep(50) $a = ControlGetPos('[CLASS:#32770]','','') If IsArray($a) Then If $a[2] >250 And $a[3] >250 Then SendKeepActive("[CLASS:#32770]") Send("{Home}") send("{Tab 2}") send("{Enter 2}") send("{VOLUME_UP 50}") Exit EndIf EndIf WEndwhich opens the sound, selects the top item which is my wireless, sets as default, and then increases the volume by 100 **cuz otherwise the headphone transmitter doesn't turn on as it cant hear anything ^^ I do love So Prob not very professional but it works very quickly compared to the software i was using and is 100% effective compared to hit&miss. Edited November 18, 2011 by IanN1990
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