Receiving the Selection Focus

4/8/2010

When the user navigates to a Windows Classic Home screen plug-in using the keypad, the plug-in receives a WM_TODAYCUSTOM_RECEIVEDSELECTION message. Also, regardless of the value of Selectability, it receives a WM_ERASEBKGND and a WM_PAINT message so that it can redraw its content.

Sending the TODAYM_DRAWWATERMARK message to the parent window always draws an unselected background – unless the Home screen plug-in is selected and its Selectability value is one, in which case a highlighted background is drawn. When the value of Selectability is one, no code changes are required to draw the correct background; but if the value is two, the plug-in must draw the background itself. It should use the TODAYCOLOR_HIGHLIGHT color (0x10000022) for its background and the TODAYCOLOR_HIGHLIGHTEDTEXT color (0x10000023) for its foreground – both of which can be found via the TODAYM_GETCOLOR message.

WM_TODAYCUSTOM_RECEIVEDSELECTION is defined as (WM_USER + 244). The parameter wParam is set to the virtual key code used to navigate to this item (i.e., either VK_DOWN or VK_UP); lParam is not used. If the plug-in accepts the selection change, then it should return TRUE; otherwise, the Windows Classic Home screen passes the selection along to the next item. The following code example shows the Windows Classic Home screen passing the section along to the next item.

case WM_TODAYCUSTOM_RECEIVEDSELECTION:
   g_bSelected = TRUE;
   return TRUE;

See Also

Other Resources

Windows Classic Home Screen Plug-in Selection