[RESOLVED] Catch WINAPI messages from external device
Hello. I write this post before in > C-Sharp Programming < but now i think here is better place for it. I coding in C#, but this is typicall WINAPI problem ( propably ;) ). If moderator read it maybe can delete old version of this ( http://www.codeguru.com/forum/showthread.php?t=504201 ).
------------------------
I have small external device, it is LogiLink Video Grabber in this case ( connected via USB ). It have big single button (physical) and I trying to detect when somebody pressed it.
I attemp to use catch Window Messages from standard GetMessage() loop and not catch any kind of messages when I press this device button.
I attempt to use Raw Input ( http://msdn.microsoft.com/en-us/libr...36(VS.85).aspx ) but I cant enumerate my device ( I try use GetRawInputDeviceList() - i know PID and VID of my device ).
I'm guessing that I need to register for messages from this devices? Or something? Somebody have any idea how I can do this?
I cann't find any public API for this device - but I have producent application (witout sources) that responds to the button so I know that there is a some way to detect pressing.
Re: Catch WINAPI messages from external device
Quote:
Originally Posted by
Psychowico
I attemp to use catch Window Messages from standard GetMessage() loop and not catch any kind of messages when I press this device button.
That is because these devices use a specific API to perform their tasks. For video devices, it's usually Video For Windows, for scanning devices it's usually WIA or TWAIN, etc. It isn't about just checking for windows messages in a GetMessage() loop -- you won't get anywhere pursuing your goal this way.
http://www.videoocx.de/
That is an example of a control that already uses Video For Windows in a wrapper.
Regards,
Paul McKenzie
Re: Catch WINAPI messages from external device
Like I say - I have problem with detect pressing of physical button from this device. I capture video without problems.
Re: Catch WINAPI messages from external device
Quote:
Originally Posted by
Psychowico
Like I say - I have problem with detect pressing of physical button from this device. I capture video without problems.
I come from a background of handling scanning devices, where scanners have different buttons, controls, and some have no buttons (software-only scanners). So "pressing buttons" is device specific.
If video devices operate similar to scanning devices, then getting physical button presses is highly unlikely, unless the manufacturer provides you an API or "hook" that detects which button is pressed.
And even if you wanted to know the messages sent, just hook up Spy++ and see the message traffic. There is no need to write your own message loops. But I doubt you will find anything in the message loop or with Spy++ except the normal dialog messages (mouse move, WM_CHAR, etc.)
Regards,
Paul McKenzie
Re: Catch WINAPI messages from external device
I think u're rate. Thx for reply.