Don't winexec while video playing
Posted on 2005-04-11
Hello, I have a product which runs an update program every 3 hours or so to keep definitions up to date, not anti virus prog but along those lines.. Sorry for the long explanation but neccessary i think...
Anyway, all is well but I noticed that if I winexec the updater.exe while a video is playing in Windows Media Player etc it interupts full screen playback and no doubt annoys my users when this occurs (it annoyed me the other day when watching a dvd ;), I have seen other programs (like screen savers) avoid execution when there is video playback happening, the pc is idle but it is clever enough to know that the user may be just watching something!
I am looking for something like...
var PlayingVideo: boolean;
If PlayingVideo = false then winexec('updater.exe',sw_show);
I just need to find a way to detect video playback and set PlayingVideo (dvd or the odd avi, mpeg etc.. and other players other than media player would also be great but probably asking too much!)
Thanks in advance for you help, I hope this makes sense, I'm sure you will tell me if it does not ;)
Oh btw I would like the updater to be visible when run so something like changing to sw_hide is not what I'm after, I want the user to know that an update is happening, I would rather skip or postpone the update for when video playback has stopped.