[HHCTRL.OCX] Add help viewer window icon and default title (#4541)
authorThamatip Chitpong <tangaming123456@outlook.com>
Sun, 19 Jun 2022 19:22:28 +0000 (02:22 +0700)
committerGitHub <noreply@github.com>
Sun, 19 Jun 2022 19:22:28 +0000 (21:22 +0200)
32 files changed:
dll/win32/hhctrl.ocx/chm.c
dll/win32/hhctrl.ocx/help.c
dll/win32/hhctrl.ocx/hhctrl.h
dll/win32/hhctrl.ocx/hhctrl.rc
dll/win32/hhctrl.ocx/lang/Cs.rc
dll/win32/hhctrl.ocx/lang/Da.rc
dll/win32/hhctrl.ocx/lang/De.rc
dll/win32/hhctrl.ocx/lang/El.rc
dll/win32/hhctrl.ocx/lang/En.rc
dll/win32/hhctrl.ocx/lang/Es.rc
dll/win32/hhctrl.ocx/lang/Fi.rc
dll/win32/hhctrl.ocx/lang/Fr.rc
dll/win32/hhctrl.ocx/lang/He.rc
dll/win32/hhctrl.ocx/lang/Hu.rc
dll/win32/hhctrl.ocx/lang/It.rc
dll/win32/hhctrl.ocx/lang/Ja.rc
dll/win32/hhctrl.ocx/lang/Ko.rc
dll/win32/hhctrl.ocx/lang/Lt.rc
dll/win32/hhctrl.ocx/lang/Nl.rc
dll/win32/hhctrl.ocx/lang/No.rc
dll/win32/hhctrl.ocx/lang/Pl.rc
dll/win32/hhctrl.ocx/lang/Pt.rc
dll/win32/hhctrl.ocx/lang/Ro.rc
dll/win32/hhctrl.ocx/lang/Ru.rc
dll/win32/hhctrl.ocx/lang/Si.rc
dll/win32/hhctrl.ocx/lang/Sq.rc
dll/win32/hhctrl.ocx/lang/Sv.rc
dll/win32/hhctrl.ocx/lang/Tr.rc
dll/win32/hhctrl.ocx/lang/Uk.rc
dll/win32/hhctrl.ocx/lang/Zh.rc
dll/win32/hhctrl.ocx/res/hh.ico [new file with mode: 0644]
dll/win32/hhctrl.ocx/resource.h

index 07211f1..6336026 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "hhctrl.h"
 #include "stream.h"
+#include "resource.h"
 
 #include "winreg.h"
 #include "shlwapi.h"
@@ -459,7 +460,7 @@ BOOL LoadWinTypeFromCHM(HHInfo *info)
     /* merge the new data with any pre-existing HH_WINTYPE structure */
     MergeChmProperties(&wintype, info, FALSE);
     if (!info->WinType.pszCaption)
-        info->WinType.pszCaption = info->stringsW.pszCaption = strdupW(info->pCHMInfo->defTitle ? info->pCHMInfo->defTitle : empty);
+        info->WinType.pszCaption = info->stringsW.pszCaption = (info->pCHMInfo->defTitle ? strdupW(info->pCHMInfo->defTitle) : HH_LoadString(IDS_DEFTITLE));
     if (!info->WinType.pszFile)
         info->WinType.pszFile    = info->stringsW.pszFile    = strdupW(info->pCHMInfo->defTopic ? info->pCHMInfo->defTopic : empty);
     if (!info->WinType.pszToc)
index 06f7335..de9dc08 100644 (file)
@@ -171,7 +171,7 @@ static inline BOOL navigation_visible(HHInfo *info)
 }
 
 /* Loads a string from the resource file */
-static LPWSTR HH_LoadString(DWORD dwID)
+LPWSTR HH_LoadString(DWORD dwID)
 {
     LPWSTR string = NULL;
     LPCWSTR stringresource;
@@ -1620,12 +1620,12 @@ static BOOL HH_CreateHelpWindow(HHInfo *info)
     wcex.cbClsExtra     = 0;
     wcex.cbWndExtra     = sizeof(LONG_PTR);
     wcex.hInstance      = hhctrl_hinstance;
-    wcex.hIcon          = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION);
+    wcex.hIcon          = LoadIconW(hhctrl_hinstance, MAKEINTRESOURCEW(IDI_HHICON));
     wcex.hCursor        = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW);
     wcex.hbrBackground  = (HBRUSH)(COLOR_MENU + 1);
     wcex.lpszMenuName   = NULL;
     wcex.lpszClassName  = windowClassW;
-    wcex.hIconSm        = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION);
+    wcex.hIconSm        = NULL;
 
     RegisterClassExW(&wcex);
 
index a03d09f..f302815 100644 (file)
@@ -229,6 +229,7 @@ WCHAR *GetDocumentTitle(CHMInfo*,LPCWSTR) DECLSPEC_HIDDEN;
 extern struct list window_list DECLSPEC_HIDDEN;
 HHInfo *CreateHelpViewer(HHInfo*,LPCWSTR,HWND) DECLSPEC_HIDDEN;
 void ReleaseHelpViewer(HHInfo*) DECLSPEC_HIDDEN;
+LPWSTR HH_LoadString(DWORD dwID) DECLSPEC_HIDDEN;
 BOOL NavigateToUrl(HHInfo*,LPCWSTR) DECLSPEC_HIDDEN;
 BOOL NavigateToChm(HHInfo*,LPCWSTR,LPCWSTR) DECLSPEC_HIDDEN;
 void MergeChmProperties(HH_WINTYPEW*,HHInfo*,BOOL) DECLSPEC_HIDDEN;
index c270efa..f743a47 100644 (file)
@@ -114,6 +114,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 
 #include "wine/wine_common_ver.rc"
 
+/* help viewer window icon */
+IDI_HHICON ICON "res/hh.ico"
+
 /* @makedep: hhtoolbar.bmp */
 IDB_HHTOOLBAR BITMAP "res/hhtoolbar.bmp"
 
index 5d6bf54..ab0e3a0 100644 (file)
@@ -27,6 +27,8 @@ LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Obsah"
     IDS_INDEX        "I&ndex"
     IDS_SEARCH       "&Hledat"
index c775b34..a9a18b6 100644 (file)
@@ -23,6 +23,8 @@ LANGUAGE LANG_DANISH, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Indhold"
     IDS_INDEX        "I&ndeks"
     IDS_SEARCH       "&Søg"
index e24593d..a5e73a8 100644 (file)
@@ -25,6 +25,8 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Inhalt"
     IDS_INDEX        "I&ndex"
     IDS_SEARCH       "&Suche"
index 08a441a..ea2dba6 100644 (file)
@@ -23,6 +23,8 @@ LANGUAGE LANG_GREEK, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Περιεχόμενα"
     IDS_INDEX        "I&ndex"
     IDS_SEARCH       "&Αναζήτηση"
index bad46bd..9be92a1 100644 (file)
@@ -24,6 +24,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Contents"
     IDS_INDEX        "I&ndex"
     IDS_SEARCH       "&Search"
index 5d1417a..d0f52c2 100644 (file)
@@ -26,6 +26,8 @@ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Contenido"
     IDS_INDEX        "Í&ndice"
     IDS_SEARCH       "&Buscar"
index 606406b..0162704 100644 (file)
@@ -23,6 +23,8 @@ LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Sisällys"
     IDS_INDEX        "&Hakemisto"
     IDS_SEARCH       "&Etsi"
index e6f3f98..a564492 100644 (file)
@@ -26,6 +26,8 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "Aide HTML"
+
     IDS_CONTENTS     "Somm&aire"
     IDS_INDEX        "I&ndex"
     IDS_SEARCH       "&Recherche"
index 4a537c5..f5a3c16 100644 (file)
@@ -25,6 +25,8 @@ LANGUAGE LANG_HEBREW, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "תוכ&ן"
     IDS_INDEX        "&אינקס"
     IDS_SEARCH       "&חפש"
index 3d3a613..cbb8374 100644 (file)
@@ -23,6 +23,8 @@ LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Tartalom"
     IDS_INDEX        "I&ndex"
     IDS_SEARCH       "&Keresés"
index 5db3638..a952294 100644 (file)
@@ -27,6 +27,8 @@ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Contenuti"
     IDS_INDEX        "&Indice"
     IDS_SEARCH       "&Ricerca"
index 15bee5d..9cb0943 100644 (file)
@@ -27,6 +27,8 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "目次(&C)"
     IDS_INDEX        "索引(&N)"
     IDS_SEARCH       "検索(&S)"
index 976cb12..cdf568f 100644 (file)
@@ -24,6 +24,8 @@ LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "목록(&C)"
     IDS_INDEX        "인덱스(&N)"
     IDS_SEARCH       "찾기(&S)"
index a296a58..b672bf3 100644 (file)
@@ -26,6 +26,8 @@ LANGUAGE LANG_LITHUANIAN, SUBLANG_NEUTRAL
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Turinys"
     IDS_INDEX        "&Rodyklė"
     IDS_SEARCH       "&Paieška"
index c9ae349..a0b78cf 100644 (file)
@@ -23,6 +23,8 @@ LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Inhoud"
     IDS_INDEX        "I&ndex"
     IDS_SEARCH       "&Zoeken"
index 7530d27..f645af2 100644 (file)
@@ -23,6 +23,8 @@ LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Innhold"
     IDS_INDEX        "I&ndeks"
     IDS_SEARCH       "&Søk"
index 1737398..dc2dc2f 100644 (file)
@@ -24,6 +24,8 @@ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Spis treści"
     IDS_INDEX        "&Indeks"
     IDS_SEARCH       "&Wyszukaj"
index bedaac0..c0ef9c8 100644 (file)
@@ -26,6 +26,8 @@ LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Conteúdos"
     IDS_INDEX        "&Índice"
     IDS_SEARCH       "&Pesquisar"
index f7a7a58..e106ffe 100644 (file)
@@ -27,6 +27,8 @@ LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "C&uprins"
     IDS_INDEX        "In&dex"
     IDS_SEARCH       "&Caută"
index acee6af..8e8e514 100644 (file)
@@ -26,6 +26,8 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Содержание"
     IDS_INDEX        "&Оглавление"
     IDS_SEARCH       "&Поиск"
index a4959dd..3961f17 100644 (file)
@@ -25,6 +25,8 @@ LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Vsebina"
     IDS_INDEX        "I&ndeks"
     IDS_SEARCH       "&Iskanje"
index 1eacfe2..5fca78c 100644 (file)
@@ -26,6 +26,8 @@ LANGUAGE LANG_ALBANIAN, SUBLANG_NEUTRAL
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "Përmbajtja"
     IDS_INDEX        "I&ndex"
     IDS_SEARCH       "Kerko"
index 74f04bb..ccf488a 100644 (file)
@@ -23,6 +23,8 @@ LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Innehåll"
     IDS_INDEX        "I&ndex"
     IDS_SEARCH       "&Sök"
index f2e8570..c1b4e3e 100644 (file)
@@ -23,6 +23,8 @@ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&İçindekiler"
     IDS_INDEX        "&Dizin"
     IDS_SEARCH       "&Ara"
index 46414c4..0177869 100644 (file)
@@ -28,6 +28,8 @@ LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "&Зміст"
     IDS_INDEX        "&Вказівник"
     IDS_SEARCH       "&Пошук"
index 695ab1d..39036f9 100644 (file)
@@ -26,6 +26,8 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
 
 STRINGTABLE
 BEGIN
+    IDS_DEFTITLE     "HTML Help"
+
     IDS_CONTENTS     "内容(&C)"
     IDS_INDEX        "索引(&N)"
     IDS_SEARCH       "搜索(&S)"
diff --git a/dll/win32/hhctrl.ocx/res/hh.ico b/dll/win32/hhctrl.ocx/res/hh.ico
new file mode 100644 (file)
index 0000000..90e3a9e
Binary files /dev/null and b/dll/win32/hhctrl.ocx/res/hh.ico differ
index f2b4383..a47f3a4 100644 (file)
@@ -25,6 +25,9 @@
 #include <wingdi.h>
 #include <htmlhelp.h>
 
+#define IDI_HHICON      100
+
+#define IDS_DEFTITLE    0
 #define IDS_CONTENTS    1
 #define IDS_INDEX       2
 #define IDS_SEARCH      3