shell32/ebrowser: Implement EBO_NOBORDER option.

This commit is contained in:
Nikolay Sivov 2015-08-02 23:53:03 +03:00 committed by Alexandre Julliard
parent 118c469598
commit e46c32ab46
3 changed files with 33 additions and 5 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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")