utility that can hide a taskbar button, but leave the window as-is?


Recommended Posts

I run a to-do list app all the time, just leave it open in the background. Is there any way to hide the button in the taskbar, but leave the program's window open?

I've found a couple freebie utilities that can move the button to the tray, but they also minimize the window.

Anyone know of such a thing?

A taskbar button is directly linked to the window. The window needs to specify the property not to have a taskbar button to hide it, and I don't believe the WinAPI has a function to force this or do it for a window not owned by your thread.

A taskbar button is directly linked to the window. The window needs to specify the property not to have a taskbar button to hide it, and I don't believe the WinAPI has a function to force this or do it for a window not owned by your thread.

Thanks.

This code might be of some help. What it does is sets the window style of a given application to a tool window instead of an app window. The point of this is that windows with the param "WS_EX_TOOLWINDOW" are made to be hidden from the task bar. The problem is that this code doesn't work unless you can execute it on form activation (or initialization of the target window).

I'm not sure if there is another way to hide it or if you'd have to somehow inject/subclass the processes initialization process.

Winapi functions and defined constants for C#:

 [DllImport("user32.dll")]
		static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);

 [DllImport("user32.dll")]
		private static extern int GetWindowLong(IntPtr hWnd, int nIndex);

		private const int GWL_EXSTYLE = (-20);
		private const int WS_EX_TOOLWINDOW = 0x80;
		private const int WS_EX_APPWINDOW = 0x40000;

Function to detect process and set information:

 Process[] processes = Process.GetProcessesByName("yourProcessHere");

			foreach (Process p in processes)
			{

				IntPtr pWindow = p.MainWindowHandle;

				SetWindowLong(pWindow, GWL_EXSTYLE, (GetWindowLong(pWindow,
GWL_EXSTYLE) | WS_EX_TOOLWINDOW) & ~WS_EX_APPWINDOW);

			}

I'll see if I can dig anything else up.

Edit: According to this (http://vcfaq.mvps.org/mfc/4.htm) it may be possible to hide the button from the taskbar by the following:

The best method is to make the application's top level window have a parent window that is invisible.

So it may be possible with some code to create a parent window for that app that is invisible. I've never done that before so I'd have to look into it.

Edit #2: Tested it out and I was able to create a MDI form in C# and use the following API:

		[DllImport("user32.dll")]
		private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);

I was able to set the parent window for notepad to the app I made and effectively remove the button from the task bar. There is another problem though -- I can't figure out how to make the parent window invisible/transparent without making the child window(s) invisible as well. If either problem could be solved then it'd be fairly easy to make an app for you that would do as you want.

Edited by dlegend

an out of the box solution would be to find and use a widget that's a to do list. cause widgets don't spear in your task bar and as long as you have only a few of them they won't take up that much ram. if you have vista it's already there of course and i am sure you can google it to find an easy solution for xp.

I just came up with a neat programming solution (in C#) to address this problem. It utilizes both methods I mentioned above and works flawlessly (with the exception of a quick flicker of the window). To do this you'll first need to create a MDI form and then use the following:

Namespaces

using System.Runtime.InteropServices;
using System.Diagnostics;

DLL Function Imports

		[DllImport("user32.dll")]
		static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);

		[DllImport("user32.dll")]
		private static extern int GetWindowLong(IntPtr hWnd, int nIndex);

		[DllImport("user32.dll")]
		private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);

Constants

		private const int GWL_EXSTYLE = (-20);
		private const int WS_EX_TOOLWINDOW = 0x80;
		private const int WS_EX_APPWINDOW = 0x40000;

Main Function

Process[] processes = Process.GetProcessesByName("processNameHere");

			foreach (Process p in processes)
			{
				IntPtr pWindow = p.MainWindowHandle; 

				int iWindowStyle = GetWindowLong(pWindow, GWL_EXSTYLE); 

				SetParent(pWindow, this.Handle);
				SetWindowLong(pWindow, GWL_EXSTYLE, (iWindowStyle | WS_EX_TOOLWINDOW) & ~WS_EX_APPWINDOW);
				SetParent(pWindow, (IntPtr)0);
				SetWindowLong(pWindow, GWL_EXSTYLE, iWindowStyle);
			}

What the main function does is find the process's main window, gets the extended window style, makes the window a child of our app, sets the extended window style to become a tool window, sets child windows parent back to the desktop, and reapplies its original extended window style back.

As described earlier, just setting the extended window style itself wasn't enough -- it was only able to work correctly upon initialization of the window. By creating a parent window and setting the extended window style and by then setting the parent window back to the desktop, it updates the extended window style without having to be done through form/window initialization.

Now if you could link me to the to-do list app your having problems with, I can probably customize the code to work specifically for it.

an out of the box solution would be to find and use a widget that's a to do list. cause widgets don't spear in your task bar and as long as you have only a few of them they won't take up that much ram. if you have vista it's already there of course and i am sure you can google it to find an easy solution for xp.

Yes the app I've used in the past is called Post It Digital Notes, and by design it doesn't create a taskbar button. But it's very limited connectivity wise and that's why I started using this new one.

I just came up with a neat programming solution (in C#) to address this problem. It utilizes both methods I mentioned above and works flawlessly (with the exception of a quick flicker of the window). To do this you'll first need to create a MDI form and then use the following:

Namespaces

using System.Runtime.InteropServices;
using System.Diagnostics;

DLL Function Imports

		[DllImport("user32.dll")]
		static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);

		[DllImport("user32.dll")]
		private static extern int GetWindowLong(IntPtr hWnd, int nIndex);

		[DllImport("user32.dll")]
		private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);

Constants

		private const int GWL_EXSTYLE = (-20);
		private const int WS_EX_TOOLWINDOW = 0x80;
		private const int WS_EX_APPWINDOW = 0x40000;

Main Function

Process[] processes = Process.GetProcessesByName("processNameHere");

			foreach (Process p in processes)
			{
				IntPtr pWindow = p.MainWindowHandle; 

				int iWindowStyle = GetWindowLong(pWindow, GWL_EXSTYLE); 

				SetParent(pWindow, this.Handle);
				SetWindowLong(pWindow, GWL_EXSTYLE, (iWindowStyle | WS_EX_TOOLWINDOW) & ~WS_EX_APPWINDOW);
				SetParent(pWindow, (IntPtr)0);
				SetWindowLong(pWindow, GWL_EXSTYLE, iWindowStyle);
			}

What the main function does is find the process's main window, gets the extended window style, makes the window a child of our app, sets the extended window style to become a tool window, sets child windows parent back to the desktop, and reapplies its original extended window style back.

As described earlier, just setting the extended window style itself wasn't enough -- it was only able to work correctly upon initialization of the window. By creating a parent window and setting the extended window style and by then setting the parent window back to the desktop, it updates the extended window style without having to be done through form/window initialization.

Now if you could link me to the to-do list app your having problems with, I can probably customize the code to work specifically for it.

The application is called Evernote, the free version (www.evernote.com). I really don't want to put you out in custom-creating this, though I'd certainly be grateful if you do--there's no way I can make an "MDI form" and make use of the code you've provided.

Have you tried Tray It? Install and run Tray It, then right click the app and select "Place in system tray", then double click it/right click and select Edit Profile. In the Tray It Minimizing Option dialog, go to More tab, Hide application from the taskbar all the time, only keep tray icon. Then use Windows's built in notification area settings to hide the tray icon.

Have you tried Tray It? Install and run Tray It, then right click the app and select "Place in system tray", then double click it/right click and select Edit Profile. In the Tray It Minimizing Option dialog, go to More tab, Hide application from the taskbar all the time, only keep tray icon. Then use Windows's built in notification area settings to hide the tray icon.

That is exactly what I'd been looking for. Tested it and it works great. Thanks much!

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • You're absolutely right! No reason in hell these should be on the road!
    • They aren't going to want to. Most would just go with the 17 Pro and save money. Why would they want to spend $300 for basically the same thing? It's not worth it if there are hardly any changes from year to year.
    • 24H2 rolled out to the Release Preview Channel in early June 2024, so this coming a bit later in the Experimental Channel (formerly Dev) doesn't really say much more than earlier H2 releases that came out in October. I am not sure what the thinking is here by putting it in Experimental, one would think that the 26H2 stamp means features are locked down and it's now bug tested until October? I don't even pretend to understand Microsoft's strategy for Windows Insider Program though
    • Nothing Ear (a) and CMF Buds Pro 2 with active noise cancellation drop to lowest price ever by Fiza Ali With Prime Day 2026 scheduled to run from Tuesday 23 to Friday 26 June, Amazon has already begun rolling out early access offers ahead of the main event. Particularly, Nothing Ear (a) and CMF Buds Pro 2 wireless earbuds have dropped to their lowest price ever with limited Prime deal offering 33% and 24% discounts, respectively. Nothing Ear (a) are equipped with 11mm dynamic drivers featuring a PM1 + TPU diaphragm. For noise control, the earbuds offer active noise cancellation (ANC) of up to 45dB across frequencies reaching 5,000Hz. The smart ANC algorithm adapts to surrounding noise levels, while a Transparency Mode allows users to remain aware of their environment when needed. Connectivity is handled via Bluetooth 5.3, with support for AAC, SBC, and LDAC audio codecs. Additional features include IP54-rated earbuds for dust and splash resistance, paired with an IPX2-rated charging case. Furthermore, users also benefit from pinch controls, in-ear detection, Google Fast Pair, Microsoft Swift Pair, dual-device connectivity, and a low-latency mode designed for gaming and video playback. The Nothing X app unlocks a range of customisation options, including a personalised equaliser, bass enhancement, control remapping, ear tip fit testing, firmware updates, dual-device management, a Find My Earbuds feature, and low-latency mode settings. When it comes to the battery, the earbuds house a 46mAh lithium-ion battery, while the charging case contains a 500mAh cell. With ANC disabled, users can expect up to 9.5 hours of playback from the earbuds and up to 42.5 hours in total with the charging case. With ANC enabled, battery life is rated at up to 5.5 hours per charge and up to 24.5 hours combined with the case. Finally, fast charging is also supported that should provide up to 10 hours of playback from a 10-minute charge with ANC turned off. Nothing Ear (a) Wireless Earbuds (Black): $53.20 (Amazon US) - 33% The CMF Buds Pro 2 feature a dual-driver audio system consisting of an 11mm bass driver and a 6mm micro-planar tweeter. The earbuds use PU (polyurethane) and PET (polyethylene terephthalate) titanium-coated diaphragms and are tuned by Nothing to deliver balanced audio performance. They further support active noise cancellation of up to 50dB across a frequency range of up to 5,000Hz, and noise control features include a Smart ANC algorithm, Adaptive ANC, Transparency Mode, and Clear Voice Technology 2.0. For calls, the CMF Buds Pro 2 use a total of six microphones and feature an environmental noise-cancelling algorithm, Clear Voice Technology 3.0, and Wind Noise Reduction 3.0 that should improve voice clarity during conversations. Furthermore, when it comes to the connectivity, it is provided through Bluetooth 5.4. Additional features include an IP55 rating for dust and water resistance, Google Fast Pair, Microsoft Swift Pair, in-ear detection, a low-latency mode, and a Find My Earbuds function. Moreover, through the Nothing X app for Android and iOS, users can access custom EQ settings, a bass enhancement algorithm, customisable controls, Find My Earbuds, low-latency mode, dual-device connectivity, an ear tip fit test, and firmware updates. The earbuds contain a 60mAh rechargeable lithium-ion battery, while the charging case houses a 460mAh battery. A full charge of the earbuds and case via USB-C should take approximately 85 minutes, while the earbuds alone should be fully recharged in the case in around 60 minutes. Battery life is rated at up to 11 hours of playback on a single charge and up to 43 hours with the charging case when ANC is turned off. With ANC enabled, playback time is reduced to up to 6.5 hours on the earbuds and up to 26 hours with the charging case. Talk time is rated at up to 6 hours on the earbuds and 25 hours with the case with ANC disabled, or up to 4.8 hours and 18.6 hours, respectively, with ANC enabled. CMF Buds Pro 2 Wireless Earbuds (Dark Grey): $37.05 (Amazon US) - 24% Good to know This Amazon deal is U.S. specific, and not available in other regions unless specified. We only use first-party seller links (at the time of article publishing); ensure that you purchase from a first-party seller link only. Check out Today's Deals on Amazon | or our recent tech deals. Become a Prime member (for Students or SNAP) via Neowin Get Prime Access - Prime for half price (for qualifying Medicaid, EBT, SNAP) Subscribe to Prime Video, Audible Plus, Music Unlimited or Kindle Unlimited via Neowin As an Amazon Associate, we earn from qualifying purchases.
  • Recent Achievements

    • Week One Done
      AMV earned a badge
      Week One Done
    • One Month Later
      AMV earned a badge
      One Month Later
    • Collaborator
      ryansurfer98 went up a rank
      Collaborator
    • One Month Later
      Eurosoft10 earned a badge
      One Month Later
    • Week One Done
      Eurosoft10 earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      542
    2. 2
      +Edouard
      186
    3. 3
      Michael Scrip
      77
    4. 4
      PsYcHoKiLLa
      76
    5. 5
      Steven P.
      71
  • Tell a friend

    Love Neowin? Tell a friend!