[PATCH 1/9] [WinHelp]: added as an option, to use richedit to render the text window

Eric Pouech eric.pouech at orange.fr
Wed Apr 23 14:37:44 CDT 2008




A+
---

 programs/winhelp/Bg.rc         |    1 +
 programs/winhelp/Cs.rc         |    1 +
 programs/winhelp/Da.rc         |    1 +
 programs/winhelp/De.rc         |    1 +
 programs/winhelp/En.rc         |    1 +
 programs/winhelp/Eo.rc         |    1 +
 programs/winhelp/Es.rc         |    1 +
 programs/winhelp/Fi.rc         |    1 +
 programs/winhelp/Fr.rc         |    1 +
 programs/winhelp/Hu.rc         |    1 +
 programs/winhelp/It.rc         |    1 +
 programs/winhelp/Ko.rc         |    1 +
 programs/winhelp/Nl.rc         |    1 +
 programs/winhelp/No.rc         |    1 +
 programs/winhelp/Pl.rc         |    1 +
 programs/winhelp/Pt.rc         |    2 ++
 programs/winhelp/Rm.rc         |    1 +
 programs/winhelp/Ru.rc         |    1 +
 programs/winhelp/Si.rc         |    1 +
 programs/winhelp/Sk.rc         |    1 +
 programs/winhelp/Sv.rc         |    1 +
 programs/winhelp/Tr.rc         |    1 +
 programs/winhelp/Wa.rc         |    1 +
 programs/winhelp/Zh.rc         |    1 +
 programs/winhelp/winhelp.c     |   17 +++++++++++++++--
 programs/winhelp/winhelp_res.h |    1 +
 26 files changed, 41 insertions(+), 2 deletions(-)


diff --git a/programs/winhelp/Bg.rc b/programs/winhelp/Bg.rc
index d04a9d0..c2d47e1 100644
--- a/programs/winhelp/Bg.rc
+++ b/programs/winhelp/Bg.rc
@@ -66,4 +66,5 @@ STID_TOPICS,		"&Òåìè"
 STID_ALL_FILES, 	"Âñè÷êè ôàéëîâå (*.*)"
 STID_HELP_FILES_HLP, 	"Ïîìîùíè ôàéëîâå (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Cs.rc b/programs/winhelp/Cs.rc
index 06c2e17..a3ca708 100644
--- a/programs/winhelp/Cs.rc
+++ b/programs/winhelp/Cs.rc
@@ -71,4 +71,5 @@ STID_TOPICS,		"&Témata"
 STID_ALL_FILES, 	"Všechny soubory (*.*)"
 STID_HELP_FILES_HLP, 	"Soubory nápovìdy (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Da.rc b/programs/winhelp/Da.rc
index 522cdae..7f713a6 100644
--- a/programs/winhelp/Da.rc
+++ b/programs/winhelp/Da.rc
@@ -69,4 +69,5 @@ STID_TOPICS, 		"To&pics"
 STID_ALL_FILES, 	"Alle filer (*.*)"
 STID_HELP_FILES_HLP, 	"Hjælpe filer (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/De.rc b/programs/winhelp/De.rc
index 783226d..b9cdece 100644
--- a/programs/winhelp/De.rc
+++ b/programs/winhelp/De.rc
@@ -78,4 +78,5 @@ STID_TOPICS, 		"&Themen"
 STID_ALL_FILES, 	"Alle Dateien (*.*)"
 STID_HELP_FILES_HLP, 	"Hilfe-Dateien (*.hlp)"
 STID_FILE_NOT_FOUND_s	"'%s' konnte nicht gefunden werden. Wollen Sie selber nach dieser Datei suchen?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/En.rc b/programs/winhelp/En.rc
index 464b185..6dd6213 100644
--- a/programs/winhelp/En.rc
+++ b/programs/winhelp/En.rc
@@ -77,4 +77,5 @@ STID_TOPICS,		"&Topics"
 STID_ALL_FILES, 	"All files (*.*)"
 STID_HELP_FILES_HLP, 	"Help files (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Eo.rc b/programs/winhelp/Eo.rc
index cc8ef66..7fd946c 100644
--- a/programs/winhelp/Eo.rc
+++ b/programs/winhelp/Eo.rc
@@ -69,4 +69,5 @@ STID_TOPICS,		"&Temoj"
 STID_ALL_FILES, 	"Tutaj dosieroj (*.*)"
 STID_HELP_FILES_HLP, 	"Helpaj dosieroj (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Es.rc b/programs/winhelp/Es.rc
index 93d9223..7825c24 100644
--- a/programs/winhelp/Es.rc
+++ b/programs/winhelp/Es.rc
@@ -68,4 +68,5 @@ STID_TOPICS,		"&Temas"
 STID_ALL_FILES, 	"Todos los archivos (*.*)"
 STID_HELP_FILES_HLP, 	"Archivos de ayuda (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Fi.rc b/programs/winhelp/Fi.rc
index 90de636..cd5164c 100644
--- a/programs/winhelp/Fi.rc
+++ b/programs/winhelp/Fi.rc
@@ -69,4 +69,5 @@ STID_TOPICS,		"T&opics"
 STID_ALL_FILES, 	"Kaikki tiedostot (*.*)"
 STID_HELP_FILES_HLP, 	"Ohjetiedostot (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Fr.rc b/programs/winhelp/Fr.rc
index 200b1de..6696dcb 100644
--- a/programs/winhelp/Fr.rc
+++ b/programs/winhelp/Fr.rc
@@ -80,4 +80,5 @@ STID_TOPICS,		"&Sujets"
 STID_ALL_FILES, 	"Tous fichiers (*.*)"
 STID_HELP_FILES_HLP, 	"Fichiers d'aide (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Impossible de trouver « %s ». Souhaitez-vous rechercher ce fichier vous-même ?"
+STID_NO_RICHEDIT	"La bibliothèque RichEdit n'a pu être localisée... Abandon"
 }
diff --git a/programs/winhelp/Hu.rc b/programs/winhelp/Hu.rc
index 8f4ef53..e502e6e 100644
--- a/programs/winhelp/Hu.rc
+++ b/programs/winhelp/Hu.rc
@@ -69,4 +69,5 @@ STID_TOPICS,		"&Témakörök"
 STID_ALL_FILES, 	"Minden fájl (*.*)"
 STID_HELP_FILES_HLP, 	"Súgó fájlok (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/It.rc b/programs/winhelp/It.rc
index bce3f14..6d814e8 100644
--- a/programs/winhelp/It.rc
+++ b/programs/winhelp/It.rc
@@ -68,4 +68,5 @@ STID_TOPICS,		"&Argomenti"
 STID_ALL_FILES, 	"Tutti i file (*.*)"
 STID_HELP_FILES_HLP, 	"File della Guida (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Ko.rc b/programs/winhelp/Ko.rc
index 491d3ed..a2cbfdf 100644
--- a/programs/winhelp/Ko.rc
+++ b/programs/winhelp/Ko.rc
@@ -80,4 +80,5 @@ STID_TOPICS,		"¸ñÂ÷(&T)"
 STID_ALL_FILES, 	"¸ðµç ÆÄÀÏ (*.*)"
 STID_HELP_FILES_HLP, 	"µµ¿ò¸» ÆÄÀÏ (*.hlp)"
 STID_FILE_NOT_FOUND_s	"%sÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù'. ÀÌ ÆÄÀÏÀ» Á÷Á¢ ã°Ú½À´Ï±î?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Nl.rc b/programs/winhelp/Nl.rc
index b17e067..8890a8e 100644
--- a/programs/winhelp/Nl.rc
+++ b/programs/winhelp/Nl.rc
@@ -77,4 +77,5 @@ STID_TOPICS,		"&Onderwerpen"
 STID_ALL_FILES, 	"Alle bestanden (*.*)"
 STID_HELP_FILES_HLP, 	"Helpbestanden (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Kan '%s' niet openen. Wilt u zelf dit bestand zoeken?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/No.rc b/programs/winhelp/No.rc
index 9f60725..57cea9c 100644
--- a/programs/winhelp/No.rc
+++ b/programs/winhelp/No.rc
@@ -76,4 +76,5 @@ STID_TOPICS,		"&Emner"
 STID_ALL_FILES, 	"Alle filer (*.*)"
 STID_HELP_FILES_HLP, 	"Hjelp-filer (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Pl.rc b/programs/winhelp/Pl.rc
index bc74dc2..f1004a5 100644
--- a/programs/winhelp/Pl.rc
+++ b/programs/winhelp/Pl.rc
@@ -78,4 +78,5 @@ STID_TOPICS,		"&Tematy"
 STID_ALL_FILES, 	"Wszystkie pliki (*.*)"
 STID_HELP_FILES_HLP, 	"Pliki pomocy (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Pt.rc b/programs/winhelp/Pt.rc
index 52c8a01..114d502 100644
--- a/programs/winhelp/Pt.rc
+++ b/programs/winhelp/Pt.rc
@@ -107,6 +107,7 @@ STID_TOPICS,		"&Tópicos"
 STID_ALL_FILES, 	"Todos os arquivos (*.*)"
 STID_HELP_FILES_HLP, 	"Arquivos de ajuda (*.hlp)"
 STID_FILE_NOT_FOUND_s   "Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
 
 LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
@@ -127,4 +128,5 @@ STID_TOPICS,		"&Tópicos"
 STID_ALL_FILES, 	"Todos os ficheiros (*.*)"
 STID_HELP_FILES_HLP, 	"Ficheiros de ajuda (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Não é possível encontrar '%s'. Deseja procurar este ficheiro você mesmo?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Rm.rc b/programs/winhelp/Rm.rc
index ebbb154..1694094 100644
--- a/programs/winhelp/Rm.rc
+++ b/programs/winhelp/Rm.rc
@@ -71,4 +71,5 @@ STID_TOPICS,            "T&opics"
 STID_ALL_FILES,         "Tuot las datotecas (*.*)"
 STID_HELP_FILES_HLP,    "Datotecas d'ag�d (*.hlp)"
 STID_FILE_NOT_FOUND_s   "Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Ru.rc b/programs/winhelp/Ru.rc
index 4767d06..8f885c7 100644
--- a/programs/winhelp/Ru.rc
+++ b/programs/winhelp/Ru.rc
@@ -76,4 +76,5 @@ STID_TOPICS,		"&Óêàçàòåëü"
 STID_ALL_FILES, 	"Âñå ôàéëû (*.*)"
 STID_HELP_FILES_HLP, 	"Ôàéëû ñïðàâêè (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Íå ìîãó íàéòè '%s'. Âû õîòèòå íàéòè ýòîò ôàéë ñàìîñòîÿòåëüíî?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Si.rc b/programs/winhelp/Si.rc
index 245979e..1975d97 100644
--- a/programs/winhelp/Si.rc
+++ b/programs/winhelp/Si.rc
@@ -78,6 +78,7 @@ STID_TOPICS,		"&Vsebina"
 STID_ALL_FILES, 	"Vse datoteke (*.*)"
 STID_HELP_FILES_HLP, 	"Datoteke s pomočjo (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Ne najdem datoteke '%s'. Ali jo želite poiskati sami?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
 
 #pragma code_page(default)
diff --git a/programs/winhelp/Sk.rc b/programs/winhelp/Sk.rc
index c8e713f..e8da9d0 100644
--- a/programs/winhelp/Sk.rc
+++ b/programs/winhelp/Sk.rc
@@ -63,4 +63,5 @@ STID_TOPICS,		    "&Topics"
 STID_ALL_FILES,             "Všetky súbory (*.*)"
 STID_HELP_FILES_HLP,        "Súbory pomoci (*.hlp)"
 STID_FILE_NOT_FOUND_s       "Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	    "Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Sv.rc b/programs/winhelp/Sv.rc
index 37d5a32..a3f17e9 100644
--- a/programs/winhelp/Sv.rc
+++ b/programs/winhelp/Sv.rc
@@ -69,4 +69,5 @@ STID_TOPICS,		"&Ämnen"
 STID_ALL_FILES, 	"Alla filer (*.*)"
 STID_HELP_FILES_HLP, 	"Hjälpfiler (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Kan inte hitta '%s'. Vill du söka efter denna fil?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Tr.rc b/programs/winhelp/Tr.rc
index 9578e8b..9aa45f8 100644
--- a/programs/winhelp/Tr.rc
+++ b/programs/winhelp/Tr.rc
@@ -66,4 +66,5 @@ STID_TOPICS,		"&Konular"
 STID_ALL_FILES, 	"Tüm dosyalar (*.*)"
 STID_HELP_FILES_HLP, 	"Yardým dosyalarý (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/Wa.rc b/programs/winhelp/Wa.rc
index c536d2a..23e47cc 100644
--- a/programs/winhelp/Wa.rc
+++ b/programs/winhelp/Wa.rc
@@ -71,6 +71,7 @@ STID_TOPICS,		"&Topics"
 STID_ALL_FILES, 	"Tos les fitchîs (*.*)"
 STID_HELP_FILES_HLP, 	"Fitchîs d' aide (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
 
 #endif  /* LANG_WALON */
diff --git a/programs/winhelp/Zh.rc b/programs/winhelp/Zh.rc
index 8c0689b..dad37df 100644
--- a/programs/winhelp/Zh.rc
+++ b/programs/winhelp/Zh.rc
@@ -67,4 +67,5 @@ STID_TOPICS,		"Ö÷Ì⣨&T£©"
 STID_ALL_FILES, 	"ËùÓÐÎļþ (*.*)"
 STID_HELP_FILES_HLP, 	"°ïÖúÎļþ (*.hlp)"
 STID_FILE_NOT_FOUND_s	"Cannot find '%s'. Do you want to find this file yourself?"
+STID_NO_RICHEDIT	"Cannot find a richedit implementation... Aborting"
 }
diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c
index 4a50c32..12ab516 100644
--- a/programs/winhelp/winhelp.c
+++ b/programs/winhelp/winhelp.c
@@ -35,6 +35,7 @@
 #include "winhelp.h"
 #include "winhelp_res.h"
 #include "shellapi.h"
+#include "richedit.h"
 
 #include "wine/debug.h"
 
@@ -58,6 +59,8 @@ static WINHELP_LINE_PART* WINHELP_IsOverLink(WINHELP_WINDOW*, WPARAM, LPARAM);
 
 WINHELP_GLOBALS Globals = {3, NULL, TRUE, NULL, NULL, NULL, NULL, NULL, {{{NULL,NULL}},0}};
 
+static BOOL use_richedit;
+
 #define CTL_ID_BUTTON   0x700
 #define CTL_ID_TEXT     0x701
 
@@ -246,6 +249,11 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
 
     Globals.hInstance = hInstance;
 
+    use_richedit = getenv("WINHELP_RICHEDIT") != NULL;
+    if (use_richedit && LoadLibrary("riched20.dll") == NULL)
+        return MessageBox(0, MAKEINTRESOURCE(STID_NO_RICHEDIT),
+                          MAKEINTRESOURCE(STID_WHERROR), MB_OK);
+
     /* Get options */
     while (*cmdline && (*cmdline == ' ' || *cmdline == '-'))
     {
@@ -643,8 +651,13 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe
             CreateWindow(BUTTON_BOX_WIN_CLASS_NAME, "", WS_CHILD | WS_VISIBLE,
                          0, 0, 0, 0, win->hMainWnd, (HMENU)CTL_ID_BUTTON, Globals.hInstance, NULL);
 
-        CreateWindow(TEXT_WIN_CLASS_NAME, "", WS_CHILD | WS_VISIBLE,
-                     0, 0, 0, 0, win->hMainWnd, (HMENU)CTL_ID_TEXT, Globals.hInstance, win);
+        if (!use_richedit)
+            CreateWindow(TEXT_WIN_CLASS_NAME, "", WS_CHILD | WS_VISIBLE,
+                         0, 0, 0, 0, win->hMainWnd, (HMENU)CTL_ID_TEXT, Globals.hInstance, win);
+        else
+            CreateWindow(RICHEDIT_CLASS, NULL,
+                         ES_MULTILINE | ES_READONLY | WS_CHILD | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE,
+                         0, 0, 0, 0, win->hMainWnd, (HMENU)CTL_ID_TEXT, Globals.hInstance, NULL);
     }
 
     hIcon = (wpage->page) ? wpage->page->file->hIcon : NULL;
diff --git a/programs/winhelp/winhelp_res.h b/programs/winhelp/winhelp_res.h
index d58de61..89c3c4c 100644
--- a/programs/winhelp/winhelp_res.h
+++ b/programs/winhelp/winhelp_res.h
@@ -30,6 +30,7 @@
 #define STID_HELP_FILES_HLP	0x12C
 #define STID_DIALOG_TEST	0x12D
 #define STID_FILE_NOT_FOUND_s	0x12E
+#define STID_NO_RICHEDIT        0x12F
 
 #define IDD_INDEX               0x150
 #define IDC_INDEXLIST           0x151





More information about the wine-patches mailing list