iLock: a tool to lock the startup process of a windows mobile device

In commercial environments, we are often asked about KioskMode support for Windows Mobile device. Unfortunately the consumer OS Windows Mobile does not support a Kiosk Mode.
To workaround this, a programmer has to use several techniques to prevent the user from changing settings or playing games on a Windows Mobile device that is running for example a Direct Delivery Store application. But this blog entry is not about what the programmer can do to lock the user in his/her application.

The iLock tool is a fast starting locking application that will lock the user from changing settings or starting unwanted applications until the productive application has been started. Why do you possibly need such a tool? It is because your application may need some more time to startup than this simple and native iLock Windows C application.

How does it work?

  • iLock5 should be started automatically. Normally you can achive this with a lnk file in \Windows\Startup pointing to iLock5.
  • After iLock is started, it will periodically lock the start menu.
  • The iLock4 window will also remain or come back to front on top of all other windows until the target application is started.
  • If iLock recognizes the target process is started, it will than start to look for the window title and/or class name of the target application
  • After the target window is recognized, iLock will wait some more time
  • Before iLock ends itself, it can maximize the target or keep the taskbar locked

All the necessary paramters are controlled via the registry:

REGEDIT4

[HKEY_LOCAL_MACHINE\Software\Intermec\iLock]
"FreeDesktopOnExit"="1"
"TextBackColor"=dword:00FFFFFF
"TextListColor"=dword:00FFFFFF
"TextColor"=dword:002B1CE2
"WaitBeforeExit"=dword:00000003
"UseMenuBar"="1"
"UseDesktopLock"="0"
"MaximizeTargetOnExit"="0"
"KeepLockedAfterExit"="1"
"UseFullScreen"="1"
"App2waitFor"="ccelad.exe"
"Title2waitFor"="000 - Hauptmenü"
"Class2waitFor"=""
"HotSpotX"=dword:00000078
"HotSpotY"=dword:000000A0

Here is short overview of the different settings:

“FreeDesktopOnExit”=”1”
enable desktop on exit, default 1, will work only if UseDesktopLock=”1″

“TextBackColor”=dword:00FFFFFF
“TextListColor”=dword:00FFFFFF
“TextColor”=dword:002B1CE2

Here you can define RGB color values for the status list box of iLock. define colors as RGB values 00BBGGRR, default black text on white

“WaitBeforeExit”=dword:00000003
seconds to wait before exit

“UseMenuBar”=”1”
show a menubar, default 0

“UseDesktopLock”=”0”
lock the desktop, default 0

“MaximizeTargetOnExit”=”0”
Specify “1” if you like iLock to maximize the application it waits for.

“KeepLockedAfterExit”=”1”
When iLock3 ends itself, it can leave taskbar and desktop locked or not.

“UseFullScreen”=”1”

You can have iLock3 occupy the whole screen or spare for taskbar and menu bar.

“App2waitFor”=”vxutil.exe”
Enter the executable of the process you would like iLock3 to wait for. Dont leave blank, device will remain locked in iLock3.

“Title2waitFor”=”000 – Hauptmenü”
Specify the Title of the window you would like iLock3 to wait for. Dont leave blank, device will remain locked in iLock3..

“Class2waitFor”=””
Specify the Class Name of the Window you would like iLock3 to wait for. Can be empty.

“HotSpotX”=dword:00000078
“HotSpotY”=dword:000000A0

define the hotspot location. dbl_click within 10 pixels around the location lets you end iLock.

Remarks

Password proteced exit: Before you can end iLock manually you have to give the password 52401

If iLock finds the bitmap file \Windows\iLock5.bmp, it will use this bitmap as background image.

Installation of iLock5

  1. copy the iLock5.exe and iLock5.bmp to \Windows dir on device
  2. copy iLock5.lnk file to \Windows\StartUp
  3. edit the registry and enter all of the above settings. You can use the supplied reg file as template. You can use CeRegEdit (PC software to edit device registry) or Tascal RegEdit (device tool).
  4. is your application already prepared start automatically after reboot?
  5. reboot device

Download source code (Visual Studio 2005 / Windows Mobile 6 SDK) and binaries: [Download not found]