Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.


Windows Mobile 6.5
A version of this page is also available for

This function assigns a window to receive a particular hardware button's key-press messages.

BOOL SHSetAppKeyWndAssoc(
  BYTE bVk,
  HWND hwnd


[in] Key code for the hardware button.


[in] Handle to the window that will receive the messages.

The bVk values are virtual key codes. Use VK_APP1 through VK_APP6. The number of hardware keys available and physical key locations vary according to the destination device.

If hwnd is set to NULL, the association between the window and the navigation control is removed.

This function returns TRUE if it is successful and FALSE if it fails. For more information about a failure, call GetLastError.

Windows Embedded CEWindows CE 3.0 and later
Windows MobilePocket PC 2000 and later

Other Resources

Community Additions

© 2015 Microsoft