[Windows Mobile Development and Hacking General] WJames:
Source Code Finally Posted...

Sorry it took so long to post the source. I haven't been monitoring this thread for some time due to other time demands. A recent email reminded me that I promised to release the source, so here ya go...

Release 6 Notes Below...

About a week ago, I was looking for an app that would lock my wizard when it came out of suspend. I use a bluetooth headset for all my calls, so I rarely remove my phone from its carrier. However, while talking, I tend to move around and frequently the hang-up button would be pressed resulting in a disconnect.

Frustrated, I looked at a few apps. I really like the "Slide to Unlock" feature in the iPhone-like app S2U. It more or less suited my needs. However, my bluetooth headset wouldn't work with S2U installed.

Thus I set about writing an app that would "lock" the phone whenever it came out of suspend mode. The result is the app, LockDown, attached to this post. Once run, LockDown sits in the background waiting for "resume" event. At this time, it locks all keys and prevents any stylus events save one - a "Slide right to unlock" slider control. As with S2U, once the thumb tab is slid all the way to the right, the keys are unlocked and the unit once again responds to the stylus. Also note that LockDown only takes up 5k of memory.

LockDown has been tested on TNT.1933 (WM6) for the Wizard. It's compiled as a PPC 2003 app, so in theory it should also work on WM5 and any PPC 2003 devices. I've tested it with my Visual Studio WM5 and PPC emulators, and it worked fine. However, it couldn't test it on the real deals.

It's a new app. While I'm not experiencing any problems, please consider it beta for now. As such, don't wire it up as an auto-start link until you've run with it awhile and are certain it works as advertised. For now, I suggest just copying it to your \windows folder and linking to it there. If you have any problems, please report them, and I'll address them ASAP.

Release 6 Notes

The slider bug was fixed.

The Message option was fixed.

Application Invocation

Lockdown [-lock] [-close]

With the -lock parameter, the application starts in lock mode.

With the -close parameter, the application is removed from memory (if running).

Registry Options in Folder \HKEY_LOCAL_MACHINE\Software\Lockdown\Slider

Position (DWORD, 0):

If set to 0, the slider is centered.

If > 0, the slider is positioned X pixels below the "Top Taskbar".

If < 0, the slider is positioned X pixels above the "Bottom Taskbar".

Padding (DWORD, 2):

Pixel offsets for slider arrow from the left and right edges of the slider window.

Message (String, "Slide right to unlock.")

The text message displayed in the slider window.

TextColor (DWORD, 00FFFFFF hex):

Color of slider message. Note that the HEX color format is 00BBGGRR where BB is blue, GG is green, and RR is red.

FontPoint (DWORD, 16):

The font size of the slider message.

PenColor (DWORD, 00F04050 hex):

Color of the slider arrow.

BackgroundColor (DWORD, 00CCCCCC hex):

Color of the slider background.

WidthMultiplier (String, .92):

Must be a floating point value. Multiply this value with the lesser value of the desktop height or width (in pixels) to determine the slider width.

For example: If the desktop display is 240 by 320 and the WidthMultiplier is 0.9, the slider width is 216 (240 X .9) pixels.

HeightMultiplier (String, .22):

Must be a floating point value. Multiply this value with the lesser value of the desktop height or width (in pixels) to determine the slider height.

TabWidthMultiplier (String, 1.5):

Must be a floating point value. Multiply this value with the calculated slider height to determine the width of the slider arrow.

Note that the height of the arrow is always equal to the height of the slider.

EnableAnswer (DWORD, 1):

If set to 1, the answer button is enabled during an incoming call period (while the phone is ringing).

If set to 0, the answer button is always disabled.

EnableIgnore (DWORD, 1):

If set to 1, the ignore button is enabled during an incoming call period (while the phone is ringing).

If set to 0, the ignore button is always disabled.

After the installation, only the Position key will be present in the registry. I figure that most users will only tweak this value.

To modify the other parameters, add the appropriate keys with the defined types as shown in parenthesis. The default values are also listed in the parenthesis.

If you decide to tweak these parameters, please remove any shortcut to Lockdown from the StartUp folder. While I've taken steps to prevent "bad" values in these parameters, I still suggest this precaution.

Please note that Lockdown must be terminated and restarted before any changes to registry settings take effect.

As always, if you have any issues, please let me know.

W James