Поделиться через


CHotKeyCtrl::GetKeyName

Call this member function to get the localized name of the key assigned to a specified virtual key code.

static CString GetKeyName(
   UINT vk,
   BOOL fExtended 
);

Параметры

  • vk
    The virtual key code.

  • fExtended
    If the virtual key code is an extended key, TRUE; otherwise FALSE.

Возвращаемое значение

The localized name of the key specified by the vk parameter. If the key has no mapped name, GetKeyName returns an empty string.

Заметки

The key name that this function returns comes from the keyboard driver, so you can install a non-localized keyboard driver in a localized version of Windows, and vice versa.

Пример

CString str;

str = CHotKeyCtrl::GetKeyName(VK_CONTROL, FALSE);

// str is now "Ctrl", or the localized equivalent.

Требования

Header: afxcmn.h

См. также

Основные понятия

CHotKeyCtrl Class

CHotKeyCtrl Members

Hierarchy Chart

WM_KEYDOWN

GetKeyNameText

CHotKeyCtrl::GetHotKeyName