[PATCH] winhlp32: add browse buttons for WINHELP30 files

Wolfram Sang wolfram at the-dreams.de
Mon Jun 14 07:47:17 CDT 2010


Fixes bug 14299. I used the testbot to verify that all Windows versions
prior Vista do display the browse buttons. Starting with Vista, those
old helpfiles are not supported anymore.

Signed-off-by: Wolfram Sang <wolfram at the-dreams.de>
---
 programs/winhlp32/hlpfile.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/programs/winhlp32/hlpfile.c b/programs/winhlp32/hlpfile.c
index 5146c38..ea5ce48 100644
--- a/programs/winhlp32/hlpfile.c
+++ b/programs/winhlp32/hlpfile.c
@@ -1958,6 +1958,16 @@ static BOOL HLPFILE_ReadFileToBuffer(HLPFILE* hlpfile, HFILE hFile)
  *
  *           HLPFILE_SystemCommands
  */
+
+/* WINHELP30 format does not have macros for creating browse buttons. Viewers
+ * display them unconditionally. Enforce this behaviour by adding a default
+ * macro for such helpfiles. See bug 14299.
+ */
+static HLPFILE_MACRO hdr30_browse_buttons = {
+    .lpszMacro = "BrowseButtons()",
+    .next = NULL
+};
+
 static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile)
 {
     BYTE *buf, *ptr, *end;
@@ -2016,6 +2026,7 @@ static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile)
         if (!hlpfile->lpszTitle) return FALSE;
         lstrcpy(hlpfile->lpszTitle, str);
         WINE_TRACE("Title: %s\n", hlpfile->lpszTitle);
+        hlpfile->first_macro = &hdr30_browse_buttons;
         /* Nothing more to parse */
         return TRUE;
     }
-- 
1.7.1




More information about the wine-patches mailing list