[PATCH 3/5] shell32/ebrowser: Implement EBO_NOBORDER option
Nikolay Sivov
nsivov at codeweavers.com
Sun Aug 2 15:53:03 CDT 2015
---
-------------- next part --------------
>From c14ee75ab35adb9df24a064baad579a8a1ea938a Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sun, 2 Aug 2015 10:07:21 +0300
Subject: [PATCH 3/5] shell32/ebrowser: Implement EBO_NOBORDER option
---
dlls/shell32/ebrowser.c | 6 ++++--
dlls/shell32/tests/ebrowser.c | 28 ++++++++++++++++++++++++++--
include/shobjidl.idl | 4 +++-
3 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/dlls/shell32/ebrowser.c b/dlls/shell32/ebrowser.c
index d50a4fc..0cee30f 100644
--- a/dlls/shell32/ebrowser.c
+++ b/dlls/shell32/ebrowser.c
@@ -876,7 +876,9 @@ static HRESULT WINAPI IExplorerBrowser_fnInitialize(IExplorerBrowser *iface,
if (!RegisterClassW(&wc)) return E_FAIL;
}
- style = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_BORDER;
+ style = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;
+ if (!(This->eb_options & EBO_NOBORDER))
+ style |= WS_BORDER;
This->hwnd_main = CreateWindowExW(WS_EX_CONTROLPARENT, EB_CLASS_NAME, NULL, style,
prc->left, prc->top,
prc->right - prc->left, prc->bottom - prc->top,
@@ -1030,7 +1032,7 @@ static HRESULT WINAPI IExplorerBrowser_fnSetOptions(IExplorerBrowser *iface,
{
ExplorerBrowserImpl *This = impl_from_IExplorerBrowser(iface);
static const EXPLORER_BROWSER_OPTIONS unsupported_options =
- EBO_ALWAYSNAVIGATE | EBO_NOWRAPPERWINDOW | EBO_HTMLSHAREPOINTVIEW;
+ EBO_ALWAYSNAVIGATE | EBO_NOWRAPPERWINDOW | EBO_HTMLSHAREPOINTVIEW | EBO_NOPERSISTVIEWSTATE;
TRACE("%p (0x%x)\n", This, dwFlag);
diff --git a/dlls/shell32/tests/ebrowser.c b/dlls/shell32/tests/ebrowser.c
index c9d81a4..7a01d56 100644
--- a/dlls/shell32/tests/ebrowser.c
+++ b/dlls/shell32/tests/ebrowser.c
@@ -759,8 +759,10 @@ static void test_initialization(void)
{
IExplorerBrowser *peb;
IShellBrowser *psb;
+ HWND eb_hwnd;
HRESULT hr;
ULONG lres;
+ LONG style;
RECT rc;
ebrowser_instantiate(&peb);
@@ -807,10 +809,9 @@ static void test_initialization(void)
ok(hr == S_OK, "Got 0x%08x\n", hr);
if(SUCCEEDED(hr))
{
- HWND eb_hwnd;
RECT eb_rc;
char buf[1024];
- LONG style, expected_style;
+ LONG expected_style;
static const RECT exp_rc = {0, 0, 48, 58};
hr = IShellBrowser_GetWindow(psb, &eb_hwnd);
@@ -856,6 +857,29 @@ static void test_initialization(void)
ok(lres == 0, "Got refcount %d\n", lres);
}
+ /* check window style with EBO_NOBORDER */
+ ebrowser_instantiate(&peb);
+ hr = IExplorerBrowser_SetOptions(peb, EBO_NOBORDER);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ rc.left = 50; rc.top = 20; rc.right = 100; rc.bottom = 80;
+
+ hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL);
+ ok(hr == S_OK, "got (0x%08x)\n", hr);
+
+ hr = IExplorerBrowser_QueryInterface(peb, &IID_IShellBrowser, (void**)&psb);
+ ok(hr == S_OK, "Got 0x%08x\n", hr);
+
+ hr = IShellBrowser_GetWindow(psb, &eb_hwnd);
+ ok(hr == S_OK, "Got 0x%08x\n", hr);
+
+ style = GetWindowLongPtrW(eb_hwnd, GWL_STYLE);
+ ok(!(style & WS_BORDER) || broken(style & WS_BORDER) /* before win8 */, "got style 0x%08x\n", style);
+
+ IShellBrowser_Release(psb);
+ IExplorerBrowser_Destroy(peb);
+ IExplorerBrowser_Release(peb);
+
+ /* empty rectangle */
ebrowser_instantiate(&peb);
rc.left = 0; rc.top = 0; rc.right = 0; rc.bottom = 0;
hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL);
diff --git a/include/shobjidl.idl b/include/shobjidl.idl
index 455045d..b021178 100644
--- a/include/shobjidl.idl
+++ b/include/shobjidl.idl
@@ -2258,7 +2258,9 @@ typedef [v1_enum] enum tagEXPLORER_BROWSER_OPTIONS {
EBO_ALWAYSNAVIGATE = 0x04,
EBO_NOTRAVELLOG = 0x08,
EBO_NOWRAPPERWINDOW = 0x10,
- EBO_HTMLSHAREPOINTVIEW = 0x20
+ EBO_HTMLSHAREPOINTVIEW = 0x20,
+ EBO_NOBORDER = 0x40,
+ EBO_NOPERSISTVIEWSTATE = 0x80,
} EXPLORER_BROWSER_OPTIONS;
cpp_quote("#define SID_SExplorerBrowserFrame IID_ICommDlgBrowser")
--
2.1.4
More information about the wine-patches
mailing list