detect camera hookup to USB

Does anyone know how to detect when a camera is hooked up to a USB and
retrieve the pictures to a Picturebox or richtextbox?
isnoend2001Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dinomixCommented:
Most new cameras today show the memory card as a drive, you can easily have the software check that drive and load the pictures to a picturebox by setting the image property of the picture box. Accessing the camera is just a matter of creating a path with that drive letter.

Getting the program to detect a connect is slightly more involved. It requires using the WMI interface to listen for usb events to determine when a device is connected, there are several ways to do this, see the question link below. If this is too complicated you could have the program check for the drive and prompt user to connect camera if drive is not present, then when they connect camera try to access drive again and keep prompting until camera is connected or user cancels. This is easy to do with a simple retry message box.

http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_22155351.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
isnoend2001Author Commented:
Thanks for your reply
I am gonna skip the listening for a camera hookup and have a button or nenu item to get pictures from camera. How would i determine the drive the camera is hooked up to?
0
dinomixCommented:
It would usually be a removable disk so you can check the drive name using the filesystemobject and try to locate it that way, also the file structure on most camera drives is very specific so you can usually determine that the drive is a camera by looking for specific files or folders that the camera creates. I know nikon cameras name their folders DSC_**** or something simlar so you could look for that. You may also scan the drives and then ask the user to connect camera and then rescan and the drive that was not present on first scan is going to be the camera drive.
0
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.