Nova Posted December 29, 2004 Posted December 29, 2004 (edited) Im trying to create a guictrlslider which will change the wavevolumeoutputProblem:When the slider is moved the volume dosent change !Possible reason:I think the problem is with GUICtrlSetLimit($min,$max,0) the varibles $min and $max are d_word values as required by the dllcall but I dont think GUICtrlSetLimit will adcept d_word valuesAm I right ?expandcollapse popup#include <GUIConstants.au3> Opt("GuiOnEventMode", 1) $min = "0x0000" $max = "0xffff" $start_value = "0x0000" GUICreate("Volume",220,100, 100,200) $slider = GuiCtrlCreateSlider (10,10,200,20) GUICtrlSetLimit($min,$max,0) GUICtrlSetData($slider, $start_value) $lable = GUICtrlCreateLabel ("Volume is @ 50%", 50, 60, 200) $lable_font = GUICtrlSetFont ($lable, 9, 600, -1, "Comic Sans MS") GuiSetOnEvent($GUI_EVENT_CLOSE, "close") GuiSetState() $volume = GuiCtrlRead($slider) $current_selecter_pos = GuiCtrlRead($slider) $last_selecter_pos = $current_selecter_pos While 1 Sleep(10) $current_selecter_pos = GuiCtrlRead($slider) If $last_selecter_pos = $current_selecter_pos Then Else $volume = GuiCtrlRead($slider) DllCall ( "Winmm.dll", "int", "waveOutSetVolume", "int", 0 , "int", $volume) $lable = GUICtrlCreateLabel ("Volume is @ "& $volume & "%", 50, 60, 200) $lable_font = GUICtrlSetFont ($lable, 9, 600, -1, "Comic Sans MS") $last_selecter_pos = $current_selecter_pos EndIf wend Func close() Exit EndFuncLittle help ? Edited December 29, 2004 by Nova
this-is-me Posted December 29, 2004 Posted December 29, 2004 AFIAK The slider only notifies when releasing it. There were some comments along the same lines in the support forum as well. Who else would I be?
Nova Posted December 29, 2004 Author Posted December 29, 2004 (edited) AFIAKNot sure what that means, something like RTFM no doubt.The slider only notifies when releasing itHave you run the script ?I would consider refreshing the lable to be a form of notification,dosent require release.There were some comments along the same lines in the support forum as well.This is the support forum. Edited December 29, 2004 by Nova
Josbe Posted December 29, 2004 Posted December 29, 2004 AFIAK The slider only notifies when releasing it...<{POST_SNAPBACK}>Yes. I noticed that.@Nova: But, you can read the value everytime when the slider change. (I did it with XDrop)BTW: AFAIK = As Far As I Know AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
Nova Posted December 29, 2004 Author Posted December 29, 2004 (edited) @Nova: But, you can read the value everytime when the slider change. (I did it with XDrop)I though my code already did that ! The lable text changes everytime the slider is moved and it changes while it is moving. If this is not what u ment plz explain in more detailm maby its just passing over my head.@this-is-me sry.....TBH I though u wer silently cursing at me Edited December 29, 2004 by Nova
Josbe Posted December 29, 2004 Posted December 29, 2004 I though my code already did that ! The lable text changes everytime the slider is moved and it changes while it is moving. Opps! Yes..sorry.What value does it return doing that, there? $out = DllCall ("Winmm.dll", "int", "waveOutSetVolume", "int", 0, "int", $volume) Msgbox(0, "", $out[0]) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
Nova Posted December 29, 2004 Author Posted December 29, 2004 (edited) $out = DllCall ("Winmm.dll", "int", "waveOutSetVolume", "int", 0, "int", $volume) Msgbox(0, "", $out[0])The above code always returns 0, I dont understand what your trying to do.http://www.autoitscript.com/forum/index.ph...topic=7087&st=0Please read post 6 The varible $Volume holds a D_Word value. Can GUICtrlSetLimit($min,$max,0) take D_Word values for its max and min values ?Or do they have to be integers ? Edited December 29, 2004 by Nova
this-is-me Posted December 29, 2004 Posted December 29, 2004 @Nova, I have never cursed at anyone on any forum anywhere, (just for reference sake) Why not use SoundSetWaveVolume? Who else would I be?
Nova Posted December 29, 2004 Author Posted December 29, 2004 (edited) Why not use SoundSetWaveVolume?You said that earlier in another topic also.I have looked on MSDN twice now and cannot find any reference to it !Point me in the right direction ?Nova go here -------------> Edit:Just realised u ment the autoit function SoundSetWaveVolumebecasue Im trying to learn how to use dlls Edited December 29, 2004 by Nova
Josbe Posted December 29, 2004 Posted December 29, 2004 The above code always returns 0, I dont understand what your trying to do....<{POST_SNAPBACK}>Ok, was thinking a possible error.Returns MMSYSERR_NOERROR if successful or an error otherwise. Possible error values include the following.MMSYSERR_BASE = 0MMSYSERR_NOERROR = 0MMSYSERR_NOTSUPPORTED = [MMSYSERR_BASE + 8]MMSYSERR_INVALHANDLE = [MMSYSERR_BASE + 5]MMSYSERR_NODRIVER = [MMSYSERR_BASE + 6]MMSYSERR_NOMEM = [MMSYSERR_BASE + 7]You tried with these values ? AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
Nova Posted December 30, 2004 Author Posted December 30, 2004 (edited) UP NORTH your completly missing the point Im trying to learn about dllcallread post #9 becasue Im trying to learn how to use dllsI wrote a version which uses SoundSetWaveVolume ages ago.I mean all ud have to do is take the above code and swap the line dllcall with SoundSetWaveVolume.@josbe You tried with these values ?in all of my testing it apears that GUICtrlSetLimit wont take D_Word values for min and max. Edited December 30, 2004 by Nova
Doxie Posted January 3, 2005 Posted January 3, 2005 (edited) Would it be possible to make a volume control that looks like this:doxiex.bravehost.com/volume.JPGCopy/paste the url aboveAnd preferly attached to the desktop.I asked about this a couple of month ago, but now when you bring it up, i need to ask again http://www.autoitscript.com/forum/index.ph...wtopic=5741&hl= Edited January 3, 2005 by Doxie Were ever i lay my script is my home...
therks Posted January 3, 2005 Posted January 3, 2005 (edited) I'm not at home, so I can't check this... but it looks to me like your syntax is a little confused. Shouldn't this: GUICtrlSetLimit($min,$max,0) Be this: GUICtrlSetLimit($ctrlID, $min, $max) ?? *Edit: And actually, I thought the order was $max, $min. I seem to remember wondering about that... Edited January 3, 2005 by Saunders My AutoIt Stuff | My Github
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now