开发者

How to identify when a USB device is inserted to a WinCE device

I have a touch enabled device with WinCE, I need to show a UI whenever a USB device is inserted to the device开发者_运维技巧. If there any event or method to identify the USB insertion in WinCE.


If you want to monitor just USB sticks you can use RequestDeviceNotifications for block devices.

What kind of devices can be plugged to the USB?

You can also change the USB driver code to signal an event whenever it gets an interrupt and you can wait for that event.


This website here has the exact code you need, I tested it and it works on Windows CE 6


AFAIK, you have to register a SystemState handler for a SystemProperty.


If you're using managed code and the SDF, then it's already plumbed in for you with the DeviceStatusMonitor class. This blog entry shows how to detect USB Disks, but other devices can be watched by simply changing the device class you're looking for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜