Jump to content
Sign in to follow this  
Samhayne

How to show Windows' Mixer volume bar?

Recommended Posts

Samhayne

Hi!

Is there a way to show Windows' SndVol32.exe Volume Mixer without doing a pixel-coordinated click on the speaker icon in the tray?

I can't find a way.

Posted Image

Tried this one but the volume icon doesn't seem to be a tray icon. :)

(I'd like to call a script showing the volume bar whenever I hit the + / - multimedia keys on my keyboard)

Edited by Samhayne

Share this post


Link to post
Share on other sites
Samhayne

In Vista sndvol.exe calls the mixer, but I don't know if that's all u'd like to know :)

Or SndVol32.exe ... hehe no.

I'd like the volume window to pop up by script. :(

Share this post


Link to post
Share on other sites
weaponx

Run('"C:\WINDOWS\system32\SNDVOL32.EXE" /t')

Share this post


Link to post
Share on other sites
Samhayne

Run('"C:\WINDOWS\system32\SNDVOL32.EXE" /t')
Nope... this opens the full mixer window... I just want the pop up (picture in the first post) you get when you click the speaker tray icon once... and which disappears as soon as you click somewhere else.

=> a visual feedback when turning up/down the sound volume with multimedia keys on the keyboard

Edited by Samhayne

Share this post


Link to post
Share on other sites
weaponx

Nope... this opens the full mixer window... I just want the pop up (picture in the first post) you get when you click the speaker tray icon once... and which disappears as soon as you click somewhere else.

=> a visual feedback when turning up/down the sound volume with multimedia keys on the keyboard

It works in XP. I grabbed the command line by running Sysinternals Process Explorer, then clicking the sound icon. When I saw the new entry pop up in the list of processes I checked the properties to get the command line. Perhaps the command line is different in Vista or it may not even open a new process.

Share this post


Link to post
Share on other sites
GaryFrost

Needs beta, works on XP

Modified from other post.

#NoTrayIcon
#Include <GuiToolBar.au3>

_SysTray_ClickItem("Volume", "left", 1)

;====================================================================================
;
;Function Name:    _SysTray_ClickItem()
;Description:      Click on item in Windows system tray by any substring in the title
;Parameters:       $iTitle - The title of the item in Windows system tray (you can see the title of the item when mouse cursor hovered on item).
;                  $iButton - [optional] The button to click, "left" or "right". Default is the left button.
;                  $iClick - [optional] The number of times to click the mouse. Default is 2
;                 
;Return Value(s):  None
;Requirement(s):   AutoIt 3.2.10.0
;
;
;Autor(s):        R.Gilman (a.k.a rasim); Siao (Thanks for idea smile.gif)
;
;====================================================================================
Func _SysTray_ClickItem($iTitle, $iButton = "left", $iClick = 2)
    Local $hToolbar, $iButCount, $i
   
    If Not $iTitle Then
        MsgBox(16, "Error", "Please indicate title")
        Return 0
    EndIf
   
    $hToolbar = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]')
    If @error Then
        MsgBox(16, "Error", "System tray not found")
        Return 0
    EndIf
   
    $iButCount = _GUICtrlToolbar_ButtonCount($hToolbar)
    If $iButCount = 0 Then
        MsgBox(16, "Error", "Not found item in system tray")
        Return
    EndIf
   
    For $i = 0 To $iButCount - 1
        $cID = _GUICtrlToolbar_IndexToCommand($hToolBar, $i)
        If StringInStr(_GUICtrlToolbar_GetButtonText($hToolBar, $cID), $iTitle) Then
              _GUICtrlToolbar_ClickButton($hToolbar, $cID, "left", False, $iClick)
            Return 1
        EndIf
    Next
    MsgBox(48, "Fail", "Required item not found")
EndFunc

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites
Samhayne

Thx! :)

Run('"C:\WINDOWS\system32\SNDVOL.EXE" -f 0')

worked.

(dunno how I came to sndvol32.exe ... too much google I guess. :D )

==

Thx Gary, too. :(

Edited by Samhayne

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  

×