Hi, I'm working on a background UI plugin (in C++ using the WMP10 SDK and testing in WMP11 on Vista). I grab the IWMPCore object passed to SetCore. I want the plugin to be invisible to the user but I need it to be able to control various aspects of the player, so for example the first thing I tried was grabbing the IWMPControls interface on then on a thread calling methods like play, and stop. These seem to work fine but the applications UI doesn't update in response to these state changes. By this I mean that I can start a track playing, and the timer starts counting up and I hear music start, but the big play button in the centre doesn't change to a pause button as it would if I'd carried out the same operation by manually clicking on that button in the WMP UI. So what am I missing, or is my approach totally wrong in some way? Any help would be much appreciated... Thanks, - Dave.
Well after spending a couple of days investigating this it's looking like the various WMP interfaces don't like being called from threads. My plugin creates a thread and on it calls methods like stop and play on the IWMPControls interface and in this scenario the UI doesn't correctly update. If I instead turn my plugin into a windowed plugin (it was a background plugin) and carry out the same calls in the window callback then everything works fine. My current plan is to use window messages to queue up commands and carry out all access (put methods all least) to the WMP interfaces inside the window procedure, but this still seems a bit wrong. I don't really see how are background plugins are supposed to function? Surely the only sensible thing to do with a background plugin is the create a thread to carry out the processing unless all you need to do is monitor WMP events or something... "Dave" wrote: > Hi, > > I'm working on a background UI plugin (in C++ using the WMP10 SDK and > testing in WMP11 on Vista). > > I grab the IWMPCore object passed to SetCore. I want the plugin to be > invisible to the user but I need it to be able to control various aspects of > the player, so for example the first thing I tried was grabbing the > IWMPControls interface on then on a thread calling methods like play, and > stop. These seem to work fine but the applications UI doesn't update in > response to these state changes. By this I mean that I can start a track > playing, and the timer starts counting up and I hear music start, but the big > play button in the centre doesn't change to a pause button as it would if I'd > carried out the same operation by manually clicking on that button in the WMP > UI. > > So what am I missing, or is my approach totally wrong in some way? Any help > would be much appreciated... > > Thanks, > - Dave. >