Posts tagged ‘kiosk mode’

Windows Mobile: Kiosk Mode Series, part 1

Hello

I would like to start a series of articles of how you can lockdown your application user in your application. How can you achieve a kiosk mode application, where the user is only allowed to do what you define.

The first article is about the Windows Start and Done Icon in menu bar and about fullscreen. You may already know, how to hide the start and done icon permanently from a Windows Embedded Handheld (Windows Mobile 6.5.3) device: Link

But there is also a temporary way using the same approach. The trick is to change the registry keys, that make the OS believe you have hardware buttons for Start and Done, BEFORE you show your CSharp form.

Before Windows Embedded Handheld (WEH, or Windows Mobile 6.5.3), you are able to use SHFullScreen API calls. But this will not work with WEH. Neither the flags SHFS_HIDESIPBUTTON nor SHFS_HIDESTARTICON will work. The LockDown.cs class also includes code for that and you may test the functions with the Test-Application.

The class I am talking about is called LockDown. There is also a Test-Application (OEMTitleBarHandler, dont ask me about the name selection) to test all functions I will describe.

Continue reading ‘Windows Mobile: Kiosk Mode Series, part 1’ »

Windows Mobile: Disable Low Battery Warning

Although I dont recommend this, it may be usefull if your kiosk mode app watches and manages the battery level: you can disable the low battery warning. Sometimes such hacks are hard to find, now there is one more location in internet.

In the registry find the key

[HKEY_CURRENT_USER\ControlPanel\Notifications\{A877D663-239C-47a7-9304-0D347F580408}]

This is the entry responsible for low battery warnings

Add a new REG_SZ key: “Default” with for example the text “Low Battery Warning”

"Default"="Low Battery Warning"

This entry is used to display the notification in the list of notifications in Start-Settings-Sounds&Notifications. To disable the notification itself it is not really necessary, but easier to control.

The Options entry in the registry defines which options your selected in Start-Settings-Sounds&Notifications, for example play a sound or display a user notification. Set Options to REG_DWORD=0x00 and there will be no notification when the battery goes down to 10% (depends on the device) and lower.

Here is the change in full:

REGEDIT4
[HKEY_CURRENT_USER\ControlPanel\Notifications\{A877D663-239C-47a7-9304-0D347F580408}]
"Options"=dword:00000000
"Default"="LowBattWarning"

You need to reboot the device after the change!

Only a small tipp

Mobile Development: Disable Windows Mobile 6.5 Start and Close Button

Hello

here is one other way to write a kios mode .NET application using a technique called SubClassing. The idea was born by a comment of redwolf2222 on this blog about how to Hide Start and Close buttons on Windows Mobile 6.5 devices. Redwolf2222 also provided a code snippet. Unfortunately it was incomplete and so I wrote my own class.

Disable clicks on Start and Close button

The demo project shows one dialog with two check boxes and you can easily test the function. If “StartButton Disabled” or “Close Button disabled” is checked, you cannot ‘click’ the corresponding button any more:

You still ‘click’ the buttons but the subclassed window will not ‘execute’ your click. The buttons are part of the toolbar32 window which is a child of the menu_worker window. So first we have to follow the window tree.

Find the right window

/// <summary>
/// SubClassing: Install the wndproc hook
/// </summary>
/// <returns></returns>
private bool hookWindow()
{
    //find taskbar
    IntPtr hWndTaskbar = FindWindow("HHTaskbar", IntPtr.Zero);
    if (hWndTaskbar == IntPtr.Zero)
        return false;
    //enable the taskbar, not realy necessary
    EnableWindow(hWndTaskbar, true);
    //already installed?
    if (oldWndProc == IntPtr.Zero)
    {
        //find the menu_worker window
        IntPtr hwndMenu_Worker = FindWindow("menu_worker", IntPtr.Zero);
        if (hwndMenu_Worker != IntPtr.Zero)
        {
            //get the child window which has the buttons on it
            IntPtr hwndToolbar = GetWindow(hwndMenu_Worker, GetWindow_Cmd.GW_CHILD);
            if (hwndToolbar != IntPtr.Zero)
            {
                _mHwnd = hwndToolbar;       //store to remember
                SubclassHWnd(hwndToolbar);  //subclass the wndproc
            }
        }
    }
    return true;
}

Subclassing

Now, as we have the window handle, the subclassing can be started:
Continue reading ‘Mobile Development: Disable Windows Mobile 6.5 Start and Close Button’ »

Windows Mobile: Hide StartButton in WinMo 6.5.x

Here is a very short tip based on a finding at xda-developers.com

See also here for how to hide the Start and Done button temporary.

For kiosk mode applications you dont want the user access the device settings or the start menu and all the programs and games accessible from there. One step to this kiosk mode is disabling the Start Button, the button that opens a menu to access programs and settings.

In versions of windows mobile before 6.5.3, you could disable access to the start button by subclassing HHTaskbar and discard clicks in the Start button area or simply disable the whole HHTaskbar window.

Now, with windows mobile 6.5.3 the start button is part of the menu bar and no longer part of the taskbar (which is now called MenuBar). To hide the start button on a windows Mobile 6.5.x device you can use following registry change:

[HKEY_LOCAL_MACHINE\Software\Microsoft\Shell\BubbleTiles]
"TextModeEnabled"=dword:00000001
"HardwareStartKeyEnabled"=dword:00000001
"HardwareDoneKeyEnabled"=dword:00000001

With this change the “MenuBar” will no longer show the Start Button graphic nor the Done button, Windows Mobile will no longer decorate the menu texts . Only two menu entries will now show on bottom of the today screen.

TextModeEnabled switches the display of soft menu entries from the default graphic tiles display to a text only display as it was and is in windows mobile 6.1.

HardwareStartKeyEnabled controls the display of the Start button (the big windows start symbol on the left of the soft menu). If you change to enabled (0x01) you dont get a start button and have to use a key on your keypad to launch the start screen!

HardwareDoneButton controls the display of the Done button at the right of the menu bar (the big (X)). When enabled, you have no chance to close apps that do not have an exit option in there menu, except you have a key on on your keyboard assigned to the Done function! Done now not only hides an app, with winmo 6.5 the app is closed and removed from memory now.

The Start entry at top left corner remains there but is only an indicator.

NO more Start Button, No more Done (X) Button

Continue reading ‘Windows Mobile: Hide StartButton in WinMo 6.5.x’ »