views:

83

answers:

3

Watching a movie is quite a different user activity.

User doesn't touch neither mouse nor keyboard. Yet he 'actively' uses the computer. Thus, screensaver shouldn't run, indexing should be performed with care etc.

On the other side, playing video requires either using direct write to video memory, or DirectShow, or some other API. This may be the key to the answer.

What is the Dead Simple Way to determine that a video is being played?

A: 

I don't know of a way you can detect if there is a video playing. The only thing I can think of is to iterate through all the processes running on the system (Process32First, Process32Next) and checking the process names off against a list of known media players.

I don't think there is any "dead simple" ways to achieve what you want.

Goz
A: 

I could also think about iterating through all files which are opened in the operating system (if you have access to it). And then determine the mime type of each opened file to check whether it is a movie file, but this could also mean that you are using the movie with a different program like an encoder or decoder.

Rupert Jones
A: 

If you're just trying to prevent the screensaver from coming on during a movie, how about using something like AutoHotkey to check the active window title and move the mouse every few minutes? Pretty high-level hack, but it works.

Some media players inhibit the screensaver on their own: VLC, for example.

echoback