"Marco Tedaldi" <[EMAIL PROTECTED]> wrote: >We've got a Video-Application (not in LabView) which should show a video >on the same screen as the labwiew-application runs. The Problem ist, >that de Application stops playing the Video as soon as it looses the >Focus :-( But the Operator needs to write some Data in the Labview-App >while watching the Video. > >With the "Initialize Keyboard.vi" and the "Acquire Input Data.vi" I can >get the Keyboard-Events even if the my app is in the bakcground, but the >main-application still gets the events too, which could possibly disturb >it :-(
There you have a dilemma. The active window is also the one which has the keyboard focus and the whole concept of Windows is based on this. You might be able to trick a little with this with floating windows if they would be all in the same process but as separate process you can't make a window in one process active and give another window in another process the key focus. To do that you would have to deeply intervene in the Windows kernel itself. >So I'm seeking for a way to capture the events completely whitout >another application recieving them. As Bonus it would be great, to >"forward" the unused Keys to the main-app. >This should work on Windows. Portability is no issue at the Moment, so I > could also use System DLLs or DirectX. Well, one way you could do this is writing a system wide keyboard hook in a DLL but this is going to be very tricky. The reason your video stops playing is probably because the video playback is driven by the windows message queue itself instead of in a seperate thread which can keep running eventhough the application is not active anymore. Using system wide keyboard hooks which pass the key first to LabVIEW to then pass it back to the application if LabVIEW didn't eat, it could slow down your video app very seriously. If my assumption of the reason the video stops playing is correct, another way could be however to just sent the main window of your video app regularly dummy events from within the LabVIEW app. Sending WM_NULL messages might be already enough to keep the video playback going and then your app wouldn't need to be active to keep playing. It would have the additional benefit of not misbehaving if the user happened to click into the LabVIEW app window and make it active instead. Rolf Kalbermatter CIT Engineering Nederland BV tel: +31 (070) 415 9190 Treubstraat 7H fax: +31 (070) 415 9191 2288 EG Rijswijk http://www.citengineering.com Netherlands mailto:[EMAIL PROTECTED]