virusrocks
virusrocks

Reputation: 871

Sending wchar_t through keybd_event

My question is related to the WIN32 API for a keyboard event.

VOID WINAPI keybd_event(
  _In_  BYTE bVk,
  _In_  BYTE bScan,
  _In_  DWORD dwFlags,
  _In_  ULONG_PTR dwExtraInfo
);

this method accepts a BYTE for a Key value. As long as its a char things go fine but for a wchar_t its not working, obviously because of the data type difference. Is there any method exposed for a wchar_t datatypes or any other conversion I can do to send this word on to the screen?

Thanks

Upvotes: 0

Views: 235

Answers (1)

Tony The Lion
Tony The Lion

Reputation: 63190

You don't send this function char per se, you send it a set of Virtual Key Codes, and these are limited in their range. So trying to send it a wchar_t type doesn't really make any sense.

Also you'll see this note in MSDN documentation for this function:

Note This function has been superseded. Use SendInput instead.

I should think you'd be better off using SendInput instead.

Upvotes: 1

Related Questions