riched20: Implement IOleWindow::GetWindow.
This commit is contained in:
parent
bbb9755896
commit
f1d22c0ebd
|
@ -363,8 +363,13 @@ static HRESULT WINAPI IOleWindow_fnContextSensitiveHelp(IOleWindow *iface, BOOL
|
||||||
static HRESULT WINAPI IOleWindow_fnGetWindow(IOleWindow *iface, HWND *phwnd)
|
static HRESULT WINAPI IOleWindow_fnGetWindow(IOleWindow *iface, HWND *phwnd)
|
||||||
{
|
{
|
||||||
IOleClientSiteImpl *This = impl_from_IOleWindow(iface);
|
IOleClientSiteImpl *This = impl_from_IOleWindow(iface);
|
||||||
FIXME("not implemented: (%p)->(%p)\n", This, phwnd);
|
TRACE("(%p)->(%p)\n", This, phwnd);
|
||||||
return E_NOTIMPL;
|
|
||||||
|
if (!phwnd)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
*phwnd = This->reOle->editor->hWnd;
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const IOleWindowVtbl olewinvt = {
|
static const IOleWindowVtbl olewinvt = {
|
||||||
|
|
|
@ -1000,6 +1000,34 @@ static void test_IOleClientSite_QueryInterface(void)
|
||||||
release_interfaces(&w, &reOle, &txtDoc, NULL);
|
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)
|
START_TEST(richole)
|
||||||
{
|
{
|
||||||
/* Must explicitly LoadLibrary(). The test has no references to functions in
|
/* Must explicitly LoadLibrary(). The test has no references to functions in
|
||||||
|
@ -1019,4 +1047,5 @@ START_TEST(richole)
|
||||||
test_ITextRange_GetDuplicate();
|
test_ITextRange_GetDuplicate();
|
||||||
test_ITextRange_Collapse();
|
test_ITextRange_Collapse();
|
||||||
test_IOleClientSite_QueryInterface();
|
test_IOleClientSite_QueryInterface();
|
||||||
|
test_IOleWindow_GetWindow();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue