How to identify if a smartphone is connected to computer?

342 Views Asked by At

I have a smartphone (any operating system like iOS, Android or Windows 8), and as soon as I connect it to computer (through wire), I want my Windows Form Application to identify that a device is connected and it needs to tell me which device is connected (like "Android Device is Connected").

I searched for this, and identified and good way to do from this link DriveDetector. It talks about overriding WndProc and making use of WM_DEVICECHANGE message to identify if a device is inserted or removed.

I notice the WndProc overridden method is getting fired multiple times with the approach. I want to know if there is any better way to do it?

0

There are 0 best solutions below