Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

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

0.00/5 (No votes)
19 Mar 2010 1  
iLock5, a tool to lock Windows mobile startup

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 achieve 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 then 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 parameters 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:

C++
"FreeDesktopOnExit"="1?

enable desktop on exit, default 1, will work only if UseDesktopLock=”1?.

C++
"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.

C++
"WaitBeforeExit"=dword:00000003

seconds to wait before exit.

C++
"UseMenuBar"="1?

show a menubar, default 0.

C++
"UseDesktopLock"="0?

lock the desktop, default 0.

C++
"MaximizeTargetOnExit"="0?

Specify “1? if you like iLock to maximize the application it waits for.

C++
"KeepLockedAfterExit"="1?

When iLock3 ends itself, it can leave taskbar and desktop locked or not.<

C++
"UseFullScreen"="1?

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

C++
"App2waitFor"="vxutil.exe"

Enter the executable of the process you would like iLock3 to wait for. Don't leave blank, device will remain locked in iLock3.

C++
"Title2waitFor"="000 – Hauptmenü"

Specify the Title of the window you would like iLock3 to wait for. Don't leave blank, device will remain locked in iLock3..

C++
"Class2waitFor"=""

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

C++
"HotSpotX"=dword:00000078
"HotSpotY"=dword:000000A0

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

Remarks

Password protected 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 to start automatically after reboot?
  5. Reboot device

Download source code (Visual Studio 2005 / Windows Mobile 6 SDK) and binaries here. <!-- Social Bookmarks BEGIN -->

<!-- Social Bookmarks END -->

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here