Programmatically Refreshing the Today Screen

A simple trick for forcing the today screen to re-read from the registry (or refresh) is by sending the message WM_WININICHANGE with the parameter 0x000000F2 to a window called the DesktopExplorerWindow.

Here’s a small code snippet on how to accomplish this programmatically:

void RefreshTodayScreen() {
  HWND hWnd = FindWindow(_T(“DesktopExplorerWindow”), _T(“Desktop”));
  SendMessage(hWnd, WM_WININICHANGE, 0x000000F2, 0);
}

and in managed code…

[DllImport(“coredll.dll”)]
static extern IntPtr FindWindow(string class_name, string caption);

[DllImport(“coredll.dll”)]
static extern int SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);

const uint WM_WININICHANGE = 0x1a;

void RefreshTodayScreen() {
  IntPtr hWnd = FindWindow(“DesktopExplorerWindow”, “Desktop”);
  SendMessage(hWnd, WM_WININICHANGE, 0x000000F2, 0);
}

2 thoughts on “Programmatically Refreshing the Today Screen

  1. Hi Christian,

    Is there a simillar technique to refreshing the HomeScreen/ Plugin in a Wibdows Mobile 5 Home screen?

Leave a Reply

Your email address will not be published. Required fields are marked *