therms Posted October 13, 2008 Posted October 13, 2008 (edited) The following script returns a list of sound sources available. It works on Vista x32 and not on Vista x64. It seems like ControlListView("Sound", "Playback", "SysListView321", "GetText", $i) is the culprit.Suggestions? The point of the script I'm writing is to change the default sound source (to switch from sound card to usb headset), so if there's a better way to do that than automating the Sound dialog, I'm willing to try that. However, for future reference, I'd really like to know how to "GetText" a 64-bit List Control.#include <Array.au3> $items = ChangeDefSndSrc() _ArrayDisplay($items) ;-------------------------------------------------------------- ; Name: ChangeDefSndSrc ; Description: Toggles between headset sound output and speakers output ;-------------------------------------------------------------- Func ChangeDefSndSrc() Run("control.exe /name Microsoft.AudioDevicesAndSoundThemes") WinWait("Sound", "Playback") WinActivate("Sound", "Playback") $items = ControlListView("Sound", "Playback", "SysListView321", "GetItemCount") Dim $ItemNames[$items] For $i = 0 To $items - 1 ControlListView("Sound", "Playback", "SysListView321", "Select", $i) $EnCheck = ControlCommand("Sound", "Playback", "Button2", "IsEnabled") If $EnCheck = 0 Then $CurrDef = $i EndIf $ItemNames[$i] = ControlListView("Sound", "Playback", "SysListView321", "GetText", $i) Next Return $ItemNames EndFunc ;==>ChangeDefSndSrc Edited October 13, 2008 by therms
therms Posted June 15, 2009 Author Posted June 15, 2009 I just ran into this problem again on a different project. Still can't figure out how to get text from this sort of control.
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