Jacek Caban : mshtml: Added IHTMLScreen::get_availHeight implementation.

Alexandre Julliard julliard at winehq.org
Fri May 27 11:03:41 CDT 2011


Module: wine
Branch: master
Commit: aa93ed5e5b4564c11421d56a54115cb5447bb194
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=aa93ed5e5b4564c11421d56a54115cb5447bb194

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri May 27 14:36:54 2011 +0200

mshtml: Added IHTMLScreen::get_availHeight implementation.

---

 dlls/mshtml/htmlscreen.c |   11 +++++++++--
 dlls/mshtml/tests/dom.c  |    8 ++++++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmlscreen.c b/dlls/mshtml/htmlscreen.c
index 6661fbc..460347f 100644
--- a/dlls/mshtml/htmlscreen.c
+++ b/dlls/mshtml/htmlscreen.c
@@ -186,8 +186,15 @@ static HRESULT WINAPI HTMLScreen_get_updateInterval(IHTMLScreen *iface, LONG *p)
 static HRESULT WINAPI HTMLScreen_get_availHeight(IHTMLScreen *iface, LONG *p)
 {
     HTMLScreen *This = impl_from_IHTMLScreen(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    RECT work_area;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    if(!SystemParametersInfoW(SPI_GETWORKAREA, 0, &work_area, 0))
+        return E_FAIL;
+
+    *p = work_area.bottom-work_area.top;
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLScreen_get_availWidth(IHTMLScreen *iface, LONG *p)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 9c9c2f8..a11e9a4 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -3920,6 +3920,7 @@ static void test_screen(IHTMLWindow2 *window)
 {
     IHTMLScreen *screen, *screen2;
     IDispatchEx *dispex;
+    RECT work_area;
     LONG l, exl;
     HDC hdc;
     HRESULT hres;
@@ -3965,6 +3966,13 @@ static void test_screen(IHTMLWindow2 *window)
 
     DeleteObject(hdc);
 
+    SystemParametersInfoW(SPI_GETWORKAREA, 0, &work_area, 0);
+
+    l = 0xdeadbeef;
+    hres = IHTMLScreen_get_availHeight(screen, &l);
+    ok(hres == S_OK, "get_availHeight failed: %08x\n", hres);
+    ok(l == work_area.bottom-work_area.top, "availHeight = %d, expected %d\n", l, work_area.bottom-work_area.top);
+
     IHTMLScreen_Release(screen);
 }
 




More information about the wine-cvs mailing list