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

    • Qualcomm's new Snapdragon Reality Elite chip brings on-device AI to Android XR devices by Pradeep Viswanathan Qualcomm has been delivering dedicated SoCs for mixed reality and spatial computing devices for several years. The journey started with the Snapdragon XR1, followed by the Snapdragon XR2 in 2019, the Snapdragon XR2 Gen 2 in September 2023, and finally the Snapdragon XR2+ Gen 2 in 2024. Today, Qualcomm announced a major upgrade with the new Snapdragon Reality Elite Platform, which targets premium mixed reality and spatial computing devices. OEMs can use this SoC to power both all-in-one video-see-through headsets and lightweight, tethered optical-see-through glasses. Qualcomm highlighted that the Snapdragon Reality Elite will power the next wave of Android XR devices coming later this year. These wearables will offer better visuals, improved power efficiency, and deeper on-device AI integration compared to the previous generation. The Snapdragon Reality Elite can deliver up to 48 TOPS of AI performance, allowing large language models and large vision models to run directly on the device for the first time. In addition to enabling new spatial AI experiences, these new AI capabilities will improve head and hand tracking, as well as see-through features. On the performance side, the Snapdragon Reality Elite offers up to 60% higher GPU performance, up to 30% higher CPU performance, and up to 160% higher NPU performance compared to the previous generation. The platform supports visuals of up to 4.4K per eye at 90 frames per second for sharper images and smoother motion. Qualcomm is also claiming significant efficiency improvements. The Snapdragon Reality Elite can offer up to 20% longer battery life under the same workload. More importantly, the chipset can run up to 12 degrees Celsius cooler under load, making headsets more comfortable for users to wear for longer periods. The platform also includes improvements to video see-through, featuring lower latency and better image quality. Qualcomm states that its EVA hardware block helps accelerate demanding computer vision workloads, improving how digital content blends with the real world.
    • Umm... GitHub continues to use AWS. That's the story, that's the headline. There's no "new" news here. GitHub continues to require additional capacity beyond the originally-planned Azure allocations. There's nothing special about this; nothing noteworthy. They're still using AWS' infra until the cutover is complete.
    • Hello, Also known for https://www.theguardian.com/technology/2009/jan/29/adware-internet.   Regards, Aryeh Goretsky    
    • Hello, I have used a few TEAM Group SSDs, USB flash drives, and Micro SDXC cards in the past. They all seemed to work fine. Regards, Aryeh Goretsky
    • "just $100 per TB"? Just? Are we trying to make this seem like the new normal? Kinda weird to make it sound like that is not a ridiculously expensive asking price.
  • Recent Achievements

    • Collaborator
      vjlex earned a badge
      Collaborator
    • Reacting Well
      Dys Topia earned a badge
      Reacting Well
    • Conversation Starter
      NovaEdgeX earned a badge
      Conversation Starter
    • One Year In
      Console General earned a badge
      One Year In
    • Week One Done
      Twozo Technologies earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      517
    2. 2
      +Edouard
      182
    3. 3
      PsYcHoKiLLa
      106
    4. 4
      Steven P.
      88
    5. 5
      ATLien_0
      68
  • Tell a friend

    Love Neowin? Tell a friend!