Disable menu bar in Windows Mobile 6.5

I am migrating a .NET application from WM5 to WM6.5. In addition to the new resolution, I noticed different user interface settings for the Start menu and the title (title bar). My application should work in kiosk mode, where the user cannot exit the application and bypass our authentication. To do this, on WM5, I hid the start button and the close button. I am using the following function:

SHFullScreen(hWnd, SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON); 

Hiding the buttons also works on WM6.5, but there is another problem. The user can click on the title bar (menu bar, title bar - I’m not sure that the correct name for him is the panel at the top of the screen) and get access to the Windows task manager. See attached screenshot Application

, : Task manager starting

, ? - Motorola MC65. Windows Mobile 6.5.

, , :

IntPtr tWnd = FindWindow("HHTaskBar", null);
EnableWindow(tWnd, false);

HHTaskBar . , .

+5
2

:

// 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 screen dimensions are
form.WindowState = FormWindowState.Maximized;
+5

SHFullScreen SHFS_HIDETASKBAR, MSDN:

- . , , . , . , .

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);
0

All Articles