Article ID: 121330
Article Last Modified on 10/30/2003
hwndPanel = MCIWndCreate(hwndParent, hInst,
MCIWNDF_NOAUTOSIZEMOVIE | MCIWNDF_NOMENU |
WS_OVERLAPPED | WS_BORDER | WS_CAPTION |
WS_SYSMENU | WS_POPUP, NULL);
MCIWndOpen(hwndPanel, fname, 0);
MCIWndRealize(hwndPanel, TRUE);
SetWindowPos(hwndPanel, HWND_TOP, X, Y, 0, 0,
SWP_NOSIZE | SWP_DRAWFRAME | SWP_SHOWWINDOW);
MCIWndPlay(hwndPanel);
// MakeProcInstance() is called once in a convenient place such
// as the application's InitInstance() procedure. RealizeProc()
// is the procedure that subclasses MCIWndProc(). RealizeProc()
// will process WM_QUERYNEWPALETTE messages on behalf of
// MCIWndProc(). In the Module Definition File, list the
// RealizeProc() procedure under EXPORTS.
lpfnRealizeProc = MakeProcInstance((FARPROC)
RealizeProc, hinstCurrent);
// In the application's MainWndProc() under "case WM_DESTROY:",
// call FreeProcInstance().
FreeProcInstance(lpfnRealizeProc);
// Add the next two function calls to the code shown in the
// Symptoms section just after the call to MCIWndCreate(). The
// GetWindowLong() call returns a pointer to the popup window's
// original window procedure, namely MCIWndProc(). The
// SetWindowLong() procedure specifies that the RealizeProc()
// procedure is the new window procedure for the popup window.
lpfnOldRealizeProc = (FARPROC)GetWindowLong(hwndPanel,
GWL_WNDPROC);
SetWindowLong(hwndPanel, GWL_WNDPROC, (LONG)
lpfnRealizeProc);
// The following procedure subclasses MCIWndProc(). It processes
// the WM_QUERYNEWPALETTE messages. All other messages
// are sent to MCIWndProc(), which is pointed to by the
// parameter lpfnOldRealizeProc.
long FAR PASCAL RealizeProc(HWND hwndPanel, UINT message, WPARAM
wParam, LPARAM lParam)
{
switch (message)
{
case WM_QUERYNEWPALETTE:
return (MCIWndRealize(hwndPanel, TRUE));
default:
return (CallWindowProc((WNDPROC)lpfnOldRealizeProc,
hwndPanel, message, wParam, lParam));
}
}
Additional query words: 3.10 1.10 mci buglist3.10 buglist1.10
Keywords: kbmm KB121330