User32VkKeyScanEx Method
Translates a character to the corresponding virtual-key code and shift state.
The function translates the character using the input language and
physical keyboard layout identified by the input locale identifier.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static short VkKeyScanEx(
char character,
IntPtr hkl = default
)
<DllImportAttribute("User32.dll", CharSet := CharSet.Unicode, SetLastError := true>]
Public Shared Function VkKeyScanEx (
character As Char,
Optional hkl As IntPtr = Nothing
) As Short
Dim character As Char
Dim hkl As IntPtr
Dim returnValue As Short
returnValue = User32.VkKeyScanEx(character,
hkl)
public:
[DllImportAttribute(L"User32.dll", CharSet = CharSet::Unicode, SetLastError = true)]
static short VkKeyScanEx(
wchar_t character,
IntPtr hkl = IntPtr()
)
[<DllImportAttribute("User32.dll", CharSet = CharSet.Unicode, SetLastError = true)>]
static member VkKeyScanEx :
character : char *
?hkl : IntPtr
(* Defaults:
let _hkl = defaultArg hkl new IntPtr()
*)
-> int16
No code example is currently available or this language may not be supported.
- character Char
-
The character to be translated into a virtual-key code.
- hkl IntPtr (Optional)
-
Input locale identifier used to translate the character.
This parameter can be any input locale identifier previously returned by the LoadKeyboardLayout function.
Int16
If the function succeeds,
the low-order byte of the return value contains the virtual-key code,
and the high-order byte contains the shift state.
If the function finds no key that translates to the passed character code,
both the low-order and high-order bytes contain
255.