Archive for the ‘CodeProject’ Category.

Mobile Development: Yet another kiosk mode library

Hello

here is another kiosk mode library. It supports disabling clicks/taps on start menu icon and opening the Windows Mobile start menu using the win key (VKLWIN). Additionally there is a function to disable the whole StartMenu bar and one to make a window fullscreen without Done and Close button (uses SHFullScreen).

The functions are implemented in a DLL, so you can easily use them from C/C++, the dot net compact framework (CSharp or VB.NET), Java and so on.

Here is a list of the functions exported by the DLL:

void __stdcall LockStartMenu(); // this will install the hook (subclass the taskbar window)
void __stdcall UnlockStartMenu();   // this will unhook TaskbarWindowProc from taskbar
void __stdcall LockStartBar();  // this disables the whole taskbar
void __stdcall UnlockStartBar();    // this enables the taskbar window
bool __stdcall Lockdown(TCHAR*);    // this will make the application with the window title fullscreen etc
bool __stdcall Unlockdown();    // this will 'normalize' the fullscreen window

I have included a deno application in C and .NET

The left shows normal window ce window and the right the same window after pressing the [Lockdown window].

Continue reading ‘Mobile Development: Yet another kiosk mode library’ »

Mobile Development: another keyboard hooking tool: keyToggleCtrl

This is again a keyToggle application. An application that works in background using a keyboard hook.

After keyToggleCtrl has been started, it will install a keyboard hook and watches the keyboard messages for the appearance of the toggle, or as I call it, the sticky key.

When the sticky key is detected, keyToggle Ctrl will watch the keyboard messages for the keys listed in a keytable (default is watching for presses of the number keys 0 to 9). If the pressed key matches a key in the keytable, keytogglectrl will remove the message from the window message queue and instead send the key found in CharTable with Control pressed before and released after the replaced key.

For example, you press the sticky key, the LED defined by LedID should light and if you then press 0, keyToggleCtrl will send instead Control+C to the active application.

KeyTest3AK IMAGE

Continue reading ‘Mobile Development: another keyboard hooking tool: keyToggleCtrl’ »

Mobile Development: A battery monitor for the taskbar

Hello

this time I will show how I did a battery monitor that shows on the taskbar. The C source code uses the drawing functions DrawRect and Polygon to draw a battery symbol onto the taskbar. The drawing is updated every second by a background thread, that queries the battery status using GetSystemPowerStatusEx2. The thread then sends the battery flag reading using SendMessage with WM_USER.

Why did I write an app that already exists? If you look at your windows mobile taskbar, you will find, that the battery or the clock disappear from the taskbar. They will not be visible in all programs, depending on the space left on the taskbar. If you need to have a battery monitor that is shown all the time, this one may be for you. It will just show all the time on top of the taskbar.

The code

The drawings are done from arrays of POINT or RECT structures. So it is easy to change the drawings:

Continue reading ‘Mobile Development: A battery monitor for the taskbar’ »

keyToggleChar – a tool to enter UTF-8 national chars via keyboard

As you may know my keyToggle app to be able to use the number keys on a windows mobile device as function keys, here is another one that enables you to enter special national chars, like Å, Ä Æ etc. directly via the keyboard. You must specify 10 keys and there UTF-8 replacements. Configuration is done via the registry:

3.0        added code for read/write reg for CharTable and KeyTable
 REGEDIT4

 [HKEY_LOCAL_MACHINE\Software\Intermec\KeyToggleChar]
 "KeyTable"=hex:\
 30,31,32,33,34,35,36,37,38,39
 "CharTable"=hex:\
 C6,00,E6,00,D8,00,F8,00,C5,00,E5,00,C2,00,E2,00,C4,00,E4,00
 "LEDid"=dword:00000001
 "autoFallback"=dword:00000000
 "Timeout"=dword:00000003
 "StickyKey"=dword:00000074

 KeyTable     holds a list of 10 keys which will be 'remapped'
 CharTable    holds  list of UniChar codes to use as replacement
 LEDid        defines the ID of the LED to use for showing sticky state
 autoFallback defines, if the sticky state is reset after a mapped key is pressed.
              Use 0, if you dont want the sticky state to fallback after keypress
 TimeOut      defines a timout after which sticky state will be reset

To get the UTF-8 word entries for Unicode chars, see for example here: http://www.unicode.org/charts/charindex.html

The default mapping used here is defined as follows and maps the keys 0-9 to:

0x00c6, 0x00e6, 0x00d8, 0x00f8, 0x00C5, 0x00e5, 0x00c2, 0x00e2, 0x00c4, 0x00e4
 AE        ae     O/       o/      A°      a°      A^      a^      Ä       ä

The main problem I had was finding a function to get the window handle of the current input active window. Finally I found GetForegroundKeyboardTarget() (after some days of searching).

Continue reading ‘keyToggleChar – a tool to enter UTF-8 national chars via keyboard’ »