简体   繁体   中英

Permanently hide or move taskbar off screen windows 10 LTSB ENT

We need to hide the taskbar and start menu. We have an app that runs full screen, it is a touch screen application. Our touch screen application is 99.9999% always on screen, covering the entire screen. It is however a complex multimedia app and on rare occasions we have found it crashed exposing the desktop. We have a custom made Win10 LTSB ENT build which is robust and appropriate, but we want to go a step further. We want to remove the taskbar (which is 'hidden') from the desktop entirely.

We can hide the taskbar using the code below, but it keeps returning 5 seconds later. Something keeps undoing our 'hide' and restoring the taskbar without us doing anything.

Am I doing something wrong? Is there a service or mechanism in Windows OS I need to adjust?

private static void setTaskBar(bool hide)
{
  IntPtr window = Program.FindWindow("Shell_traywnd", "");
  if (hide)
    Program.SetWindowPos(window, IntPtr.Zero, 0, 0, 0, 0, 128U);
  else
    Program.SetWindowPos(window, IntPtr.Zero, 0, 0, 0, 0, 64U);

[DllImport("user32", SetLastError = true)]
private static extern IntPtr FindWindowEx(
  IntPtr hWndl,
  IntPtr hWnd2,
  string lpsz1,
  string lpsz2);
}

[DllImport("user32")]
private static extern bool SetWindowPos(
  IntPtr hWndl,
  IntPtr hWndInsertAfter,
  int X,
  int Y,
  int cx,
  int cy,
  uint uFlags);

The taskbar is somewhat special, it receives messages from the window manager when other windows go in and out of fullscreen etc and adjusts itself accordingly.

Messing with the shell is the wrong solution. A better solution would be to launch another instance of your program that only has a fullscreen window and does nothing but waiting for the real instance to crash and then restart it if desired.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM