I have a system where I have multiple keyboards and really need to know which keyboard the key stroke is coming from. To explain the set up:
No way to do this. Windows abstracts this for you. As mentioned, you need to write/modify a device driver.
Yes I stand corrected, my bad, learning something new every day.
Here's my attempt at making up for it :) :
Register the devices you want to use for raw input (the two keyboards) with ::RegisterRawInputDevices().
You can get these devices from GetRawInputDeviceList()
After you've registered your devices, you will start getting WM_INPUT messages.
The lParam of the WM_INPUT message contains a RAWKEYBOARD structure that you can use to determine the keyboard where the input came from, plus the virtual keycode and the type of message (WM_KEYDOWN, WM_KEYUP, ...)
So you can set a flag of where the last message came from and then dispatch it to the regular keyboard input handlers.