Sign in to follow this  
Followers 0
therms

This works on Vista x32, but not Vista x64

3 posts in this topic

#1 ·  Posted (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 by therms

Share this post


Link to post
Share on other sites



Any thoughts?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0