2010-02-11 95 views

回答

4

您可以設置相關的註冊表項,然後做一個SendMessage函數刷新今日屏幕。


  • HKEY_CURRENT_USER \ SOFTWARE \微軟\今天\皮膚
  • HKEY_CURRENT_USER \ SOFTWARE \微軟\今天\ UseStartImage
  • 下HKEY_CURRENT_USER \ SOFTWARE \微軟\今天\(ThemeFileName)所有值
  • HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Color \ SHColor
  • HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Color \ BaseHue
  • 所有值都在HKEY_LOCAL_MACHINE \ SOFTWARE \微軟\顏色\(ColorNumber)
  • HKEY_LOCAL_MACHINE \ SYSTEM \ GWE \ SysColor

C#代碼示例:

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); 

看到更多細節在:

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

+0

榮譽,這看起來像正確的答案給我。 – 2010-02-20 19:02:23

+0

我可以在Windows移動設備上找到任何註冊表項。 – 2010-03-03 21:35:29

+0

對不起,我的壞,我發現他們:)檢查,看它現在是否工作。 – 2010-03-03 21:37:02