[PATCH 3/8] [WinHelp]: implemented SetHelpOnFile macro

Eric Pouech eric.pouech at orange.fr
Sat Jul 12 03:37:01 CDT 2008




A+
---

 programs/winhlp32/hlpfile.c |    1 +
 programs/winhlp32/hlpfile.h |    2 ++
 programs/winhlp32/macro.c   |   17 ++++++++++++++---
 3 files changed, 17 insertions(+), 3 deletions(-)


diff --git a/programs/winhlp32/hlpfile.c b/programs/winhlp32/hlpfile.c
index 046d25a..8d03b99 100644
--- a/programs/winhlp32/hlpfile.c
+++ b/programs/winhlp32/hlpfile.c
@@ -2641,5 +2641,6 @@ void HLPFILE_FreeHlpFile(HLPFILE* hlpfile)
     HeapFree(GetProcessHeap(), 0, hlpfile->phrases_offsets);
     HeapFree(GetProcessHeap(), 0, hlpfile->phrases_buffer);
     HeapFree(GetProcessHeap(), 0, hlpfile->topic_map);
+    HeapFree(GetProcessHeap(), 0, hlpfile->help_on_file);
     HeapFree(GetProcessHeap(), 0, hlpfile);
 }
diff --git a/programs/winhlp32/hlpfile.h b/programs/winhlp32/hlpfile.h
index 9b086c2..f25fc62 100644
--- a/programs/winhlp32/hlpfile.h
+++ b/programs/winhlp32/hlpfile.h
@@ -132,6 +132,8 @@ typedef struct tagHlpFileFile
     unsigned                    numWindows;
     HLPFILE_WINDOWINFO*         windows;
     HICON                       hIcon;
+
+    LPSTR                       help_on_file;
 } HLPFILE;
 
 /*
diff --git a/programs/winhlp32/macro.c b/programs/winhlp32/macro.c
index 06aa2d7..a2f50c4 100644
--- a/programs/winhlp32/macro.c
+++ b/programs/winhlp32/macro.c
@@ -2,7 +2,7 @@
  * Help Viewer
  *
  * Copyright 1996 Ulrich Schmid
- * Copyright 2002 Eric Pouech
+ * Copyright 2002-2008 Eric Pouech
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -555,8 +555,14 @@ void CALLBACK MACRO_GotoMark(LPCSTR str)
 
 void CALLBACK MACRO_HelpOn(void)
 {
+    LPCSTR      file;
+
     WINE_TRACE("()\n");
-    MACRO_JumpContents((Globals.wVersion > 4) ? "winhelp32.hlp" : "winhelp.hlp", NULL);
+    file = Globals.active_win->page->file->help_on_file;
+    if (!file)
+        file = (Globals.wVersion > 4) ? "winhlp32.hlp" : "winhelp.hlp";
+
+    MACRO_JumpContents(file, NULL);
 }
 
 void CALLBACK MACRO_HelpOnTop(void)
@@ -890,7 +896,12 @@ void CALLBACK MACRO_SetContents(LPCSTR str, LONG u)
 
 void CALLBACK MACRO_SetHelpOnFile(LPCSTR str)
 {
-    WINE_FIXME("(\"%s\")\n", str);
+    WINE_TRACE("(\"%s\")\n", str);
+
+    HeapFree(GetProcessHeap(), 0, Globals.active_win->page->file->help_on_file);
+    Globals.active_win->page->file->help_on_file = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1);
+    if (Globals.active_win->page->file->help_on_file)
+        strcpy(Globals.active_win->page->file->help_on_file, str);
 }
 
 void CALLBACK MACRO_SetPopupColor(LONG u1, LONG u2, LONG u3)





More information about the wine-patches mailing list