Index: /trunk/include/config-win32.h
===================================================================
--- /trunk/include/config-win32.h	(revision 577)
+++ /trunk/include/config-win32.h	(revision 871)
@@ -2,4 +2,6 @@
 /* config-win32.h
 	Win32 counterpart to the config.h generated from Linux build. */
+
+#include "ntverp.h"
 
 #define PACKAGE "hoverrace"
@@ -13,2 +15,7 @@
 
 #define HAVE_LUA 1
+
+// Only enable DirectShow support if a recent Windows SDK is installed.
+#if defined(VER_PRODUCTBUILD) && VER_PRODUCTBUILD >= 6001
+#	define WITH_DIRECTSHOW 1
+#endif
Index: /trunk/client/Game2/GameApp.cpp
===================================================================
--- /trunk/client/Game2/GameApp.cpp	(revision 870)
+++ /trunk/client/Game2/GameApp.cpp	(revision 871)
@@ -2406,8 +2406,12 @@
 
 		case WM_PAINT:
-			// Nothing to paint (all done by video or DirectX)
-			PAINTSTRUCT lPs;
-			BeginPaint(pWindow, &lPs);
-			EndPaint(pWindow, &lPs);
+			{
+				// Nothing to paint (all done by video or DirectX)
+				PAINTSTRUCT lPs;
+				HDC hdc = BeginPaint(pWindow, &lPs);
+				if (This->introMovie != NULL)
+					This->introMovie->Repaint(hdc);
+				EndPaint(pWindow, &lPs);
+			}
 			return 0;
 
Index: /trunk/client/Game2/IntroMovie.h
===================================================================
--- /trunk/client/Game2/IntroMovie.h	(revision 868)
+++ /trunk/client/Game2/IntroMovie.h	(revision 871)
@@ -23,4 +23,8 @@
 #pragma once
 
+#ifdef WITH_DIRECTSHOW
+#	include <dshow.h>
+#endif
+
 namespace HoverRace {
 namespace Client {
@@ -36,8 +40,15 @@
 		~IntroMovie();
 
+	private:
+		void Clean();
+#		ifdef WITH_DIRECTSHOW
+			HRESULT InitDirectShow(const std::string &movieFilename);
+#		endif
+
 	public:
 		void Play();
 
 		void ResetSize();
+		void Repaint(HDC hdc);
 		void ResetPalette(bool background=false);
 
@@ -45,5 +56,7 @@
 		HWND hwnd;
 #		ifdef WITH_DIRECTSHOW
-			//TODO
+			IGraphBuilder *graph;
+			IVMRWindowlessControl *winCtl;
+			IMediaControl *mediaCtl;
 #		else
 			HWND movieWnd;
Index: /trunk/client/Game2/IntroMovie.cpp
===================================================================
--- /trunk/client/Game2/IntroMovie.cpp	(revision 868)
+++ /trunk/client/Game2/IntroMovie.cpp	(revision 871)
@@ -32,4 +32,5 @@
 
 #include "../../engine/Util/Config.h"
+#include "../../engine/Util/Str.h"
 
 #include "IntroMovie.h"
@@ -37,8 +38,13 @@
 using namespace HoverRace;
 using namespace HoverRace::Client;
-using HoverRace::Util::Config;
+using namespace HoverRace::Util;
 
 IntroMovie::IntroMovie(HWND hwnd, HINSTANCE hinst) :
-	hwnd(hwnd)
+	hwnd(hwnd),
+#ifdef WITH_DIRECTSHOW
+	graph(NULL), winCtl(NULL), mediaCtl(NULL)
+#else
+	movieWnd(NULL)
+#endif
 {
 	Config *cfg = Config::GetInstance();
@@ -46,6 +52,11 @@
 
 #ifdef WITH_DIRECTSHOW
-	//TODO
+	HRESULT hr;
+	if (FAILED(hr = InitDirectShow(movieFilename))) {
+		Clean();
+	}
+
 #else
+
 	movieWnd = MCIWndCreate(
 		hwnd, hinst, 
@@ -65,6 +76,16 @@
 IntroMovie::~IntroMovie()
 {
+	Clean();
+}
+
+void IntroMovie::Clean()
+{
 #ifdef WITH_DIRECTSHOW
-	//TODO
+	if (mediaCtl != NULL)
+		mediaCtl->Release();
+	if (winCtl != NULL)
+		winCtl->Release();
+	if (graph != NULL)
+		graph->Release();
 #else
 	if (movieWnd != NULL) {
@@ -76,8 +97,39 @@
 }
 
+#ifdef WITH_DIRECTSHOW
+HRESULT IntroMovie::InitDirectShow(const std::string &movieFilename)
+{
+	HRESULT hr;
+
+	if (FAILED(hr = CoCreateInstance(CLSID_FilterGraph, NULL,
+		CLSCTX_INPROC_SERVER, IID_IGraphBuilder,
+		(void**)&graph))) return hr;
+
+	CComPtr<IBaseFilter> vmr;
+	if (FAILED(hr = CoCreateInstance(CLSID_VideoMixingRenderer, NULL, 
+		CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&vmr))) return hr;
+	if (FAILED(hr = graph->AddFilter(vmr, L"Video Mixing Renderer"))) return hr;
+
+	CComPtr<IVMRFilterConfig> filterCfg;
+	if (FAILED(hr = vmr->QueryInterface(IID_IVMRFilterConfig, (void**)&filterCfg))) return hr;
+	if (FAILED(hr = filterCfg->SetRenderingMode(VMRMode_Windowless))) return hr;
+
+	if (FAILED(hr = vmr->QueryInterface(IID_IVMRWindowlessControl, (void**)&winCtl))) return hr;
+
+	if (FAILED(hr = winCtl->SetVideoClippingWindow(hwnd))) return hr;
+
+	if (FAILED(hr = graph->RenderFile(Str::UW(movieFilename.c_str()), NULL))) return hr;
+
+	if (FAILED(hr = graph->QueryInterface(IID_IMediaControl, (void**)&mediaCtl))) return hr;
+
+	return ERROR_SUCCESS;
+}
+#endif
+
 void IntroMovie::Play()
 {
 #ifdef WITH_DIRECTSHOW
-	//TODO
+	if (mediaCtl != NULL)
+		mediaCtl->Run();
 #else
 	if (movieWnd != NULL)
@@ -88,16 +140,35 @@
 void IntroMovie::ResetSize()
 {
-#ifndef WITH_DIRECTSHOW
 	RECT clientRect, movieRect;
 
 	if (GetClientRect(hwnd, &clientRect)) {
-		if (GetWindowRect(movieWnd, &movieRect)) {
-			SetWindowPos(movieWnd, HWND_TOP,
-				0, 0,
-				clientRect.right - clientRect.left,
-				clientRect.bottom - clientRect.top,
-				SWP_SHOWWINDOW);
-		}
+#		ifdef WITH_DIRECTSHOW
+			HRESULT hr;
+			long w, h;
+
+			if (mediaCtl != NULL) {
+				if (FAILED(hr = winCtl->GetNativeVideoSize(&w, &h, NULL, NULL))) {
+					return;
+				}
+				SetRect(&movieRect, 0, 0, w, h);
+				winCtl->SetVideoPosition(&movieRect, &clientRect);
+			}
+#		else
+			if (GetWindowRect(movieWnd, &movieRect)) {
+				SetWindowPos(movieWnd, HWND_TOP,
+					0, 0,
+					clientRect.right - clientRect.left,
+					clientRect.bottom - clientRect.top,
+					SWP_SHOWWINDOW);
+			}
+#		endif
 	}
+}
+
+void IntroMovie::Repaint(HDC hdc)
+{
+#ifdef WITH_DIRECTSHOW
+	if (winCtl != NULL)
+		winCtl->RepaintVideo(hwnd, hdc);
 #endif
 }
@@ -105,5 +176,8 @@
 void IntroMovie::ResetPalette(bool background)
 {
-#ifndef WITH_DIRECTSHOW
+#ifdef WITH_DIRECTSHOW
+	if (winCtl != NULL)
+		winCtl->DisplayModeChanged();
+#else
 	MCIWndRealize(movieWnd, background);
 #endif
Index: /trunk/client/Game2/main.cpp
===================================================================
--- /trunk/client/Game2/main.cpp	(revision 861)
+++ /trunk/client/Game2/main.cpp	(revision 871)
@@ -184,4 +184,6 @@
 	_chdir(appPath);
 	free(appPath);
+
+	CoInitialize(NULL);
 #endif
 
@@ -258,4 +260,8 @@
 	Config::Shutdown();
 
+#ifdef _WIN32
+	CoUninitialize();
+#endif
+
 	return lErrorCode;
 }
