0

Possible Duplicate:
Borderless application on maximize is hiding behind the task bar in Win 7 and Win 8

my windowstyle is none and I maximized the window the window is behind the task bar and I cannot see the while window properly. i tries this but it doesn't work:

this.MaxHeight = SystemParameters.VirtualScreenHeight;
this.MaxWidth = SystemParameters.VirtualScreenWidth;
Community
  • 1
  • 1
user1430430
  • 21
  • 1
  • 6

1 Answers1

0

Something you could start with:

    [DllImport("user32.dll")]
    private static extern int FindWindow(string lpszClassName, string lpszWindowName);
    [DllImport("user32.dll")]
    private static extern int ShowWindow(int hWnd, int nCmdShow);
    private const int SW_HIDE = 0;
    private const int SW_SHOW = 1;

    public void WindowsToolbar(bool visible)
    {
        int hWnd = FindWindow("Shell_TrayWnd", "");
        ShowWindow(hWnd, visible ? SW_SHOW : SW_HIDE);
    }

    public void HideTaskBarIfNeeded(Form form)
    {
        if (Screen.PrimaryScreen.Equals(Screen.FromRectangle(Screen.GetBounds(form))))
        {
            WindowsToolbar(false);
        }
    }
Oliver
  • 43,366
  • 8
  • 94
  • 151