Commit f1d22c0e authored by Jactry Zeng's avatar Jactry Zeng Committed by Alexandre Julliard

riched20: Implement IOleWindow::GetWindow.

parent bbb97558
......@@ -363,8 +363,13 @@ static HRESULT WINAPI IOleWindow_fnContextSensitiveHelp(IOleWindow *iface, BOOL
static HRESULT WINAPI IOleWindow_fnGetWindow(IOleWindow *iface, HWND *phwnd)
{
IOleClientSiteImpl *This = impl_from_IOleWindow(iface);
FIXME("not implemented: (%p)->(%p)\n", This, phwnd);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, phwnd);
if (!phwnd)
return E_INVALIDARG;
*phwnd = This->reOle->editor->hWnd;
return S_OK;
}
static const IOleWindowVtbl olewinvt = {
......
......@@ -1000,6 +1000,34 @@ static void test_IOleClientSite_QueryInterface(void)
release_interfaces(&w, &reOle, &txtDoc, NULL);
}
static void test_IOleWindow_GetWindow(void)
{
HWND w;
IRichEditOle *reOle = NULL;
ITextDocument *txtDoc = NULL;
IOleClientSite *clientSite = NULL;
IOleWindow *oleWin = NULL;
HRESULT hres;
HWND hwnd;
create_interfaces(&w, &reOle, &txtDoc, NULL);
hres = IRichEditOle_GetClientSite(reOle, &clientSite);
ok(hres == S_OK, "IRichEditOle_QueryInterface: 0x%08x\n", hres);
hres = IOleClientSite_QueryInterface(clientSite, &IID_IOleWindow, (void **)&oleWin);
ok(hres == S_OK, "IOleClientSite_QueryInterface: 0x%08x\n", hres);
hres = IOleWindow_GetWindow(oleWin, &hwnd);
ok(hres == S_OK, "IOleClientSite_GetWindow: 0x%08x\n", hres);
ok(w == hwnd, "got wrong pointer\n");
hres = IOleWindow_GetWindow(oleWin, NULL);
ok(hres == E_INVALIDARG, "IOleClientSite_GetWindow: 0x%08x\n", hres);
IOleWindow_Release(oleWin);
IOleClientSite_Release(clientSite);
release_interfaces(&w, &reOle, &txtDoc, NULL);
}
START_TEST(richole)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
......@@ -1019,4 +1047,5 @@ START_TEST(richole)
test_ITextRange_GetDuplicate();
test_ITextRange_Collapse();
test_IOleClientSite_QueryInterface();
test_IOleWindow_GetWindow();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment