Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

Once the Windows Classic Home screen plug-in has the selection focus, each keypad button press causes it to receive a WM_TODAYCUSTOM_USERNAVIGATION message. If the plug-in handles the button press internally, it should return TRUE in response to this message. Otherwise, the Windows Classic Home screen passes the selection on to the next item if either the up or down key was pressed. This can be used to navigate through a series of sub-items.

WM_TODAYCUSTOM_USERNAVIGATION is defined as (WM_USER + 246). The parameter wParamis set to the virtual key code of the keypress (e.g., VK_UP, VK_LEFT, etc); lParam is not used.

The action button is handled differently. If the action button is pressed, the plug-in receives a WM_TODAYCUSTOM_ACTION message, unless the value of Selectabilityis equal to one, in which case it receives a WM_LBUTTONDOWN and a WM_LBUTTONUP message at coordinates (1, 1), simulating a user tap.

WM_TODAYCUSTOM_ACTION is defined as (WM_USER + 247). The parameter wParamis equal to the virtual key code for the action key (i.e., VK_RETURN); lParamis not used. The return value for this message is ignored. The following code example shows this.

Copy Code
case WM_TODAYCUSTOM_USERNAVIGATION:
   InvalidateRect(hwnd, NULL, FALSE);

   if (wParam == VK_UP)   g_nSelectedItem--;
   if (wParam == VK_DOWN) g_nSelectedItem++;

   if (g_nSelectedItem < 0 || g_nSelectedItem >= MAX_ITEMS)
   {
	return FALSE; // go to the next plug-in
   }
   else
   {
	return TRUE;  // stay in this plug-in
   }

case WM_TODAYCUSTOM_ACTION:
   OnAction();
   break;

See Also