Click here to Skip to main content
13,200,729 members (52,634 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi everyone.
I am developing some application that uses device, with FTDI chip on board, connected to PC through USB. Application uses ft2xx.dll. It will be very nice If my application would be able to recognize device removal and insertion. I can do it with some timer, that constantly tries to write or read something from device, and according to success or fault it will tell to my application that the device is connected or disconnected. But it is an ugly solution for sure. I know there are events risen in Windows when I connect and disconnect device.
So my question is: How can I subscribe to those events in my Winforms C# application, and if I have this event, how would I know that this is the device I need? I mean that I need to be able to identify this devise also.
Important thing is: It is bad idea to try to identify device by it's serial number or some other ID, because those things changes from device to device, I need something like type-identifier. (When you plug in your iPhone, PC knows it is iPhone, no matter it is your's or the one your wife have, right?)
And another pain is: both x86 and x64 are meant to work.

I have searched for answer a bit, but unfortunately my low level knowledge of C++ limited my understanding quite a lot. So, may be someone have wrote C# wrapper for those things?

Any help will be appreciated, both links to relevant information and working code :)

Regards, Artem
Posted 10-Jun-12 19:46pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


please read my solution some time ago, a near similar question:
Working with USB Devices[^]

Especially following great CP-Article:

A USB Library to Detect USB Devices[^]

In addition there must be some hardware-id which is stored/recognized/integrated drivers of win (sometimes through windows update), if iphone was plugged in.

Unfortunately I'm not 100% sure, but I think PNP-ID/Device ID should be always the same id, you're right, serial number is unique.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171020.1 | Last Updated 13 Jun 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100