Jump to content

This works on Vista x32, but not Vista x64


therms
 Share

Recommended Posts

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
Link to comment
Share on other sites

  • 7 months later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...