C # remove third-party application from taskbar

How to remove a third-party application from the Windows taskbar by its handle?

I found this: Uninstall application from taskbar with c # wrapper?

But that did not work for me. It only sets a different style (small x to close, there is no maximize / minimize button) for the selected window (notepad).

Any ideas on this?

EDIT: I do not want to remove MY application from the taskbar, I want to remove an external application using the handle

+3
source share
4 answers

If you have a window handle, you can call it ShowWindow()through the Win32 API. Then you can do:

// Let the window disappear (even from taskbar)
ShowWindow(this.Handle, WindowShowStyle.Hide);

// Revive the window back to the user
ShowWindow(this.Handle, WindowShowStyle.ShowNoActivate);

, , , :

Process[] procs = Process.GetProcesses();
IntPtr hWnd;
foreach(Process proc in procs)
{
   if ((hWnd = proc.MainWindowHandle) != IntPtr.Zero)
   {
      Console.WriteLine("{0} : {1}", proc.ProcessName, hWnd);
   }
}
+4

Windows, ShowInTaskbar false:

this.ShowInTaskbar = false;

, spy ++ Windows .

+5

Windows?

this.ShowInTaskbar = false;
+1

:

this.ShowInTaskbar = false;

Form: Move

-2

All Articles