- Home /
How to hide the game's taskbar icon
I want to hide/remove the game's taskbar icon without hiding the game window itself. Since Unity is not capable of this I have tried hiding the icon using WS_EX_TOOLWINDOW: C# Hiding an application from the taskbar, but had no luck. Here, it suggested that "-batchmode" can hide the taskbar icon, which is true but this command hides the window too.
Achieving this should be possible since here, using WS_EX_TOOLWINDOW someone was able to hide the icon so I am definitely doing something wrong. This is how my code looks like right now:
     [DllImport("User32.dll")]
     public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
     [DllImport("User32.dll")]
     public static extern int GetWindowLong(IntPtr hWnd, int nIndex);
 
     [DllImport("user32.dll")]
     static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
 
     private const int SW_HIDE = 0x00;
     private const int SW_SHOW = 0x05;
     private const int GWL_EXSTYLE = -0x14;
     private const int WS_EX_TOOLWINDOW = 0x0080;
 
     void Start()
     {
         IntPtr pMainWindow = Process.GetProcessesByName("Game")[0].MainWindowHandle;
         ShowWindow(pMainWindow, SW_HIDE);
         SetWindowLong(pMainWindow, GWL_EXSTYLE, GetWindowLong(pMainWindow, GWL_EXSTYLE) | ~WS_EX_TOOLWINDOW);
         ShowWindow(pMainWindow, SW_SHOW);
     }
Just to be clear, I'm talking about this taskbar icon: 
Answer by Weightless · May 12, 2020 at 07:03 PM
Answered here: https://forum.unity.com/threads/can-the-taskbar-icon-of-a-unity-game-be-hidden.888625/#post-5838658
Your answer
 
 
             Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
DLL Import => Build finish without Error but Can't Work 0 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                