Tuesday, 8 January 2008

Windows CE 5.0 device driver development-Part 2

How ca we build a driver for Device manufacturer specific functionalities and use it from an apps without using device IOCTLs:



1. lets make a folder DeviceFunc

2. make a new file DeviceFunc.cpp in the above folder

lets edit this as this will be our main device driver source file.



#include



#ifdef __cplusplusextern "C"

{

#endif



void GreenLEDControl(BOOL OnOff )

{

RETAILMSG (1, (TEXT(" Green LED is currently=%d\r\n"), OnOff ));

}

void

(BOOL OnOff )

{

RETAILMSG (1, (TEXT(" RED LED is currently=%d\r\n"), OnOff ));

}

void BacklightControl(BOOL OnOff )

{

RETAILMSG (1, (TEXT(" Backlight is currently =%d\r\n"), OnOff ));

}

void WirelessControl(BOOL OnOff )

{

RETAILMSG (1, (TEXT(" Wireless is currently=%d\r\n"), OnOff ));

}

void DisplayControl(BOOL OnOff )

{

RETAILMSG (1, (TEXT(" Display is currently=%d\r\n"), OnOff ));

}

#ifdef __cplusplus

}

#endif



BOOL WINAPI DllEntry( HANDLE hinstDLL, DWORD Op, LPVOID lpvReserved )

{

return TRUE;
}



now we have the code lets make a def file which will export these functions:



LIBRARY DeviceFunc
EXPORTS

GreenLEDControl

RedLEDControl

BacklightControl

WirelessControl

DisplayControl



and now lets make a sources file:



TARGETNAME=DeviceFunc



RELEASETYPE=PLATFORM



TARGETTYPE=DYNLINK


TARGETLIBS= \$(_COMMONSDKROOT\lib\$(_CPUINDPATH\coredll.lib \

$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\ceddk.lib


DEFFILE=DeviceFunc.def


DLLENTRY=DllEntry


SOURCES= DeviceFunc.cpp





now we have made copy a makefile from a standard wince driver directory and compile the folder.

you will get a DeviceFunc.dll file.



Now to the next step, how can we access these exported functions on our device by other drivers\applications:



Lets first take an app implementation:

typedef void (*PFN_BacklightControl)(BOOL fOn);

HINSTANCE gDeviceFuncDll = NULL;

gDeviceFuncDll =LoadLibrary(TEXT("DeviceFunc.dll"));

pfnBrightnessUp = (PFN_BacklightControl)GetProcAddress(gDeviceFuncDll , TEXT("BacklightControl"));

Windows CE 5.0 device driver development-Part 1-Basics

A driver is simply a DLL (dynamic link library), DLL’s are loaded into a parent process address space, the parent process can then call any of the interfaces exposed from the DLL – the driver is typically loaded by it’s parent process through a call to LoadLibrary( ); or LoadDriver( ); - LoadDriver not only loads the DLL into the parent process address space but will also make sure the DLL isn’t paged out.



On Windows CE, stream drivers are opened just like files, and are opened using a unique three letter prefix (e.g. BKL,COM,TST,PWR).


The core stream interface entry points are:

XXX_Open (Device Manager)

XXX_Close (Device Manager)

XXX_Read (Device Manager)

XXX_Write (Device Manager)




1. Choose a unique three letter identifier for your driver. lets choose it as TST.

2. name the driver - here we will name it as TestDriver

3. Next, you will need to implement the required entry points.

lets see required functions for a complete stream driver:


//TestDriver.c by Umesh Jagga
#include


//This function initializes a device. It is called by Device Manager.
//This function is required by drivers loaded by ActivateDeviceEx, ActivateDevice, or

//RegisterDevice.
DWORD TST_Init(LPCTSTR pContext, LPCVOID lpvBusContext);


//This function de-initializes a device. It is called by Device Manager
BOOL TST_Deinit( DWORD hDeviceContext );


//This function opens a device for reading, writing, or both. An application indirectly invokes

//this function when it calls the CreateFile function to open special device file names.
DWORD TST_Open( DWORD hDeviceContext, DWORD AccessCode, DWORD ShareMode );

//This function closes a device context created by the hOpenContext parameter.

//An application calls the CloseHandle function to stop using a stream interface driver. The hFile

//parameter specifies the handle associated with the device context. In response to

//CloseHandle, the operating system invokes XXX_Close.

BOOL TST_Close( DWORD hOpenContext );

//This function sends a command to a device.

//An application uses the DeviceIoControl function to specify an operation to perform. The

//operating system, in turn, invokes the XXX_IOControl function

BOOL TST_IOControl( DWORD hOpenContext, DWORD dwCode, PBYTE pBufIn, DWORD dwLenIn, PBYTE pBufOut, DWORD dwLenOut, PDWORD pdwActualOut );void USB_PowerUp( DWORD hDeviceContext );



void TST_PowerDown( DWORD hDeviceContext );


//This function reads data from the device identified by the open context

//an application calls the ReadFile function to read from the device, the operating system

//invokes this function.


DWORD TST_Read( DWORD hOpenContext, LPVOID pBuffer, DWORD Count );

//This function writes data to the device.

//After an application uses the WriteFile function to write to the device, the operating system,

//invokes this function.

DWORD TST_Write( DWORD hOpenContext, LPCVOID pBuffer, DWORD Count );

//This function moves the data pointer in the device.

//After an application calls the SetFilePointer function to move the data pointer in the device,

//the operating system invokes this function.
//If your device is capable of opening more than once, this function modifies only the data

//pointer for the instance specified by hOpenContext.
DWORD TST_Seek( DWORD hOpenContext, long Amount, WORD Type );



//If the function is used, it is called by the system when processes and threads are initialized

//and terminated, or on calls to the LoadLibrary and FreeLibrary functions.

//Direct entry point for a DLL.

//If you use the C Runtime in your application, it is responsible for performing any initialization

//of the C Runtime at process attach, and for deinitializing the C Runtime at process detach

// ----------------------------------------------------
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID pReserved )

{

switch(ul_reason_for_call)

{

case DLL_PROCESS_ATTACH:

OutputDebugString(L"TestDriver - DLL_PROCESS_ATTACH\n");

break;

case DLL_PROCESS_DETACH:

OutputDebugString(L"TestDriver - DLL_PROCESS_DETACH\n");

break;

case DLL_THREAD_ATTACH:

OutputDebugString(L"TestDriver - DLL_THREAD_ATTACH\n");

break;

case DLL_THREAD_DETACH:

OutputDebugString(L"TestDriver - DLL_THREAD_DETACH\n");

break;

default:

break;

}

return TRUE;

}

// Driver Init...

DWORD TST_Init( LPCTSTR pContext, LPCVOID lpvBusContext)

{

OutputDebugString(L"TestDriver - TST_Init - Context: ");

OutputDebugString(pContext);

OutputDebugString(L"TestDriver - ~ TST_Init\n");

return 0x1234;

}

BOOL TST_Deinit( DWORD hDeviceContext )

{

OutputDebugString(L"TestDriver - TST_Deinit\n");
OutputDebugString(L"TestDriver - ~ TST_Deinit\n");

return TRUE;


}
// Driver Open

DWORD TST_Open( DWORD hDeviceContext, DWORD AccessCode, DWORD ShareMode )

{

OutputDebugString(L"TestDriver - TST_Open\n");

OutputDebugString(L"hDeviceContext - ");

OutputDebugString(L"TestDriver - ~ TST_Open\n");

return 0x5678;

}

BOOL TST_Close( DWORD hOpenContext )

{

OutputDebugString(L"TestDriver - TST_Close\n");

OutputDebugString(L"hOpenContext - ");

OutputDebugString(L"\n");

OutputDebugString(L"TestDriver - ~ TST_Close\n");

return TRUE;

}

BOOL TST_IOControl( DWORD hOpenContext, DWORD dwCode, PBYTE pBufIn, DWORD dwLenIn, PBYTE pBufOut, DWORD dwLenOut, PDWORD pdwActualOut )

{

OutputDebugString(L"TestDriver - TST_IOControl\n");

OutputDebugString(L"hOpenContext - ");

OutputDebugString(L"\n");

switch (dwCode) {

case IOCTL_DRIVER_TST:

{

OutputDebugString(L"DRIVER TST IOCTL...\n");

}

break;

default:

OutputDebugString(L"Unknown IOCTL\n");

break;

}

OutputDebugString(L"TestDriver - ~ TST_IOControl\n");

return TRUE;

}

void TST_PowerUp( DWORD hDeviceContext )

{

OutputDebugString(L"TestDriver - TST_PowerUp\n");

OutputDebugString(L"hDeviceContext - ");

OutputDebugString(L"\n");
OutputDebugString(L"TestDriver - ~ TST_PowerUp\n");

}
void TST_PowerDown( DWORD hDeviceContext )

{

OutputDebugString(L"TestDriver - TST_PowerDown\n");

OutputDebugString(L"hDeviceContext - ");

OutputDebugString(L"\n");
OutputDebugString(L"TestDriver - ~ TST_PowerDown\n");

}
DWORD TST_Read( DWORD hOpenContext, LPVOID pBuffer, DWORD Count )

{

OutputDebugString(L"TestDriver - TST_Read\n");

OutputDebugString(L"hOpenContext - ");

OutputDebugString(L"\n");

OutputDebugString(L"TestDriver - ~ TST_Read\n");
return 1;

}


DWORD TST_Write( DWORD hOpenContext, LPCVOID pBuffer, DWORD Count )

{

OutputDebugString(L"TestDriver - TST_Write\n");

OutputDebugString(L"hOpenContext - ");

OutputDebugString(L"\n");

OutputDebugString(L"TestDriver - ~ TST_Write\n");
return 1;

}


DWORD TST_Seek( DWORD hOpenContext, long Amount, WORD Type )

{

OutputDebugString(L"TestDriver - TST_Seek\n");

OutputDebugString(L"hOpenContext - ");
OutputDebugString(L"TestDriver - ~ TST_Seek\n");
return 0;

}

//end of TestDriver.c by umesh Jagga









now lets write a testdriver.def file. This is the definition file that is passed
to the linker. This file contains the exported function names.


Note: the DLL filename and def filename should be same.

LIBRARY TestDriver
EXPORTS

TST_Init

TST_Deinit

TST_Open

TST_Close

TST_IOControl

TST_PowerUp

TST_PowerDown

TST_Read

TST_Write

TST_Seek

now lets write a sources file:

TARGETNAME=TestDriver





TARGETTYPE=DYNLINK

TARGETLIBS=$(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib

SOURCES=TestDriver.c


now we need to put the registry and bib file entries.

you will need to create the registry entries for this driver so that the
driver can be loaded by Device.exe.

lets put this in platform.bib and platform.reg files.

addin platform.reg file:

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TestDriver]

"Dll" = "TestDriver.Dll"

"Prefix" = "TST"

"Order" = dword:0

"FriendlyName" = "Umesh TestDriver"

"Ioctl" = dword:0


add the below in platform.bib file
TestDriver.dll $(_FLATRELEASEDIR)\TestDriver.dll NK SH

Just for reference:


Device Driver Loading Process:


Kernel---loads---> Device.exe (I/O Resource Manager)-------Loads------>
-------->REGENUM.DLL(registryenumerator,its reentrant)

-----------------loads-----------


REGENUM.DLL(ISA) PCIBUS.DLL

Now we know the concept of device driver lets proceed to step2...

making a custom device driver for your device for customized functionality........

Memory allocation check???

Q. How can I determine how much memory my application can allocate without severely impacting other applications?

A. you could use GlobalMemoryStatus for this.

usage:
MEMORYSTATUS gMemStatus;
GlobalMemoryStatus(&gMemStatus);

if (gMemStatus.dwMemoryLoad < somevalue)
{
//do.... LocalAlloc
} else
{
//do not allocate anything u want.,........like free memory close other apps and try again...
}

Monday, 7 January 2008

ShellExecuteEx

Its better to use shellexecuteEx to launch apps.
The device can have lot of flexibility from where we launch the apps from.

the example given below shows how we could read from the registry and run the apps programmatically on windows mobile devices.

SHELLEXECUTEINFO sei;
HKEY hKey;
TCHAR szKeyName[250], szApplName[250], szApplDir[250], szApplParam[250];

RegOpenKeyEx(HKEY_LOCAL_MACHINE, , 0, 0, &hKey);

dwcbData=sizeof(szApplName)*sizeof(TCHAR);
rc = RegQueryValueEx (hKey, szKeyName, 0, &dwType, (LPBYTE)szApplName, &dwcbData);

if (rc != ERROR_SUCCESS)
{
//do something
}

dwcbData=sizeof(szApplParam)*sizeof(TCHAR);
rc = RegQueryValueEx (hKey, szKeyName, 0, &dwType, (LPBYTE)szApplParam, &dwcbData);


dwcbData=sizeof(szApplDir)*sizeof(TCHAR);
rc = RegQueryValueEx (hKey, szKeyName, 0, &dwType, (LPBYTE)szApplDir, &dwcbData);

RegCloseKey (hKey);
if()
{
wcscpy(szApplName, _T(""));
wcscpy(szApplParam, _T(""));
wcscpy(szApplDir, _T(""));
}

memset(&sei, 0, sizeof(sei));
sei.cbSize = sizeof(sei);
sei.hwnd = NULL;
sei.lpFile = szApplName;
sei.lpParameters = szApplParam;
sei.lpDirectory = szApplDir;
sei.nShow = SW_SHOWNORMAL;

ShellExecuteEx(&sei) ; //parse application szDirNameText to szDirName

Friday, 7 December 2007

WINDOWS CE - FAQ


Q: WinCE3.0 support IDE H.D Driver or not?

A: Yes, check atadisk.dll

Q: Does CE support java ,Macro media flash and PDF view ?
A:
Java: only java script,it does not include java virtual machine (3rd party support)
Pocket word: Yes.
PDF view: Yes.
Macro mediaFlash: 3rd party support


Q: How to verify OS image with or without PID?
A:
use : viewbin -t nk.bin

if it shows :
ROMHDR Extensions ------
PID[0] = 0x00000000
PID[1] = 0x00000000
PID[2] = 0x00000000
PID[3] = 0x00000000
PID[4] = 0x00000000
PID[5] = 0x00000000
PID[6] = 0x00000000
PID[7] = 0x00000000
PID[8] = 0x00000000
PID[9] = 0x00000000
Means this nk.bin without PID.

Q: WinCE 一how to auto start or execute an application on Power on ?
A:
add:
\FILES\ PLATFORM.BIB
FILES
sampleprogram.exe $(_FLATRELEASEDIR)\sampleprogram.exe NK S

Add in platform.dat
Directory("\Windows\StartUp"):-File("sampleprogram.exe","\Windows\sampleprogram.exe")
In Platform.reg add:
[HKEY_LOCAL_MACHINE\init]
"Launchxx"="sampleprogram.exe"
"Dependxx"=hex:1e,00
xx- will depend on BSP implementations.



Q: How to hide desktop icon
A:
Mask this registry.
;[HKEY_LOCAL_MACHINE\Explorer\Desktop]
;"{……..}"="My Computer"
;"{……..}"="Recycle Bin"


Q: How to hide start bar
A:
Set this registry.
[HKEY_LOCAL_MACHINE\Software\Microsoft\Shell\AutoHide]
@=" "
Name: (Default)
Type: REG_SZ (String Value)
Value: (0 = disabled, 1 = enabled)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell\OnTop]
@=""
Name: (Default)
Type: REG_SZ (String Value)
Value: (0 = disabled, 1 = enabled)

Q: How to check that you have installed QFE.
A:
Check it with ceqfecheck.exe

Q:how do you set static IP.
A:
[HKEY_LOCAL_MACHINE\Comm\NE20001\Parms\Tcpip]
"EnableDHCP"=dword:0
"DefaultGateway"=""
"UseZeroBroadcast"=dword:0
"IpAddress"="195.168.33.222"
"Subnetmask"="255.255.0.0"


Q: how do you set IE start page.
A:
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Start Page"="http://ujagga.blogspot.com/"

Q: How to use unalignment memory.
A:
#pragma pack(1)
typedef struct
{
CHAR syncbytes[7];
ULONG imgaddr;
ULONG imglen;
} IMGHDR, *PIMGHDR;
//unaligned
typedef UNALIGNED IMGHDR unlIMGHDR;
typedef UNALIGNED PIMGHDR unlPIMGHDR;


Q: How to bypass all warning.
A: Use compiler option - /W, /w(Set Warning Level.)
Warning Level Description
/w Turns off all warning messages. Use this option when you compile
programs that deliberately include questionable statements. The /w
option applies to the remainder of the command line, or applies until
the next occurrence of a /w option on the command line. /W and /W0
are the same as /w.
/W1 Default. Displays severe warning messages.
/W2 Displays an intermediate level of warning messages. Level 2 includes
warnings such as the following:
• Use of functions with no declared return type
• Failure to put return statements in functions with non-void
return types
• Data conversions that would cause loss of data or precision
/W3 Displays a less severe level of warning messages, including warnings
about function calls that precede their function prototypes in the source
code.
/W4 Displays the least severe level of warning messages, including
warnings about the use of non-ANSI features and extended keywords.
/WX Treats all warnings as errors. If there are any warning messages, the
compiler generates an error message, and continues compilation.


Q: Don’t show suspend button in start menu.
A:
Set the registry key in platform.reg.
; @CESYSGEN IF CE_MODULES_GWES
; This registry setting eables the Explorer's suspend menu button
; Emulator does not currently support suspend
[HKEY_LOCAL_MACHINE\Explorer]
"Suspend"=dword:0
; @CESYSGEN ENDIF CE_MODULES_GWES

Q: How to change bin to nb0.
A:
Cvrtbin.exe is command-line tool. Converts read-only memory (ROM) files from
binary (.bin) format to SRE or NBX (.nb0) format.


Q: How to simulate KeyDown and KeyUP.
A:
#include //keybd_event need to include file
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
unsigned char c;
for(c='A';c<='Z';c++)
{
keybd_event (c, 0, 0, 0); //Key down
//keybd event (virtual-key code, scan code, key type, extern)
keybd_event(c, 0,KEYEVENTF_KEYUP,0); //Key up
//keybd event (virtual-key code, scan code, key type, extern)
}
return 0;
}

Q: How to modify wallpaper.
A:
Replace the WindowsCE.bmp file.
[HKEY_CURRENT_USER\ControlPanel\Desktop]
"wallpaper"=\\Windows\\WindowsCE.bmp


Q: Auto enable keyboard "NumLock" key when OS boot up.
A:
Write an AP to execute when OS boot up.
keybd_event(VK_NUMLOCK, 0, 0, 0);
keybd_event(VK_NUMLOCK, 0, KEYEVENTF_KEYUP, 0);



Q: How to auto run the program when card plug in.
A:
1. Use the API to build up a execute file.
#include
#include
#include
void wmain(void)
{
CeRunAppAtEvent(_T("\\windows\\touch.exe"),
NOTIFICATION_EVENT_DEVICE_CHANGE);
}
Parameter one is launch APP and two is Card detect even.
2. Launch the execute file to notify the information to OS when launch the
notified APP after OS boot up.
3. OS will auto run the APP after card plug in.
ps. The way can’t launch APP in Card because the program will launch APP
when card plug in before mount.

WM5 Registry Tweaks -For performance.

  • Disable menu animations
    To disable menu animations (sliding in/out) and speed up performance of the UI a bit:
    HKLM\SYSTEM\GWE\Menu\AniType = 0 (DWORD decimal)
    To change it back to the default:
    HKLM\SYSTEM\GWE\Menu\AniType = 6 (DWORD decimal)
  • Disable window animations
    To disable window animations (minimizing/maximizing) and speed up performance of the UI a bit:
    HKLM\SYSTEM\GWE\Animate = 0 (DWORD decimal)
    And to switch them back on:
    HKLM\SYSTEM\GWE\Animate = 1 (DWORD decimal)
  • Increase font cache
    To increase the font cache, speeding up font rendering at the cost of a bit of memory:
    HKLM\SYSTEM\GDI\GLYPHCACHE\limit = 16384 (DWORD decimal)
    To change it back to the default:
    HKLM\SYSTEM\GDI\GLYPHCACHE\limit = 8192 (DWORD decimal)
  • Enable FileSystem cache
    To enable the FileSystem cache, speeding up overall performance at the risk of the cache not being written on a sudden reset:
    HKLM\System\StorageManager\FATFS\EnableCache = 1 (DWORD decimal)
    To disable again:
    HKLM\System\StorageManager\FATFS\EnableCache = 0 (DWORD decimal)
  • Increase FileSystem cache
    To increase the file system cache:
    HKLM\System\StorageManager\FATFS\CacheSize = 4096 (DWORD decimal)
    To return the file system cache to zero:
    HKLM\System\StorageManager\FATFS\CacheSize = 0 (DWORD decimal)
  • Increase FileSystem filter cache
    To enable the file system filter cache, speeding up overall performance with file mangement:
    HKLM\System\StorageManager\Filters\fsreplxfilt\ReplStoreCacheSize = 4096 (DWORD decimal)
    To return the file system filter cache to zero:
    HKLM\System\StorageManager\Filters\fsreplxfilt\ReplStoreCacheSize = 0 (DWORD decimal)
  • UI Modifications
  1. Change the thickness of scrollbars
    To change the thickness of the scrollbars at the right/bottom of documents larger than the screen, adjust...For the horizontal (bottom) scrollbar:
    HKLM\System\GWE\cyHScr = 9 (DWORD decimal)
    For the vertical (right) scrollbar:
    HKLM\System\GWE\cxVScr = 9 (DWORD decimal)
  2. Change the length of scrollbar arrow buttons
    To go with changing the thickness of the scrollbars, you may wish to change the length of the scrollbar arrow buttons...For the horizontal (bottom) scrollbar arrows:
    HKLM\System\GWE\cyVScr = 9 (DWORD decimal)
    For the vertical (right) scrollbar:
    HKLM\System\GWE\cxHScr = 9 (DWORD decimal)
  3. Enable ClearType in Landscape mode
    To enable ClearType in Landscape mode:
    HKLM\System\GDI\ClearTypeSettings\OffOnRotation = 0 (DWORD decimal)
    To disable:
    HKLM\System\GDI\ClearTypeSettings\OffOnRotation = 1 (DWORD decimal)
  4. Change the display of the clock in the taskbar
    The clock in the taskbar can be changed to show not only the time, but also the date, or just the date, or nothing at all.To show nothing:
    HKLM\Software\Microsoft\Shell\TBOpt = 0 (DWORD decimal)
    To show just the clock:
    HKLM\Software\Microsoft\Shell\TBOpt = 1 (DWORD decimal)
    To show just the date:
    HKLM\Software\Microsoft\Shell\TBOpt = 2 (DWORD decimal)
    To show both the date and the clock:
    HKLM\Software\Microsoft\Shell\TBOpt = 3 (DWORD decimal)
  5. Show Edge network indicator instead of GPRS
    If your network provider supports the Edge network (and your device does as well), you can use the following to show a little 'E' icon instead of 'G' icon when connected to an Edge network:
    HKLM\Drivers\BuiltIn\RIL\EnableDifferGprsEdgeIcon = 1 (DWORD decimal)
    To disable again:
    HKLM\Drivers\BuiltIn\RIL\EnableDifferGprsEdgeIcon = 0 (DWORD decimal)
  6. Add GPS settings icon
    If you have a GPS device, you can add a GPS settings icon to your Start > Settings menu using:
    HKLM\ControlPanel\GPS Settings\Group = 2 (DWORD decimal)HKLM\ControlPanel\GPS Settings\redirect <-- delete, or rename, this value
  7. Hide/Show Screen orientation icon
    If you wish to hide the Screen orientation icon, shown in the task bar on some devices, you can set:
    HKLM\Services\ScreenRotate\ShowIcon = 0 (DWORD decimal)HKLM\System\GDI\Rotation\HideOrientationUI = 1 (DWORD decimal)
    And to show it again:
    HKLM\Services\ScreenRotate\ShowIcon = 1 (DWORD decimal)HKLM\System\GDI\Rotation\HideOrientationUI = 0 (DWORD decimal)
    If this doesn't work, you can try:
    HKLM\Services\screenrotate = 0 (DWORD decimal)
    And to show it again:
    HKLM\Services\screenrotate = 1 (DWORD decimal)
  8. Hide/Show battery indicator in Task bar
    If you wish to hide the battery indicator in the task bar on some devices, you can set:
    HKLM\Services\Power\ShowIcon = 0 (DWORD decimal)
    And to show:
    HKLM\Services\Power\ShowIcon = 1 (DWORD decimal)
  9. Put custom text on bottom-right of Today screenf ollowing key:
    HKLM\Software\Microsoft\Shell\DeviceBeta\Today = "This is windows mobile world of Umesh Jagga" (REG_SZ string, no quotes)
  • File Locations
    Change the location of My Documents HKLM\Software\Microsoft\Windows CE Services\FileSyncPath = "\Storage Card\My Documents" (REG_SZ string, no quotes)
    To return to the original location:
    HKLM\Software\Microsoft\Windows CE Services\FileSyncPath = "\My Documents" (REG_SZ string, no quotes)
  • Change the location of email and attachments
    When reading and sending email in Pocket Outlook, emails and their attachments are saved in the device's internal storage by default. You can change this location to, for example, your Storage Card:
    HKCU\Software\Microsoft\MAPI\PropertyPath = "\Storage Card\Mail" (REG_SZ string, no quotes) HKCU\Software\Microsoft\MAPI\AttachPath = "\Storage Card\Mail\Attachments" (REG_SZ string, no quotes)
    To return to the original location:
    Just simply delete these Registry settings (since neither is included by default).
    Change the location of Temporary Internet Files
    When browsing the web, pages and images are saved in the 'Temporary Internet Files' location. You can change this location to, for example, your Storage Card:
    HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Cache = "\Storage Card\cacheie" (REG_SZ string, no quotes)
    To return to the original location:
    HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Cache = "\Windows\Profiles\guest\Temporary Internet Files" (REG_SZ string, no quotes)
    Change the location of Ringtone file storage
    WM5 will look for Ringtones in \Windows\ or \Windows\Rings by default. You can change this location to, for example, your Storage Card (example given is for ringtones placed on the Storage Card root folder)
    HKCU\ControlPanel\SoundCategories\Ring\Directory = "\Storage Card\" (REG_SZ string, no quotes)
    To return to the original location:
    HKCU\ControlPanel\SoundCategories\Ring\Directory = "\Windows\Rings\" (REG_SZ string, no quotes)
    Note the default location may be "\Windows\" or "\Windows\Rings\" depending on your Device provider.
    Make WM5 ask where to install a program (1)
    If you wish to be able to specify whether to install a program on WM5's Main storage, or your Storage Card, regardless of installer setting set:
    HKLM\Software\apps\Microsoft Application Installer\fAskDest = 1 (DWORD decimal)
    To disable again:
    HKLM\Software\apps\Microsoft Application Installer\fAskDest = 0 (DWORD decimal)
    Make WM5 ask where to install a program (2)
    An alternative method of making WM5 ask where to install a program is by adding the "/askdest" option to the Windows CE loader:
    HKCR\cabfile\Shell\open\command = 'wceload.exe "%1" /askdest' (REG_SZ string, no quotes)
    Make WM5 keep CAB files around after installing (1)
    If you wish to keep the original .CAB file around after installing the application, set:
    HKLM\Software\apps\Microsoft Application Installer\nDynamicDelete = 0 (DWORD decimal)
    Or to restore to the default:
    HKLM\Software\apps\Microsoft Application Installer\nDynamicDelete = 2 (DWORD decimal)
    Make WM5 keep CAB files around after installing (2)
    An alternative method of making WM5 keep the original .CAB file around after installing the application is by adding the "/nodelete" option to the Windows CE loader:
    HKCR\cabfile\Shell\open\command = 'wceload.exe "%1" /nodelete' (REG_SZ string, no quotes)
    Make WM5 prompt before overwriting an existing installation
    If you wish to make WM5 prompt you before overwriting an existing installation, set:
    HKLM\Software\apps\Microsoft Application Installer\fAskOptions = 1 (DWORD decimal)
    To disable again:
    HKLM\Software\apps\Microsoft Application Installer\fAskOptions = 0 (DWORD decimal)
  • Input (keyboard, soft keys, SIP)
    Change slide-out keyboard layout
    If you have a Device from one country, but would like to use the keyboard layout of another, you can change the keyboard's language setting to do so...
    For US layout (QWERTY):HKCU\ControlPanel\Keybd\Locale = 0409 (String)For German layout (QWERTZ):HKCU\ControlPanel\Keybd\Locale = 0407 (String)For French layout (AZERTY):HKCU\ControlPanel\Keybd\Locale = 040c (String)For Spanish layout (QWERTY):HKCU\ControlPanel\Keybd\Locale = 040a (String)