3

I am running Windows XP 64 bit. I want to hide the taskbar when I run my application.

I tried codes by searching the web. In all those, it hides the task bar. But the problem is, when i open a notepad and maximize it, it is not actually into full screen. Because the space where task bar was there is still blocked with empty space. I want it fit really into full screen mode.

halfer
  • 19,824
  • 17
  • 99
  • 186
Anuya
  • 8,082
  • 49
  • 137
  • 222
  • I'm going to retitle this, Make application Full Screen using C#, since what you really want is fullscreen, not programatically hiding parts of the OS from the user (maybe the user wants it there). – user7116 Aug 28 '09 at 02:12
  • @sixlettervariables, the purpose of hiding the task bar is not allowing the user to use start button in the taskbar. So i need to hide it. This is the Kiosk application, so i disable all the key shortcuts and windows key as well. – Anuya Aug 28 '09 at 02:17
  • 4
    You may want to look at replacing the default shell with your own custom program. That is likely easier than trying to hide/disable Explorer features if your program is to run a kiosk. – Chris W. Rea Aug 28 '09 at 02:23
  • Then his question is not how to hide the taskbar using C#, but rather how to make a Kiosk application in C#. – user7116 Aug 29 '09 at 16:19

4 Answers4

6

If you like to replace the windows shell (taskbar) you'll have to change a registry key.

Changing the default shell (all users):

  1. open regedit (start menu > run, and type in regedit)
  2. go to: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon.
  3. Change Shell from explorer.exe to your program path and name e.g. c:\myKioskApp\Kiosk.exe

Changing the default shell (only current user):

  1. open regedit (start menu > run, and type in regedit).
  2. go to: HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon.
  3. add a new string value (Edit > New > String Value) called shell. and set the value to the path of the new shell e.g. c:\myKioskApp\Kiosk.exe
  4. log out and log back in.
Oliver
  • 43,366
  • 8
  • 94
  • 151
4

I've done this by making the application borderless, maximized, and setting it to be Topmost. Here's a perfect example from CodeProject.

As one of the commenters has said, replacing disabling Explorer and running your application might be the best way, security-wise.

Charlie Salts
  • 13,109
  • 7
  • 49
  • 78
  • Of course, you can't replace Explorer using C#... but I agree that it's the best option, provided that it's an option. – harpo Aug 28 '09 at 04:31
  • I know I can kill the Explorer.exe process from within the Task Manager - explorer windows and taskbar disappear. I don't know if it's possible or wise to kill it programmatically, though. – Charlie Salts Aug 28 '09 at 04:33
0

You Can Hide your task bar by setting Following Properties of your C# Form.

WindowState : Maximized FormBorderStyle : FixedDialog

Pranav Labhe
  • 1,943
  • 1
  • 19
  • 24
0

on window 7 (or maybe higher) using FormWindowState.Maximized is wrong because the maximum size will be subtracted by Taskbar height but you can do this

this.WindowState = FormWindowState.Normal; // or default
this.FormBorderStyle = FormBorderStyle.None;
this.TopMost = true;

// do it here
this.Location = new Point(0,0);
var fullscreenSize = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
this.Size = fullscreenSize;
cieunteung
  • 1,725
  • 13
  • 16