CodyBarrett Posted November 8, 2009 Posted November 8, 2009 (edited) okay.. so my Wireless Keyboard has a volume control on it, and it died (maybe the batteries just died im not sure) but anyway, i decided to make this FOR MOSTLY every other keyboard.its a rather simple script, and i have searched for a GetMasterVolumePercent() function or something like it... but decided to do it this waymy volume using VOLUME_UP and VOLUME_DOWN commands, is a max of 25... im not sure if thats on everyone elses? but i used that to control it. check it out.edit: unneeded charactersedit2: i looked through Volly's mastervolume UDF and i added Audio.au3 i have both the include and the main script in the same Dir... feel free to change it if you want to.expandcollapse popup#include 'Audio.au3' ;this is in the same DIR as the script... if you do not have Audio then Download it from the forums... it is Volly's UDF . #NoTrayIcon HotKeySet ('^{PGUP}', '_VOLUP') HotKeySet ('^{PGDN}', '_VOLDOWN') HotKeySet ('^{HOME}', '_VOLMUTE') HotKeySet ('^{END}', '_EXIT') $value = _SoundGetMasterVolume () ;Thank you Volly $PopUP = 0 While 1 Sleep (100) WEnd Func _POPUP () Local $dW = @DesktopWidth, $dH = @DesktopHeight Local $x = ($dW / 2), $y = ($dH / 15), $yp = ($dH * (7/8)) $PopUP = GUICreate ('', $x,$y, -1, $yp,BitOR(0x08000000,0x80000000, 0x10000000),0x00000100,WinGetHandle ('Program Manager','')) GUICtrlCreateLabel ('',0,0,($x * ($value / 100)),($y / 2)) GUICtrlSetBkColor (-1,0x0000DF) GUICtrlSetState (-1, 128) GUICtrlCreateLabel ('',0,($y / 2),($x * ($value / 100)),($y / 2)) GUICtrlSetBkColor (-1, 0x0000B7) GUICtrlSetState (-1, 128) GUISetBkColor (0x0,$PopUP) WinSetOnTop ($PopUP,'',1) GUISetState () WinSetTrans ($PopUP,'',220) EndFunc Func _SetData () ControlMove ($PopUP,'','Static1',0,0,((@DesktopWidth / 2) * ($value / 100)),((@DesktopHeight /15) / 2)) ControlMove ($PopUP,'','Static2',0,((@DesktopHeight / 15) / 2),((@DesktopWidth / 2) * ($value / 100)),((@DesktopHeight /15) / 2)) EndFunc Func _VOLDOWN () If $value = 0 Then Return If Not WinExists ($PopUP,'') Then _POPUP () Else _SetData () EndIf $value = $value - 1 _SoundSetMasterVolume ($value) ;Thank you Volly Sleep (3000) GUIDelete ($PopUP) EndFunc Func _VOLMUTE () Send ('{VOLUME_MUTE}') EndFunc Func _VOLUP () If $value = 100 Then Return If Not WinExists ($PopUP,'') Then _POPUP () Else _SetData () EndIf $value = $value + 1 _SoundSetMasterVolume ($value) ;Thank you Volly Sleep (3000) GUIDelete ($PopUP) EndFunc Func _EXIT () Exit EndFunc Edited November 8, 2009 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
Yashied Posted November 8, 2009 Posted November 8, 2009 (edited) Windows Vista or 7 - http://www.autoitscript.com/forum/index.php?showtopic=84834Windows XP and below - http://www.autoitscript.com/forum/index.php?showtopic=54048 Edited November 8, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
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