.NET Components for Mobility

Peter Foot

Microsoft Device Application Development MVP

Home and Visiting Clocks in Professional Edition

In Professional Edition (Pocket PC) devices the Clock control panel allows you to set a home timezone and a visiting zone and lets you toggle between them. If you need to retrieve the current settings they are stored in the registry in a key called HKEY_LOCAL_MACHINE\Software\Microsoft\Clock in a binary value called "AppInfo". Here is breakdown of that data:-

00,00,00,00,31,00,00,00,55,00,00,00,00,00,00,00,01,00,00,00,80,01,00,00,be,00,00,00,00,00,00,00,00,00,00,00

The first 4 bytes contains an integer which is 1 if in the home zone, and 0 if visiting.

The next 4 bytes always seems to be 0x31

The next 4 bytes are the index into the timezone collection of the home zone (In this example 85 GMT)

The next 4 bytes are unused

The next 4 bytes indicate whether to use DST (In this example 1 true)

The next 4 bytes are always 0x180

The next 4 bytes are the index into the timezone collection of the visiting zone (in this example 190 - New Delhi)

The next 4 bytes are unused

The next 4 bytes indicate whether to use DST in visiting zone (In this example 0 false)

I suspect that the unused values may be connected to the old Cities feature which was originally in the control panel but removed with PPC2003. You may be wondering how to get the timezone information at the specified indexes - in Windows Mobile they are not all stored in the registry as on other Windows CE flavours. They are accessible through POOM - IPOutlookApp.GetTimeZoneFromIndex, or in managed code in Mobile In The Hand.

Published Aug 13 2008, 12:47 PM by PeterFoot
Filed under:

Comments

No Comments

About PeterFoot

Peter Foot is co-author of the Microsoft Mobile Development Handbook published by Microsoft Press. Peter has been awarded the Microsoft Most Valuable Professional (MVP) accolade since 2003 for his involvement in the Microsoft .NET Compact Framework developer community. Alongside an active presence in several online forums and communities, attendance at developer conferences and involvement in shared-source projects, Peter has also written a number of technical articles and maintains an active technical blog.
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.