1

Topic: Obtaining of events from working WMPlayer

Colleagues, I need to catch events about operation already launched wmplayer: the beginning/end of playing of video. I.e. it is required to receive a certain interface of the object-player working in address space wmplayer.exe in my process and to fasten to it mine  . I can not be connected to it by a legal method, i.e.  on I consider. The plug-in to wmplayer - too was to be considered no. OS: Windows 8 x64. Here that . When wmplayer it starts registers the IUnknown in ROT with such DisplayName:" clsid:91778246-9BE4-4713-A651-E833B853CC30:!session:2 ". Tried following methods of connection to it: 1) Through GetActiveObject (from oleauto.h): as CLSID strutters {91778246-9BE4-4713-A651-E833B853CC30}: const wchar_t MediaPlayerClsidString [] = L" {91778246-9BE4-4713-A651-E833B853CC30} "; CLSIDFromString (MediaPlayerClsidString, &clsid); HRESULT hr = GetActiveObject (clsid, NULL, (IUnknown **) &pUnk); I receive hr 0x800401e3 Operation unavailable. 2) Through GetActiveObject: as CLSID strutters {22D6F312-B0F6-11D0-94AB-0080C74C7E95} which is clsid from coclass from library of type C:\Windows\System32\msdxm.tlb: I receive hr 0x800401e3 Operation unavailable. 3) Through ROT, using IRunningObjectTable:: EnumRunning. .. I receive moniker which I identify on DisplayName =="clsid:91778246-9BE4-4713-A651-E833B853CC30:!session:2". By means of IRunningObjectTable:: GetObject (rot, moniker) I receive IUnknown. From it IUnknown I try  interfaces: IWMPCore, IWMPPlayer, IWMPPlayer2 etc. - All that is in  wmp.h. Except them also IDispatch, IDispatchEx, IInternalUnknown. On all I receive E_NOINTERFACE. Also tried  interfaces with iid {22D6F311-B0F6-11D0-94AB-0080C74C7E95} and {20D4F5E0-5475-11D2-9774-0000F80855E6} which looked in the same library of type msdxm.tlb are interfaces IMediaPlayer and IMediaPlayer2. Too I receive E_NOINTERFACE. 4) walked under  on QueryInterface that IUnknown which received through a moniker from ROT. Found out that is possible  interfaces: IMarshal, IMarshal2, IStdIdentity, IAgileObject, IProxyManager, IAggregatedIdentity, IRemUnknown. Me interested from them IProxyManager, probably through it it would be possible to create a proxy to object which lives in address space of process wmplayer.exe. IProxyManager it is really possible  but as with it to work further yet did not find. .. At present I have only the last method giving illusive hope of success of the enterprise. And me it was thought, I can I move not in those directions? Or at me task setting is incorrect? Judgements?

2

Re: Obtaining of events from working WMPlayer

Hello, Weiss, you wrote: W> I need to catch events about operation already launched wmplayer: the beginning/end of playing of video. I.e. it is required to receive a certain interface of the object-player working in address space wmplayer.exe in my process and to fasten to it mine  . I can not be connected to it by a legal method, i.e.  on I consider. The plug-in to wmplayer - too was to be considered no. OS: Windows 8 x64. W> Here that . When wmplayer it starts registers the IUnknown in ROT with such DisplayName:" clsid:91778246-9BE4-4713-A651-E833B853CC30:!session:2 ". It" Class Moniker "together with" Item Moniker ". W> Tried following methods of connection to it: W> 1) Through GetActiveObject (from oleauto.h): as CLSID strutters {91778246-9BE4-4713-A651-E833B853CC30}: W> const wchar_t MediaPlayerClsidString [] = L" {91778246-9BE4-4713-A651-E833B853CC30} "; W> CLSIDFromString (MediaPlayerClsidString, &clsid); W> HRESULT hr = GetActiveObject (clsid, NULL, (IUnknown **) &pUnk); W> I receive hr 0x800401e3 Operation unavailable. W> 2) Through GetActiveObject: as CLSID strutters {22D6F312-B0F6-11D0-94AB-0080C74C7E95} which is clsid from coclass from library of type C:\Windows\System32\msdxm.tlb: W> I receive hr 0x800401e3 Operation unavailable. It is a method - a method through GetActiveObject - works, if in ROTH the moniker with such DisplayName is registered:" ! CLSID ", i.e. incomplete or not connected" Item Moniker ". W> 3) Through ROT, using IRunningObjectTable:: EnumRunning. .. I receive moniker which I identify on DisplayName =="clsid:91778246-9BE4-4713-A651-E833B853CC30:!session:2". By means of IRunningObjectTable:: GetObject (rot, moniker) I receive IUnknown. W> From it IUnknown I try  interfaces: IWMPCore, IWMPPlayer, IWMPPlayer2 etc. - all that is in  wmp.h. Except them also IDispatch, IDispatchEx, IInternalUnknown. On all I receive E_NOINTERFACE. W> Also tried  interfaces with iid {22D6F311-B0F6-11D0-94AB-0080C74C7E95} and {20D4F5E0-5475-11D2-9774-0000F80855E6} which looked in the same library of type msdxm.tlb are interfaces IMediaPlayer and IMediaPlayer2. Too I receive E_NOINTERFACE. Basically, the correct way, but it is necessary to know precisely, what interface to demand. W> 4) Walked under  on QueryInterface that IUnknown which received through a moniker from ROT. Found out that is possible  interfaces: W> IMarshal, IMarshal2, IStdIdentity, IAgileObject, IProxyManager, IAggregatedIdentity, IRemUnknown. Me interested from them IProxyManager, probably through it it would be possible to create a proxy to object which lives in address space of process wmplayer.exe. IProxyManager it is really possible  but as with it to work further yet did not find. That you are right, you need to walk not in the process, and in process wmplayer - there there will be absolutely other interfaces. W> .. At present I have only the last method giving illusive hope of success of the enterprise. W> and me it was thought, I can I move not in those directions? Or at me task setting is incorrect? W> judgements?