Mikesch Posted April 29, 2010 Posted April 29, 2010 (edited) I'd like to know if there's a method of retrieving the current sound output device in Win 7. It's easy in Win XP, but the dialog boxes in Win 7 are not that accessible, at least not for me (or the Au3InfoTool). I made two scripts which simply select the first/second device in the list. That works fine, but I'd like to add a small tooltip which displays the new selection. Thanks in advance, Mike Edited April 29, 2010 by Mikesch
jaberwacky Posted April 29, 2010 Posted April 29, 2010 Post your code please Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
Mikesch Posted April 29, 2010 Author Posted April 29, 2010 Sure. It doesn't even try to read the device name yet, it just does the switching. Anyway, it works with Win 7, (32 & 64) ;select Audio Device from device list; 0-based $ref = 0 ;selects 1st sound device, 1=second device... $SoundPID = Run("control mmsys.cpl") Global $hWnd $aWinList = WinList() For $i = 1 To $aWinList[0][0] If WinGetProcess($aWinList[$i][0]) = $SoundPID Then $hWnd = $aWinList[$i][1] ExitLoop EndIf Next WinWait($hWnd, "") Sleep(300) ControlListView($hWnd, "", "SysListView321", "Select", $ref) Sleep(300) ControlClick($hWnd, "", "Button2") ControlClick($hWnd, "", "Button4") Regards, Mike
jaberwacky Posted April 29, 2010 Posted April 29, 2010 Oh, The first dimension in aWinlist will store a window title and youre checking for a pid? Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
Mikesch Posted April 29, 2010 Author Posted April 29, 2010 Thanks, but this is not about debugging the code I have, it works fine. I just want to know how I can get the name of the device which is selected after the script has done its job. Maybe reading a registry key or the like. The dialog is not very talkative ;-) Mike
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