ImmGetVirtualKey function

Retrieves the original virtual key value associated with a key input message that the IME has already processed.


UINT ImmGetVirtualKey(



Handle to the window that receives the key message.

Return value

If TranslateMessage has been called by the application, ImmGetVirtualKey returns VK_PROCESSKEY; otherwise, it returns the virtual key.


Although the IME sets the virtual key value to VK_PROCESSKEY after processing a key input message, an application can recover the original virtual key value with the ImmGetVirtualKey function. This function is used only for key input messages containing the VK_PROCESSKEY value. Applications can only get the original virtual key by using this function after receiving

the WM_KEYDOWN (VK_PROCESSKEY) message, and before TranslateMessage is called in its own

message loop.


Minimum supported client Windows XP [desktop apps only],East Asian language support installed.
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header imm.h (include Immdev.h, Windows.h)
Library Imm32.lib
DLL Imm32.dll

See also

Input Method Manager

Input Method Manager Functions