Display more informative message when HtmlHelp stub is invoked

Mike Hearn mh at codeweavers.com
Mon May 31 18:43:25 CDT 2004


This one might prove a tad controversial. In some cases, like where we know
a stub would produce UI anyway, I think it's a good idea to show a helpful
message box rather than assume the user can interpret stub messages they may
not even see.

thanks -mike

Mike Hearn <mh at codeweavers.com>
Display more informative message when HtmlHelp stub is invoked,
add A/W conversion code, remove useless (and wrong) hungarian
notation from function prototypes.

Index: dlls/hhctrl.ocx/Makefile.in
===================================================================
RCS file: /home/wine/wine/dlls/hhctrl.ocx/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in
--- dlls/hhctrl.ocx/Makefile.in	22 Apr 2004 03:45:00 -0000	1.1
+++ dlls/hhctrl.ocx/Makefile.in	31 May 2004 23:41:49 -0000
@@ -3,7 +3,7 @@
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = hhctrl.ocx
-IMPORTS   = shell32
+IMPORTS   = shell32 kernel32 user32
 
 C_SRCS = hhctrl.c
 
Index: dlls/hhctrl.ocx/hhctrl.c
===================================================================
RCS file: /home/wine/wine/dlls/hhctrl.ocx/hhctrl.c,v
retrieving revision 1.1
diff -u -r1.1 hhctrl.c
--- dlls/hhctrl.ocx/hhctrl.c	22 Apr 2004 03:45:00 -0000	1.1
+++ dlls/hhctrl.ocx/hhctrl.c	31 May 2004 23:41:49 -0000
@@ -23,21 +23,35 @@
 #include "windef.h"
 #include "winbase.h"
 #include "wingdi.h"
+#include "winnls.h"
 #include "winuser.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(htmlhelp);
 
-HWND WINAPI HtmlHelpA(HWND hwndCaller, LPCSTR pszFile,
-  UINT uCommand, DWORD dwData)
+HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD data)
 {
-	FIXME("stub\n");
+   FIXME("(%p, %s, %d, %ld): stub\n", caller, debugstr_w(filename), command, data);
+
+   /* if command is HH_DISPLAY_TOPIC just display an informative message for now */
+   if (command == 0)
+       MessageBoxA( NULL, "HTML Help functionality is currently unimplemented.\n\n"
+                          "Try installing Internet Explorer, or using a native hhctrl.ocx with the Mozilla ActiveX control.",
+                          "Wine", MB_OK | MB_ICONEXCLAMATION );
 	return 0;
 }
 
-HWND WINAPI HtmlHelpW(HWND hwndCaller, LPCWSTR pszFile,
-  UINT uCommand, DWORD dwData)
+HWND WINAPI HtmlHelpA(HWND caller, LPCSTR filename, UINT command, DWORD data)
 {
-	FIXME("stub\n");
-	return 0;
+   WCHAR *wfile = NULL;
+   DWORD len = MultiByteToWideChar( CP_ACP, 0, filename, -1, NULL, 0 );
+   HWND result;
+        
+   wfile = HeapAlloc( GetProcessHeap(), 0, len );
+   MultiByteToWideChar( CP_ACP, 0, filename, -1, wfile, len );
+        
+	result = HtmlHelpW( caller, wfile, command, data );
+        
+   HeapFree( GetProcessHeap(), 0, wfile );
+   return result;
 }



More information about the wine-patches mailing list