I have used the following code in my C++
program( in VS2010
) written for device monitoring.
hres = pSvc->ExecNotificationQueryAsync(
_bstr_t("WQL"),
_bstr_t("select * from __InstanceOperationEvent within 1 "
"where (TargetInstance ISA 'Win32_Keyboard') "),
WBEM_FLAG_SEND_STATUS,
NULL,
pStubSink);
This query works fine and returns the expected value if the keyboard connected is an USB keyboard
. The query is not even fired if it is a PS/2 keyboard
. I tried using Win32_PortConnector
and Win32_Parallelport
instead of Win32_Keyboard
in the query. But the result was the same.
Can someone tell me how to get the notification when a PS/2 keyboard
is connected to my system.