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
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
You can set the relevant registry entries and then do a SendMessage to refresh the today screen.
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/