Cloud Training (Online)

Kiosk Mode Library for Windows Mobile

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 .

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 .

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

Senthil Kumar B
Senthil Kumar is a former Microsoft MVP (Most Valuable Professional). He is a Co-Author of the book "Windows 10 Development Recipes using JavaScript and CSS" for Apress Publication. He is a technical presenter, blogger, mentor and a Geek.  Senthil is a regular speaker is various local user groups. He has presented at conferences like Great Indian Developer Summit (GIDS) & Microsoft DevCamps. You can reach out to him via his Twitter handle @isenthil.