Jump to content

Gui Help Please


Recommended Posts

how do I set volume to this slider

#include <GUIConstants.au3>

GUICreate("My Music Player",400,400, -1,-1)
GUISetBkColor (0x313594); will change background color

$slider1 = GUICtrlCreateSlider (10,10,200,20)
GUICtrlSetLimit(-1,200,0); change min/max value
$button = GUICtrlCreateButton ("Value?",75,70,70,20)
GUISetState()
GUICtrlSetData($slider1,45); set cursor

$start=TimerInit()
Do
  $n = GUIGetMsg ()
     
   If $n = $button Then
      MsgBox(0,"slider1",GUICtrlRead($slider1),2)
   $start=TimerInit()
   EndIf
Until $n = $GUI_EVENT_CLOSE

SoundSetWaveVolume(50)

or

send("{VOLUME_DOWN}") 
send("{VOLUME_UP}")
Edited by Evil_Has_Survived
Thanks in advance
Link to comment
Share on other sites

#include <GUIConstants.au3>

GUICreate("My Music Player",400,400, -1,-1)
GUISetBkColor (0x313594); will change background color

$slider1 = GUICtrlCreateSlider (10,10,200,20)
GUICtrlSetLimit(-1,200,0); change min/max value
$button = GUICtrlCreateButton ("Value?",75,70,70,20)
GUISetState()
$WVol = _SoundGetWaveVolume()
GUICtrlSetData($slider1,$WVol); set cursor

$start=TimerInit()
Do
  $n = GUIGetMsg ()
    
   If $n = $button Then
      MsgBox(0,"slider1",GUICtrlRead($slider1),2)
   $start=TimerInit()
   EndIf
Until $n = $GUI_EVENT_CLOSE

Func _SoundGetWaveVolume()
    Local $WaveVol = -1, $p, $ret
    Const $MMSYSERR_NOERROR = 0
    $p = DllStructCreate ("dword")
    If @error Then
        SetError(2)
        Return -2
    EndIf
    $ret = DllCall("winmm.dll", "long", "waveOutGetVolume", "long", -1, "long", DllStructGetPtr ($p))
    If ($ret[0] == $MMSYSERR_NOERROR) Then
        $WaveVol = Round(Dec(StringRight(Hex(DllStructGetData ($p, 1), 8), 4)) / 0xFFFF * 100)
    Else
        SetError(1)
    EndIf
    $Struct=0
    Return $WaveVol
EndFunc;==>_SoundGetWaveVolume

8)

NEWHeader1.png

Link to comment
Share on other sites

#include <GUIConstants.au3>

GUICreate("My Music Player",400,400, -1,-1)
GUISetBkColor (0x313594); will change background color

$slider1 = GUICtrlCreateSlider (10,10,200,20)
GUICtrlSetLimit(-1,200,0); change min/max value
$button = GUICtrlCreateButton ("Value?",75,70,70,20)
GUISetState()
$WVol = _SoundGetWaveVolume()
GUICtrlSetData($slider1,$WVol); set cursor

$start=TimerInit()
Do
  $n = GUIGetMsg ()
    
   If $n = $button Then
      MsgBox(0,"slider1",GUICtrlRead($slider1),2)
   $start=TimerInit()
   EndIf
Until $n = $GUI_EVENT_CLOSE

Func _SoundGetWaveVolume()
    Local $WaveVol = -1, $p, $ret
    Const $MMSYSERR_NOERROR = 0
    $p = DllStructCreate ("dword")
    If @error Then
        SetError(2)
        Return -2
    EndIf
    $ret = DllCall("winmm.dll", "long", "waveOutGetVolume", "long", -1, "long", DllStructGetPtr ($p))
    If ($ret[0] == $MMSYSERR_NOERROR) Then
        $WaveVol = Round(Dec(StringRight(Hex(DllStructGetData ($p, 1), 8), 4)) / 0xFFFF * 100)
    Else
        SetError(1)
    EndIf
    $Struct=0
    Return $WaveVol
EndFunc;==>_SoundGetWaveVolume

8)

how do I use it lol I turn on my music, and then open the script then iturned down and then up nothing, and good work, but I think I need the volume up and down instead, because I want to set hot keys to sorry, :think: Edited by Evil_Has_Survived
Thanks in advance
Link to comment
Share on other sites

#include <GUIConstants.au3>

$main = GUICreate("My Music Player", 400, 400, -1, -1)
GUISetBkColor(0x313594); will change background color

$slider1 = GUICtrlCreateSlider(10, 10, 200, 20)
GUICtrlSetLimit(-1, 100, 0); change min/max value
$button = GUICtrlCreateButton("Value?", 75, 70, 70, 20)
GUISetState()
$WVol = _SoundGetWaveVolume()
GUICtrlSetData($slider1, $WVol); set cursor

$start = TimerInit()
Do
    $n = GUIGetMsg()
    
    If $n = $button Then
        MsgBox(0, "slider1", GUICtrlRead($slider1), 2)
        $start = TimerInit()
    EndIf
    
    If $WVol <> GUICtrlRead($slider1) Then
        $WVol = GUICtrlRead($slider1)
        ToolTip($WVol)
        SoundSetWaveVolume($WVol)
        Sleep(150)
        ToolTip("")
    EndIf
    
Until $n = $GUI_EVENT_CLOSE

Func _SoundGetWaveVolume()
    Local $WaveVol = -1, $p, $ret
    Const $MMSYSERR_NOERROR = 0
    $p = DllStructCreate("dword")
    If @error Then
        SetError(2)
        Return -2
    EndIf
    $ret = DllCall("winmm.dll", "long", "waveOutGetVolume", "long", -1, "long", DllStructGetPtr($p))
    If ($ret[0] == $MMSYSERR_NOERROR) Then
        $WaveVol = Round(Dec(StringRight(Hex(DllStructGetData($p, 1), 8), 4)) / 0xFFFF * 100)
    Else
        SetError(1)
    EndIf
    $Struct = 0
    Return $WaveVol
EndFunc  ;==>_SoundGetWaveVolume

8)

NEWHeader1.png

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

  • Recently Browsing   0 members

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