1

I'm trying to find a way to change the theme of a Windows Mobile 5 device from within my software. Does anyone have any experience in this area?

Dylan

Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
Dylan Vester
  • 2,686
  • 4
  • 29
  • 40

1 Answers1

4

You can set the relevant registry entries and then do a SendMessage to refresh the today screen.


  • HKEY_CURRENT_USER\Software\Microsoft\Today\Skin
  • HKEY_CURRENT_USER\Software\Microsoft\Today\UseStartImage
  • All values under HKEY_CURRENT_USER\Software\Microsoft\Today\(ThemeFileName)
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Color\SHColor
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Color\BaseHue
  • All values under HKEY_LOCAL_MACHINE\Software\Microsoft\Color\(ColorNumber)
  • HKEY_LOCAL_MACHINE\System\GWE\SysColor

C# code example:

using System.Runtime.InteropServices;
using Microsoft.Win32;
...
[DllImport("coredll.dll")]
private static extern int SendMessage(IntPtr hWnd, uint msg, int wParam, int lParam);
...
public const int HWND_BROADCAST = 0xffff;
public const int WM_WININICHANGE = 0x001A;

// Copy wallpaper file to windows directory
File.Copy(@"\My Documents\My Pictures\ImageFileName.jpg", @"\Windows\stwater_240_240.jpg", true);                

// Update registry
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Today", "Wall", "ImageFileName");

// Send message to refresh today screen
SendMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);

See more details at:

http://windowsmobiledn.com/qa-how-to-install-a-today-theme-file/

http://windowsmobiledn.com/forum/viewtopic.php?t=335

http://social.msdn.microsoft.com/Forums/en-US/vssmartdevicesnative/thread/83a0420b-1c8f-4201-b910-693b3b9a3b12

Kobus Smit
  • 1,775
  • 2
  • 18
  • 30
  • None of the registry keys I can find on the windows mobile device. – Dylan Vester Mar 03 '10 at 21:35
  • I'm sorry, my bad, I found them :) Checking to see if it works now. – Dylan Vester Mar 03 '10 at 21:37
  • Hey man, sorry for the long delay. Your suggestions totally worked. However, changing the color key in the registry requires a soft reset (kind of a shame), but it's something I can live with. Thanks again! Accepted. – Dylan Vester Mar 15 '10 at 01:14
  • Well, actually it looks like I can't accept your response as an answer, there is no checkbox. Never seen that before. Voted up though. – Dylan Vester Mar 15 '10 at 01:15
  • Great stuff, will do this ASAP, ayobaness. – Marthinus Jul 15 '10 at 07:33
  • I tried the code. It worked, when changing a wallpaper. But not all the images, for example in Wm6.5.5, the softbar image buttons. do you have any working code for WM6.5.x? – jaysonragasa Oct 04 '11 at 08:08