Use of MFC from a WMP plugin

Windows Media


  • 1. Interface IWMLanguageList -GetLanguageDetails returns different va
    I have one mp3 file which i am trying to read the all the tags (Artist,Duration,Album etc) . I am calling the GetLanguageDetails() method of IWMLanguageList interface. It is retrieving the correct language that is English (EN-US) but the same track on my collegaues PC it is showing French (FR). Why this interface method is showing diffrent even the same track we are reading the tags. Can someone help what could be the reason? Is this some language settings or any registry settings causing this problem?
  • 2. IWMReader with custom allocated buffers
    I am rendering a movie using the IWMReader interface. It works fine, but I have performance problems. After optimizing all I could, I now want to create my own buffers for the samples which should be used by the reader. I think I made all according to the description which is given in the SDK. I implemented the IWMReaderCallbackAdvanced interface and defined its methods. I set SetAllocateForOutput() to TRUE which should cause the reader to call the AllocateForOutput callback, but the reader doesn't. Why? What have I missed? Is there a source code available? Thanks for help, Richard
  • 3. Read growing file after NS_E_NO_MORE_SAMPLES
    Hi all, I have a worker which writes a WMV file and another worker which reads the growing file. I've noticed if IWMSyncReader::GetNextSample() has once delivered NS_E_NO_MORE_SAMPLES for a stream (e.g. Audio) I have no chance to try it later one more time even if the file has been finished already. But I have the possibility to call GetNextSample() for the other stream (e.g. Video). Is there a way to get this working so that I continue reading the file even if NS_E_NO_MORE_SAMPLES was returned before? I also tried to call IWMSyncReader::SetRange after NS_E_NO_MORE_SAMPLES but my files have no index and the function returned with NS_E_INVALID_REQUEST. Thanks Alex
  • 4. Timecode display out of sync in WMPlayer for Vista & Windows 7
    Hello, Windows Media Player can playback a WMV file with SMPTE timecode written in the aux track. It can show a synchronized timecode display in "Play Speed Settings" tab under enhancements option. And it used to display correct Timecode value in Windows XP environment. Recently, I tried to playback the same file in Windows Media Player under Vista environment. I found that the SMPTE timecode is out of sync from the video. As I have burnt-in timecode in the video content, it is easy to identify this issue. This problem even occurs in Windows 7 environment. Does any one have the same issue as me? And how can we fix this problem? Thank you in advance, Benny

Use of MFC from a WMP plugin

Postby billb » Sat, 08 Nov 2003 14:05:48 GMT

I am trying to use the MFC classes CInternetSession and
CHttpConnection within a WMP UI plugin and having no luck.

First I tried to make the plugin call these MFC classes directly,
which did not work.

So I built a separate DLL that calls the MFC classes, and called this
DLL from my plugin DLL through a C wrapper funtion.  It does link and
register, but WMP will not initialize the plugin when it is linked to
the MFC DLL.  When I try to show the Properties page of my plugin from
the Plugins list, I get an error.  It doesn't even hit a breakpoint in
the plugin.

Is there any way to call MFC/AFX classes from a wmp plugin,, or is
this a restriction?


Use of MFC from a WMP plugin

Postby Ryan » Tue, 11 Nov 2003 13:59:24 GMT

I used WinInet then WinHttp and finally CAtlHttpClient. 
The first 2 are Win32 based and difficult to implement. 
CAtlHttpClient Rocks!
Ryan beckett40@hotmail<remove this>.com
called this
does link and
is linked to
my plugin from
breakpoint in
plugin,, or is

Similar Threads:

1.Adding custom hotkeys to WMP using UI plugin

I've made a background UI plugin (using the WMP plugin 
wizard), and have come across a problem: none of the 
IWMPEvents functions like Mouse and Keyboard 
Up/Down/Click seem to work. No matter what I press, they 
just are never called. On the other hand, the functions 
that notify my plugin when a user plays, pauses, stops, 
moves to a different position, etc... work fine. I'm new 
to COM and WMP plugin development, so I could very well 
be missing something simple. If someone could tell me how 
to get those functions to be called, using the 
UI/Background wizard project as the base, I would be very 

2.Capturing keyboard-mouse events from a wmp ui plugin, using c++ wi


I have problems capturing mouse and keyboard events from a wmp UI plugin. In 
the help document, "Customizing the UI Plug-in":

"If your plug-in is configured to listen to Windows Media Player events, the 
wizard will have generated default or empty implementations of all the 
necessary event handlers, which you also modify or create."

Indeed, the wizard has generated empty implementations of Click, 
DoubleClick, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove and MouseUp 
events. However, these events are never fired, functions are never called. I 
tried all types of UI plugins, pressed every key, and clicked everywhere on 
the player. Other events work fine, for example, PlayStateChange event is 
fired for play-stop-pause actions.

I think mouse and keyboard events are disabled in some way. But I could not 
find how. In another help document, "Capturing Keyboard and Mouse Events":

"To receive mouse movement and mouse click events, set the 
SendMouseMoveEvents and SendMouseClickEvents properties to true."

Unfortunately, these properties are for "Windows Media Player Control", not 
the player itself. There should be a way to enable these properties from a UI 
plugin. Without mouse-keyboard events, how can it be a "user interface" 

My main intent is capturing mouse movements and clicks on the video when 
playing, but I am not even close. If you know the way, please help.

3.Simple text box in UI plugin for WMP 10 using SDK

Okay, so I have a lot of C++ experience, but limited windows programming and 
limited COM knowledge.  I am trying to show a simple text box in a UI plugin 
that I am developing with the VC++.NET wizard.  It did not seem like I could 
instantiate an CEdit object, so I found code on the net that allows to create 
a CEdit box within a CContainedWindowT object.  I can actually get it to 
paint on the screen, but it freezes up WMP.  I think I am handling the events 

So, in the CPluginWindow.h file, I added the following in the private section:

CContainedWindowT< CEditT<CWindow>, CWinTraitsOR<WS_BORDER | ES_AUTOVSCROLL 
| ES_MULTILINE> > lyricsBox;

CEditT is what I found online define, I can append that code if necessary.

Then, I added a method to the CPluginWindow class as fallows to paint the 

void PaintChildObjects()
		RECT    rc;
		RECT lyricsBoxPos = {5, 5, 5, 5};
		lyricsBox.Create(this, 0, m_hWnd, &lyricsBoxPos, NULL,
		::SetWindowPos(lyricsBox.m_hWnd, NULL, 0, 0, 100, 100, SWP_NOZORDER | 

I also added this to the CPluginWindow initializer list:

 : lyricsBox(_T("Lyrics"), this, 0)

Then, from my plugin cpp code, in the CWmpplugin2::Create method, after the 
plugin is "creat"ed, I added the call to the method I defined above:

    // create the plugin window
    RECT rcPos = { 0, 0, 100, 100};
    HWND hWnd = m_pPluginWindow->Create(hwndParent, rcPos, _T("wmpplugin2 
    if (NULL == hWnd)
        delete m_pPluginWindow;
        m_pPluginWindow = NULL;
        return E_FAIL;

I did not update the message map at all, and I'm guessing that may be the 
problem.  It is just the default message map in CPluginWindow.h:


Thanks so much!
I am just trying to make a simple plugin to show static lyrics.

4.How can tranfer my data (publickey) between HttpClient and HttpServer using INTERNET_FLAG_SECURE using MFC VC 6.0

Dear Friends,

I have developed web server that takes http request from http client.
both http server and http client is developed in vc++ 6.0 using MFC.

My problem:

The Http Client say (HC) give request for encryption key to Http Server
say(HS).Logically this process of transfering key between HC-HS must be
secure. For this reason i want to implement a method that Uses secure
transaction semantics.

I know about INTERNET_ FLAG (INTERNET_FLAG_SECURE).If i implemented
this flag on client side then what respective change web server should
to get secure transaction on both side

Please Help me fast


5.problem of creating WMP activex control in MFC program

I have a project created with VC6 before, now we change to VS2005,  When 
rebuilding, I found a problem hard to resolve: 

One of my views will create a WMP activex control in some cases, it works 
fine if we build project using VC6, but when building with VS2005, the WMP 
control will not show if no video is opened, and will show video only if some 
video is opened( no control bar and progress bar ).

I did some searching on net, it seems because of some "windowless" control 

Now my question is, I need the WMP control shows same as the one building 
with VC6. Any one know how to do this? 

below is some code of my project:

class CMyView : public CView
	CWMPPlayer4 *m_pPlayer;

void CMyView::OnInitialUpdate()

	m_pPlayer = new CWMPPlayer4;
	CRect rct;
	m_pPlayer->Create(_T(""), WS_VISIBLE, rct, this, ID_PLAYER );


class CWMPPlayer4 : public CWnd
	CLSID const& GetClsid()
		static CLSID const clsid
			= { 0x6BF52A52, 0x394A, 0x11D3, { 0xB1, 0x53, 0x0, 0xC0, 0x4F, 0x79, 
0xFA, 0xA6 } };
		return clsid;
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD 
						const RECT& rect, CWnd* pParentWnd, UINT nID, 
						CCreateContext* pContext = NULL)
		return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, 
pParentWnd, nID); 

    BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, 
CWnd* pParentWnd, 
				UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE,
				BSTR bstrLicKey = NULL)
		return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, 
pParentWnd, nID,
		pPersist, bStorage, bstrLicKey); 

6. 4 ZachD @ microsoft...MFC Runtime w/any WMP version

7. WMP 11, MFC, ActiveX, C++ (VS 2008) - put_uiMode("full") no effect

8. WMP ocx & MFC

Return to Windows Media


Who is online

Users browsing this forum: No registered users and 14 guest