Sign in to follow this  
Followers 0
upnorth

Volume with Slider

1 post in this topic

#1 ·  Posted (edited)

#include <GUIConstants.au3>
Opt("GuiOnEventMode", 1)
Opt("WinTitleMatchMode", 4)


$pig = GUICreate("100%", 200, 20)
GuiSetOnEvent($GUI_EVENT_CLOSE, "quit")
GUISetBkColor (123)
GuiSetState();Display gui

$s = GuiCtrlCreateSlider (0,0,200,20)
GUICtrlSetLimit($s,100,0)
GUICtrlSetData($s,100)

$p = 100
$last = 100

While 1
    Sleep(10)
    $p = GuiCtrlRead($s)
    If $last = $p Then
    Else
        SoundSetWaveVolume($p)
        WinSetTitle ( "handle=" & $pig , "", $p & "%" )
        WinSetTrans ( "handle=" & $pig , "", 155 + $p ); 155 + $p so the win will never be 0% transparency
        $last = $p
       ;MsgBox(0,"","Changed!"); Debuging
    EndIf
wend


Func quit()
Exit
EndFunc

Ok.

Edited by UP NORTH

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