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