Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 708
  • Last Modified:

Detect FireWire Connection

Hi Experts,

How do i programmatically detect when a camera is connected through the firewire (IEEE1394) cable ??

I'm trying to use SHChangeNotifyRegister, but i am not sure that this is the way to go.

This is to use with MFC, but it could be any language.

Thank you in advance.

  • 2
1 Solution
I have some code which does this. Since this code is not mine, I can give you only general direction and not actual code. I hope this will help you to find additional information.
You need to handle WM_DEVICECHANGE windows message. If wParam is DBT_DEVICEARRIVAL, cast lParam to PDEV_BROADCAST_HDR and test it's dbch_devicetype member. If it is equal to DBT_DEVTYP_DEVICEINTERFACE (don't ask me what is this, I don't know), handle this case.
To get WM_DEVICECHANGE message you need RegisterDeviceNotification function.
PeterLarsenAuthor Commented:
Ahh, I actually have some code from delphi-jedi.
Thanks for putting me on the right track. It seems right, and the points are probably yours.
I'll get back later today.
PeterLarsenAuthor Commented:
I have found that some computers don't receive DBT_DEVICEARRIVAL upon connection - don't know why.
Anyway, thanks for your help.

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now