[Wine-patches] [eterhack] hhctrl.ocx: Open chm files in linux viewers with hack for Consultant (eterbug #7648)
Konstantin Kondratyuk
kondratyuk на etersoft.ru
Чт Сен 15 10:29:07 MSD 2011
--
Best regards,
Konstantin Kondratyuk.
----------- следующая часть -----------
Вложение в формате HTML было удалено...
URL: <http://lists.etersoft.ru/pipermail/wine-patches/attachments/20110915/11fda126/attachment.html>
----------- следующая часть -----------
From 32831ac307ea574c4a6f6634589a01603b50284f Mon Sep 17 00:00:00 2001
From: Konstantin Kondratyuk <kondratyuk на etersoft.ru>
Date: Thu, 15 Sep 2011 10:15:56 +0400
Subject: [PATCH] hhctrl.ocx: Open chm files in linux viewers with hack for
Consultant (eterbug #7648)
---
dlls/hhctrl.ocx/Makefile.in | 2 +-
dlls/hhctrl.ocx/help.c | 20 ++++++++++++++++++++
dlls/hhctrl.ocx/hhctrl.c | 4 ++++
3 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/dlls/hhctrl.ocx/Makefile.in b/dlls/hhctrl.ocx/Makefile.in
index 05b3e35..d82bf79 100644
--- a/dlls/hhctrl.ocx/Makefile.in
+++ b/dlls/hhctrl.ocx/Makefile.in
@@ -1,5 +1,5 @@
MODULE = hhctrl.ocx
-IMPORTS = uuid advapi32 comctl32 shlwapi ole32 oleaut32 user32 gdi32
+IMPORTS = uuid advapi32 comctl32 shlwapi ole32 oleaut32 user32 gdi32 shell32
C_SRCS = \
chm.c \
diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c
index 7bde256..8c6eacf 100644
--- a/dlls/hhctrl.ocx/help.c
+++ b/dlls/hhctrl.ocx/help.c
@@ -70,9 +70,29 @@ static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
{
VARIANT url;
HRESULT hres;
+ LPWSTR strlower, sublower;
+ static const WCHAR cons_path[] = {'C','O','N','S','.','C','H','M',0};
TRACE("%s\n", debugstr_w(surl));
+ /* eterhack for bug 7648 - kill help window for Consultant */
+ strlower = CharLowerW(strdupW( surl ));
+ sublower = CharLowerW(strdupW(cons_path));
+
+ if(strstrW(strlower, sublower))
+ {
+ HWND hwnd;
+ hwnd = FindWindowA("HH Parent", NULL);
+ if(hwnd)
+ {
+ FIXME("Kill HtmlHelp window: %p\n", hwnd);
+ CloseWindow(hwnd);
+ }
+ }
+ GlobalFree(strlower);
+ GlobalFree(sublower);
+ /* end of hack */
+
V_VT(&url) = VT_BSTR;
V_BSTR(&url) = SysAllocString(surl);
diff --git a/dlls/hhctrl.ocx/hhctrl.c b/dlls/hhctrl.ocx/hhctrl.c
index 1098a2e..c14afb0 100644
--- a/dlls/hhctrl.ocx/hhctrl.c
+++ b/dlls/hhctrl.ocx/hhctrl.c
@@ -35,6 +35,7 @@
#define INIT_GUID
#include "hhctrl.h"
+#include "shellapi.h"
WINE_DEFAULT_DEBUG_CHANNEL(htmlhelp);
@@ -175,6 +176,9 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
return 0;
}
+ /* Eterhack for bug 7648 */
+ ShellExecuteW(caller, NULL, filename, NULL, NULL, SW_SHOWDEFAULT);
+
info = CreateHelpViewer(fullname);
if(!info)
return NULL;
--
1.7.6.1
Подробная информация о списке рассылки Wine-patches