Javscript would provide a navigation menu here. HOME

Locking Down The Handheld-eC++ and C#

Lock Down Application eVC++

1. Here is a sample eVC++ app that locks down the unit into an application.

A.) You must have the SHFullScreen() calls. These need to be in at least three places for each dialog in the application.

B.) ModifyStyleEx(0,WS_EX_NODRAG,0);
Are both needed to ensure that the screen is full screen

C.) Then there's a little feature of Pocket PC that will cause the today screen to popup after 4 hours of inactivity so you need to turn that off with some code that tweaks the HKLM\Software\Microsoft\Shell\Rai registry key to a zero.

D.) The last thing that I can think of that needs to be done is to disable the application keys (A1-A4). There are a couple of ways to do this. The least invasive and easiest way (I think) is to use the Game API to ignore those keys. That is what the GXOpenInput() call, OnKeyDown(), and OnClose() functions help with. The Game API must be downloaded from Microsoft's web site. I don't think it is part of their normal SDK install.

The brute force way to disable the application keys is to remap them all in the registry so that they all point to your application. The problem with this is that those keys stay mapped to your application even after the application exits. With GAPI, when the application exits the App keys still work as they did before. The code to do this registry method is in the source but commented out.

Final notes. This sample app goes through and copies files around the system.

2. Look for this line of code in the attached example. Then add the next line commenting out the first.
// ModifyStyleEx(0,WS_EX_NODRAG,0); // Don't allow the user to drag the dialog around
ModifyStyleEx(WS_EX_CAPTIONOKBTN,WS_EX_NODRAG,0); // Don't allow the user to drag the dialog around

This is just the program. To lock down your handheld you will need to create a cab file that you put into the \storage card\cabfiles directory. If the user did a cold boot the program would extract on its own and start up using autouser.dat.

Additional things to consider:
* Create a cabfile that loads your program and also the dlls and registers all these files.
* Include an Autouser.dat file that gets written to the 2577 directory. This will call your program to start up after a warm or cold boot.
* Use RegFlushKey() API call to copy the registry to the storage card. If this is done the unit copies the saved registry back into memory after a cold boot. This saves such things as IP address, WEP key, and any other registry setting.

Lock Down Application C#

Either in the Load event or through the designer:

this.MaximizeBox = false;
this.MinimizeBox = false;
this.WindowState = FormWindowState.Maximized;
this.Top = 0;
this.Left = 0;
this.Height = 320;
this.Width = 240;

Remove the Menu At this point you have a full screen application To lock down:

Disable today Screen

can be done in the CAB file or by P/Invoking the Registry API


Be warned: The today screen will not show and the OS does NOT update the background of the start window!

Disable application keys using Game API DLL Import

use (in eVC):


        #include "gx.h"
        #pragma comment (lib, "gx.lib")
        GXKeyList g_gxkl;                               // GX struct

InitInstance part:

        //GAPI init
        int iRet;
        iRet = GXOpenInput();
        g_gxkl = GXGetDefaultKeys(GX_NORMALKEYS);

Before quiting the app, ie in DestroyWindow, use