From 3ae281cf5ba63cb64b7988c10aca72ab1b693f18 Mon Sep 17 00:00:00 2001
From: jeblanchard <jeblanchard@users.sf.net>
Date: Sun, 1 Jun 2008 17:01:31 +0000
Subject: [PATCH] Actually add the new files; search for the .chm in
 ${BASE}/help/ (as req'd by adelikat)

---
 src/drivers/win/help.cpp | 17 +++++++++++++++++
 src/drivers/win/help.h   |  2 ++
 2 files changed, 19 insertions(+)
 create mode 100644 src/drivers/win/help.cpp
 create mode 100644 src/drivers/win/help.h

diff --git a/src/drivers/win/help.cpp b/src/drivers/win/help.cpp
new file mode 100644
index 00000000..c0d8a7ae
--- /dev/null
+++ b/src/drivers/win/help.cpp
@@ -0,0 +1,17 @@
+#include "main.h"
+#include "help.h"
+#include <htmlhelp.h>
+
+void OpenHelpWindow(const char *subpage)
+{
+	char helpFileName[MAX_PATH];
+	strcpy(helpFileName, BaseDirectory);
+	strcat(helpFileName, "\\help\\fceux.chm");
+	if (subpage)
+	{
+		strcat(helpFileName, "::/");
+		strcat(helpFileName, subpage);
+		strcat(helpFileName, ".htm");
+	}
+	HtmlHelp(GetDesktopWindow(), helpFileName, HH_DISPLAY_TOPIC, (DWORD)NULL);
+}
diff --git a/src/drivers/win/help.h b/src/drivers/win/help.h
new file mode 100644
index 00000000..1c6947ef
--- /dev/null
+++ b/src/drivers/win/help.h
@@ -0,0 +1,2 @@
+// Open a help window to the default topic, or to ::/subpage.htm
+void OpenHelpWindow(const char *subpage = NULL);