Click here to Skip to main content
13,143,424 members (34,781 online)
Click here to Skip to main content
Add your own
alternative version


6 bookmarked
Posted 20 May 2012

Windows Mobile: Kiosk Mode Series: Part 1

, 20 May 2012
Rate this:
Please Sign up or sign in to vote.
How can you achieve a kiosk mode application, where the user is only allowed to do what you define.

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 C# 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, don't ask me about the name selection) to test all functions I will describe.

Left is Windows Mobile 6.1 and right image shows Windows Embedded Handheld 6.5.3! You can use the ShFullScreen menu on both, but it will only work with Mobile 6.1. But the test “Form without StartIcon” will bring up a form without Start button.

OK, let’s look at what we can do to hide the Start icon for a new form:

private void mnuStartIconTestForm_Click(object sender, EventArgs e)
  Lockdown.LockDown.SetRegistryFullScreen(true, false, false);
  LockDownTestForm frm = new LockDownTestForm();

The function SaveRegistryFullScreen() saves the state of the registry values of TextmodeEnabled, HardwareStartKeyEnabled, and HardwareDoneKeyEnabled below “HKLM\SOFTWARE\Microsoft\Shell\BubbleTiles”.

The function SetRegistryFullScreen(bool bStartButtonPresent, bool bDoneButtonPresent, bool bTextMode) sets the registry key according to the args. So, if bStartButtonPresent is set to true, the registry value of HardwareStartKeyEnabled is set to 1. With this setting, the next form or window is shown without Start button. Easy, isn’t it. The other args work similar.

RestoreRegistryFullScreen will restore the registry to the state saved with SaveRegistryFullScreen().

How can you remove all buttons that enable the user to quit or minimize a form? To show a compact framework form with or without Done or Minimize buttons, you just have to set the right properties of the form. But don't forget to give the user an option to get back from a form.

The ControlBox property switches the (X)/ (OK) button display. The clicking an (OK) button will close and exit a form or application:

private void mnuControlBox_Click(object sender, EventArgs e)
  if (this.ControlBox)
    //show the (X) button, hide OK button
    this.ControlBox = false;
    mnuControlBox.Checked = false;
    //remove the (X) button in title, show the OK button
    this.ControlBox = true;
    mnuControlBox.Checked = true;

The MinimizeBox property of a compact framework form switches the (OK) button to a (X) button. Where (X) stands for minimize window.

private void mnuMinimizeBox_Click(object sender, EventArgs e)
if (this.MinimizeBox)
//hide minimize button (OK)
this.MinimizeBox = false;
mnuMinimizeBox.Checked = false;
//show minimize button (OK)
this.MinimizeBox = true;
mnuMinimizeBox.Checked = true;

The Test application has also menu options to test these properties as “Window Options”.

The menu option Maximize shows the testform maximized (oh, wonder), but that means only, that the taskbar at the top is hidden and the client area is larger. If you additionally set the menu to null, you will get a real full screen form:

You have to press the Escape key (hopefully you have one) to bring the menu back in the test application.

The class file LockDown offers some more functions, but these are left for another article.

The whole code with the test application is available here. You need a subversion client like TortoiseSVN or AnkhSVN to checkout the source code.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Germany Germany
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralMy vote of 5 Pin
Royston Rodrigues30-Jun-12 18:01
memberRoyston Rodrigues30-Jun-12 18:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.170915.1 | Last Updated 20 May 2012
Article Copyright 2012 by hjgode
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid