; OSD-mute ; To monitor and display status when mute ; Date: 05/07/2007 ;Last Updated: 05/09/2007 ; Refer: hxxp://www.donationcoder.com/Forums/bb/index.php?topic=9094.0 ; Gui code based on: hxxp://www.autohotkey.com/forum/viewtopic.php?t=9685 ; ; Changes since: ; Updated systray icon to reflect the current status. ; Check for sndvol32.exe, error-trapping precaution. ; Incorporate Nod5's suggestion to remove flickering. ; --------------------------------------------------- ; Minor features updates ; - Allow click-through ; - stop Win+D from minimizing the Gui ; - tray icon to emulate normal tray volume icon ; #SingleInstance force #Persistent appname=OSD-Mute ;Menu, tray, Icon, %A_WinDir%\System32\sndvol32.exe, 4 ; Mute icon Menu, tray, NoStandard Menu, tray, Tip, %appname%`, Monitor and display system's Mute status. Menu, tray, Add, Open Volume Control, VolumeSettings ; Open Volume Control Menu, tray, Add, Adjust Audio Properties, AudioProperties ; Adjust Audio Properties Menu, Tray, Default, Open Volume Control SetTimer, WatchMute, 500 ;increase or decrease timer Return VolumeSettings: Run, %A_WinDir%\System32\sndvol32.exe Return AudioProperties: ;Sounds and Audio Devices Properties Run, RunDll32.exe shell32.dll`,Control_RunDLL mmsys.cpl`,`,0 Return WatchMute: SoundGet, CheckMute, , Mute If CheckMute = On { If OSD_On = True Return Gui, Destroy ; Gui, Color, EEAA99 Gui +AlwaysOnTop +ToolWindow -Caption +LastFound +E0x20 WinSet, TransColor, EEAA99 105 ;105 - level of translucency (range: 0-255) Gui, Font, s30 Bold cYellow, Tahoma Gui, Add, Text, gTextShow x3 y3 w175 h45 Center c000000 BackgroundTrans, Mute %CheckMute% Gui, Add,Text,x0 y0 w175 h45 Center cFFD300 BackgroundTrans, Mute %CheckMute% Gui,Show, NoActivate x70 y600 w175 h45 ; some crude positioning co-ordinates OnMessage(0x5, "WindowResized") OSD_On = True IfExist, %A_WinDir%\System32\sndvol32.exe Menu, tray, Icon, %A_WinDir%\System32\sndvol32.exe, 4 ; Mute icon Sleep, 3000 } Else { OSD_On = False Gui, Destroy ; IfExist, %A_WinDir%\System32\sndvol32.exe Menu, tray, Icon, %A_WinDir%\System32\sndvol32.exe, 5 ; Normal speaker icon } Return WindowResized(WPARAM, LPARAM, MSG, HWND) { WinRestore, ahk_pid %HWND% } TextShow: Return ;Win+q exits... #q::ExitApp