osninja Posted December 16, 2018 Posted December 16, 2018 Can someone please help script a way to hide the volume icon in the notification area. I found the code snipped below which does see all the systray icons correctly but im not knowledgeable enough to adapt it to hide the volume icon. The following example should be "universal" because it checks ALL existing/valid instances on both hidden and visible icons. So it should be working on all past and future Windows vers unless the class(es) name will change. Note: there are some programs using a no-standard instance, but with my method you can catch those icons as well. expandcollapsepopup expandcollapse popup#NoTrayIcon #include <GuiToolBar.au3> Local $VisibleIcons Local $HiddenIcons Local $Instance ; Find systray handle for "User Promoted Notification Area" $Instance = 0 While 1 $Instance = $Instance + 1 Local $hSysTray_Handle = ControlGetHandle("[Class:Shell_TrayWnd]", "", "[Class:ToolbarWindow32;Instance:" & $Instance & "]") If @error Then ExitLoop If Not @Compiled Then ConsoleWrite("VISIBLE at Istance #" & $Instance & ":" & @CRLF) Local $iSysTray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) ; Get vidible systray icon count For $iSystray_ButtonNumber = 0 To $iSysTray_ButCount - 1 $text = _GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber) If Not @Compiled Then ConsoleWrite($text & @CRLF) Next If Not @Compiled Then ConsoleWrite(@CRLF) WEnd ; Find systray handle for "Overflow Notification Area" i.e. hidden icons $Instance = 0 While 1 $Instance = $Instance + 1 Local $hSysTray_Handle_Hidden = ControlGetHandle("[Class:NotifyIconOverflowWindow]", "", "[Class:ToolbarWindow32;Instance:" & $Instance & "]") If @error Then ExitLoop If Not @Compiled Then ConsoleWrite("HIDDEN at Istance #" & $Instance & ":" & @CRLF) $iSysTray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle_Hidden) ; Get hidden systray icon count For $iSystray_ButtonNumber = 0 To $iSysTray_ButCount - 1 $text = _GUICtrlToolbar_GetButtonText($hSysTray_Handle_Hidden, $iSystray_ButtonNumber) If Not @Compiled Then ConsoleWrite($text & @CRLF) Next WEnd Exit No need to error check or anything just need to hide the volume icon indicator specifically. Any help is much appreciated thanks.
Bert Posted December 16, 2018 Posted December 16, 2018 (edited) I'm trying to understand why you need to hide it. You can control volume with a keystroke so what am I missing here? Are you really trying to prevent someone from changing or muting the volume if the sound playing can be heard by a person? Edited December 16, 2018 by Bert The Vollatran project My blog: http://www.vollysinterestingshit.com/
osninja Posted December 16, 2018 Author Posted December 16, 2018 simply a matter of preference. inside a windows pe environment with audio services disabled you get a useless systray icon with an x over it.
Nine Posted December 16, 2018 Posted December 16, 2018 (edited) just personalize the tray so it never shows, why do you need a script to do that, when a few clicks resolve your problem Edited December 16, 2018 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
osninja Posted December 16, 2018 Author Posted December 16, 2018 its a live pe environment for repair and troubleshooting. Settings are not saved. So i would like a way to automate the icon state so thats its always hidden when it boots. Tried a couple registry settings but they dnt appear to affect whether its gets shown or not. My hope is that maybe using api calls will. 32 bit windows 7 pe 3.0 environment
osninja Posted December 16, 2018 Author Posted December 16, 2018 looking for a way to use the output from the code snippet above. How do i use the instances it finds and instruct it to hide said instance found for example if i run the script locally to test on my windows 10 machine this is what is shown for my visible volume and wifi icons: VISIBLE at Istance #1: VISIBLE at Istance #2: VISIBLE at Istance #3: Speakers: 74% 8636F4 Internet access HIDDEN at Istance #1:
Nine Posted December 16, 2018 Posted December 16, 2018 (edited) 18 minutes ago, osninja said: its a live pe environment for repair and troubleshooting. Settings are not saved. Sorry I don't get your requirements. I have no idea why "repair and troubleshooting" needs volume icon to be hidden. Good luck on this topic, I won't be able to help you out. Edited December 16, 2018 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
osninja Posted December 16, 2018 Author Posted December 16, 2018 Np. Thanks either way. its simple a matter of preference. I would like the icon to not appear every time i need to boot up the live cd if possible. Its not stopping anything from working just aesthetically unpleasing to me i guess lol.
Bert Posted December 17, 2018 Posted December 17, 2018 (edited) just remove the audio driver or disable the hardware. Edited December 17, 2018 by Bert The Vollatran project My blog: http://www.vollysinterestingshit.com/
osninja Posted December 17, 2018 Author Posted December 17, 2018 There is no audio driver installed. no way to disable the hardware as it never gets detected as an audio device because the pe environment was built without audio support. It was a pita but i was finally able to accomplish getting rid of the icon by removing stobject.dll from the wim!!! Thats what controls whether the icon is shown or not regardless of driver hardware or services started.
red0fireus Posted December 18, 2018 Posted December 18, 2018 (edited) I wouldn't recommend deleting Windows DLL files because it can cause issues else where in the OS. You should try the fix below and then delete the DLL if the issue persists. https://superuser.com/questions/118104/how-to-remove-the-volume-icon-in-w7-taskbar/118106 Edited December 18, 2018 by red0fireus
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