Kiosk Mode Library for Windows Mobile and C#

Some times when developing Windows Mobile Application  you might want to make sure that users cannot navigate to and use any of the other programs except your program. This means that the windows start button in the taskbar must be disabled .

Kiosk Mode Library for Windows Mobile and C#

There are some predefined functions in the coredll.dll in Windows Mobile

<DllImport("coredll.dll")> _
Public Shared Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr End

Function  <DllImport("coredll.dll")> _
Public Shared Function ShowWindow(ByVal hWnd As IntPtr, ByVal visible As Integer) As IntPtr End Function

To Disable the Start Button , you can use

ShowWindow(FindWindow("HHTaskBar", Nothing), 0)

Note the HHTaskBar . This is a windows handle for the task bar , but when we hide this , this will hide the entire window along with the X button .

Instead , you can use the EnableWindow function with false as parameter to disable the window rather than hiding it or even the function SHFullScreen with the parameter ( SHFS_SHOWTASKBAR , SHFS_HIDETASKBAR,SHFS_SHOWSIPBUTTON,SHFS_HIDESIPBUTTON,SHFS_SHOWSTARTICON , SHFS_HIDESTARTICON ) .

Some times this might be more troublesome , if you want to disable the same on the other programs too like Calculator etc …but still enable the X button .

Kiosk Mode Library for Windows Mobile and C#

Here’s a simple Kiosk Mode Library that i found was simple and easy to use from the Windows CE Programming Blog

The functions are implemented in a Dll file (StartLock.dll) that is written using Embedded Visual C++ 4.0 , which means the functions are accessible from any managed language code like VB.NET / C# .

Simple isn’t it ?.

The list of functions supported by the library includes .

1. LockStartMenu();

2. UnlockStartMenu();

3. LockStartBar();

4. UnlockStartBar();

5. Lockdown(TCHAR*);

6. Unlockdown();
You can find more information on downloading and using the library in the Windows CE Programming’s
Mobile Development: Yet another kiosk mode library

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...