Hide Specific Taskbar Icons

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Bross9132
Posts: 14
Joined: 08 Feb 2018, 09:46

Hide Specific Taskbar Icons

22 Feb 2018, 21:01

The code below is how you hide Taskbar icons but how do you hide specific icons?

Code: Select all

WinHide, % "ahk_id " DllCall("GetTaskmanWindow")
RickC
Posts: 299
Joined: 27 Oct 2013, 08:32

Re: Hide Specific Taskbar Icons

23 Feb 2018, 00:47

If you mean in Windows 10 then it looks like it may depend on what version you are using. The following should work:

Code: Select all

; Taskbar - Show/hide Store icon (0=Enable/Show / 1=Disable/Hide)
; Thanks to WindowsITPro.com (see http://windowsitpro.com/active-directory/microsoft-august-updates-secret-new-gpo-setting-unpin-store-icon-revealed)
RegWrite, REG_DWORD, HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer, NoPinningStoreToTaskbar, 1

; Taskbar - Show/hide Mail icon (0=Enable/Show / 1=Disable/Hide)
RegWrite, REG_DWORD, HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer, NoPinningMailToTaskbar, 1

; Taskbar - Show/hide TaskView icon (1=Enable/Show / 0=Disable/Hide)
RegWrite, REG_DWORD, HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, ShowTaskViewButton, 0

; Taskbar - Show/hide People icon (1=Enable/Show / 0=Disable/Hide)
RegWrite, REG_DWORD, HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People, PeopleBand, 1
Note that you will need to run these elevated even though they're writing to the CURRENT_USER hive AND refresh the desktop afterwards for the changes to take effect. You may also need to use SetRegView depending on the 'bitness' of your AHK install vs OS install.

So, for example, if I'm using a 32-bit install of AHK and want to hide the People icon of a Win 10 x64 taskbar then I use the following:

Code: Select all

; Only allow one instance of the script to run at a time
#SingleInstance,Force

; Prompt to 'Run as administrator', i.e. show UAC dialog
If Not A_IsAdmin
{
   Run *RunAs "%A_ScriptFullPath%"  ; Requires v1.0.92.01+
   ExitApp
}

; Taskbar - Show/hide People icon (1=Enable/Show / 0=Disable/Hide)
SetRegView, 64
RegWrite, REG_DWORD, HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People, PeopleBand, 0
SetRegView, Default

run, taskkill /f /im explorer.exe,, Hide
sleep, 1000
run, explorer.exe

ExitApp
No doubt there's a DLL call that's a neater way of refreshing the desktop but I don't know it. :(

Hope this helps...
RickC
Posts: 299
Joined: 27 Oct 2013, 08:32

Re: Hide Specific Taskbar Icons

24 Feb 2018, 12:43

I've been playing around with refreshing the desktop and have found that instead of using run, taskkill /f /im explorer.exe,, Hide the following works well because it restarts Explorer automatically:

Code: Select all

psScript =
(
   kill -n explorer
)
Run PowerShell.exe -Command %psScript%,, hide
Alternatively, you can use:

Code: Select all

psScript =
(
   Stop-Process -ProcessName explorer
)
Run PowerShell.exe -Command %psScript%,, hide
Hope this helps...
Bross9132
Posts: 14
Joined: 08 Feb 2018, 09:46

Re: Hide Specific Taskbar Icons

24 Feb 2018, 15:38

Thank you for the replies. What about a running windows app such as calculator or camera? The taskbar icon does not hide with winhide the only solution I can come up with is to hide all of the taskbar icons...
burque505
Posts: 1736
Joined: 22 Jan 2017, 19:37

Re: Hide Specific Taskbar Icons

24 Feb 2018, 18:27

Hi Bross9132, this link _might_ help, sort of: Pin an invisible icon.
I guess your script would have to create a desktop shortcut for the program; change the icon to a transparent one as shown; pin the shortcut to the taskbar; and delete the desktop version of the shortcut.
I'll give it a try myself and see if I can do it.

Edit: Check out this link also. Several different ways to do it.
Regards,
burque505

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Araphen, Dobbythenerd1 and 317 guests