Working on some legacy code with Windows CE using Visual Studio 2003 running in an XP Mode Virtual Machine on Windows 7.

I am writing some code that runs on handheld devices, and need to know which make and model they are. Is there a built-in call I can make to query the handheld device as to its identity?

Similarly, I will programmatically deduce the make and model of the belt printer that the handheld device is attached to, so that code can branch based on these details.

有帮助吗?

解决方案

You might try getting the Device Name and ID with calls to KernelIoControl calls passing in IOCTL_HAL_GET_DEVICEID. There's an example on MSDN. That might be able to determine the handheld model.

As for the printers, it's unlikely you can tell the difference - though it depends on how exactly they're connected. If it's serial there's no way. If it's USB, it's unlikely unless they use different drivers. If it's networked, then it's not going to happen. If it's Bluetooth, maybe the device name has a pattern based on model you can use.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top