Disable menu bar in Windows Mobile 6.5

天涯浪子 提交于 2019-12-05 08:53:35

You can hide the whole top taskbar and maximize your form:

// the following three lines are p/invoked
IntPtr tWnd = FindWindow("HHTaskBar", null);
EnableWindow(tWnd, false);
ShowWindow(tWnd, SW_HIDE);

// maximize your form
form.Size = new Size(240, 320); // or whatever the device's screen dimensions are
form.WindowState = FormWindowState.Maximized;

Try the method SHFullScreen with SHFS_HIDETASKBAR which is described this way on MSDN:

Put the taskbar at the bottom of the z-order. Note that a game or an application that requires the entire screen may use this flag. Be sure that your application is sized to full screen before using this flag. Otherwise, it will appear as though the function did nothing.

protected override void OnLoad(EventArgs e)
{
    ...

    SHFullScreen(this.Handle, SHFS_HIDETASKBAR | 
        SHFS_HIDESIPBUTTON | SHFS_HIDESTARTICON);

    base.OnLoad(e);
}

private const int SHFS_SHOWTASKBAR = 0x0001;
private const int SHFS_HIDETASKBAR = 0x0002;
private const int SHFS_SHOWSIPBUTTON = 0x0004;
private const int SHFS_HIDESIPBUTTON = 0x0008;
private const int SHFS_SHOWSTARTICON = 0x0010;
private const int SHFS_HIDESTARTICON = 0x0020;

[DllImport("aygshell")]
static extern bool SHFullScreen(IntPtr hwnd, int dwState);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!