From 037d58c4f6e2e45cb76decd49972043aa8b9bda4 Mon Sep 17 00:00:00 2001 From: Erich Hoover Date: Fri, 14 Jan 2011 15:16:31 -0700 Subject: [PATCH] hhctrl.ocx: Add support for the print button using IWebBrowser_ExecWB. --- dlls/hhctrl.ocx/help.c | 4 +++- dlls/hhctrl.ocx/hhctrl.h | 1 + dlls/hhctrl.ocx/webbrowser.c | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c index 2ea01321043..31a7c1b4f5d 100644 --- a/dlls/hhctrl.ocx/help.c +++ b/dlls/hhctrl.ocx/help.c @@ -641,10 +641,12 @@ static void TB_OnClick(HWND hWnd, DWORD dwID) case IDTB_FORWARD: DoPageAction(info, WB_GOFORWARD); break; + case IDTB_PRINT: + DoPageAction(info, WB_PRINT); + break; case IDTB_EXPAND: case IDTB_CONTRACT: case IDTB_SYNC: - case IDTB_PRINT: case IDTB_OPTIONS: case IDTB_BROWSE_FWD: case IDTB_BROWSE_BACK: diff --git a/dlls/hhctrl.ocx/hhctrl.h b/dlls/hhctrl.ocx/hhctrl.h index 91d3a775ace..03a4807daf6 100644 --- a/dlls/hhctrl.ocx/hhctrl.h +++ b/dlls/hhctrl.ocx/hhctrl.h @@ -47,6 +47,7 @@ #define WB_SEARCH 3 #define WB_REFRESH 4 #define WB_STOP 5 +#define WB_PRINT 6 typedef struct { LPWSTR chm_file; diff --git a/dlls/hhctrl.ocx/webbrowser.c b/dlls/hhctrl.ocx/webbrowser.c index d90a1a570d3..90b405d332e 100644 --- a/dlls/hhctrl.ocx/webbrowser.c +++ b/dlls/hhctrl.ocx/webbrowser.c @@ -751,7 +751,12 @@ void DoPageAction(HHInfo *info, DWORD dwAction) break; case WB_REFRESH: IWebBrowser2_Refresh(pWebBrowser2); + break; case WB_STOP: IWebBrowser2_Stop(pWebBrowser2); + break; + case WB_PRINT: + IWebBrowser2_ExecWB(pWebBrowser2, OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0); + break; } }