Monday 15 November 2010

Adding custom notifications to the WM6.5 lock screen

If you are wondering how your application can add information on the new WM6.5 lock screen, this can be done easily by utilising a few registry entries! There are two OEM lockscreen entries reserved for OEM applications that will allow applications to register an icon to show on the lock screen with an optional number of unread or unhandled events, when the user slides this to the right or left the application is invoked to deal with the unread events.

The regsitry entry all of this appears under is:

HKLM\Software\\Microsoft\\Shell\\LockScreen\\Notifications\\Notif0
HKLM\Software\\Microsoft\\Shell\\LockScreen\\Notifications\\Notif1

Add the settings like this:

"Command Line"="\program files\myapp\myapp.exe"
"Image"="\icon_notclicked.png"
"FocusImage"="\icon_clicked.png"
"Notification Count"=dword:0

The command line should point to your application, this will be executed when the user slides your cusom slider to the right. The Image and Focus image are two icons which are shown on the lock screen with and without you pressing them. The notification count should be more than 0 to show your icon and 0 to hide your item. The number in the noticication count is displayed on the lock screen so this could be the number of unread messages or emails you've received, whatever you are counting in your application.

You should check that Notif0 and 1 aren't already used by another application and use the appropriate one.

Happy screen locking!