How to just get rid of taskbar?

  • Thread starter Thread starter mb
  • Start date Start date
M

mb

I want to make a pseudo-fullscreen app that has the menu but the task bar
area is gone to give room for my app. How do I do this? Thanks
 
Hi,

Here is some code that I use to achieve hiding the TaskBar though in my case
I am using a TabControl on the main form:

private void HideTaskBar(int which)
{
if ( ! this.bHiding )
{
Rectangle rc = this.Bounds;
this.Capture = true;
IntPtr hwnd = GetCapture();
this.Capture = false;
int h = FindWindow("HHTaskBar", "");
ShowWindow(h, 0); // Hide the TaskBar
MoveWindow(hwnd, rc.Left, rc.Top - 26, rc.Right, rc.Bottom + 26,
true);
// Increase the height of the TabControl. The TabPage Show auto.
increases in height
this.tabControl.Height = this.tabControl.Height + 26;
this.bHiding = true;
}
}

and the related P/Invoke items:

[DllImport("coredll.dll")]
public static extern IntPtr GetCapture();
[DllImport("coredll.dll")]
public static extern int FindWindow(string lpClassName, string
lpWindowName);
[DllImport("coredll.dll")]
public static extern int ShowWindow(int hwnd, int nTaskShow);
[DllImport("coredll.dll")]
public static extern int MoveWindow(IntPtr hwnd, int X, int Y, int nWidth,
int nHeight, bool bRepaint);


You may need to also create another method to restore the task bar which is
somehat just the reverse of the above.

I hope this helps you.


Regards,
Neville Lang
 
Back
Top