comctl32: Test and fix WM_GETTEXTLENGTH for statusbars (try 2)

André Hentschel nerv at dawncrow.de
Fri Jan 20 12:33:10 CST 2012


---
 dlls/comctl32/status.c       |    2 +-
 dlls/comctl32/tests/status.c |   18 +++++++++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c
index 43b65aa..19d671d 100644
--- a/dlls/comctl32/status.c
+++ b/dlls/comctl32/status.c
@@ -1284,7 +1284,7 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
             return STATUSBAR_WMGetText (infoPtr, (INT)wParam, (LPWSTR)lParam);
 
 	case WM_GETTEXTLENGTH:
-	    return STATUSBAR_GetTextLength (infoPtr, 0);
+	    return LOWORD(STATUSBAR_GetTextLength (infoPtr, 0));
 
 	case WM_LBUTTONDBLCLK:
             return STATUSBAR_SendMouseNotify(infoPtr, NM_DBLCLK, msg, wParam, lParam);
diff --git a/dlls/comctl32/tests/status.c b/dlls/comctl32/tests/status.c
index 6e5a3e7..d8b3dbe 100644
--- a/dlls/comctl32/tests/status.c
+++ b/dlls/comctl32/tests/status.c
@@ -267,11 +267,11 @@ static void test_status_control(void)
     /* Divide into parts and set text */
     r = SendMessage(hWndStatus, SB_SETPARTS, 3, (LPARAM)nParts);
     expect(TRUE,r);
-    r = SendMessage(hWndStatus, SB_SETTEXT, 0, (LPARAM)"First");
+    r = SendMessage(hWndStatus, SB_SETTEXT, SBT_POPOUT|0,    (LPARAM)"First");
     expect(TRUE,r);
-    r = SendMessage(hWndStatus, SB_SETTEXT, 1, (LPARAM)"Second");
+    r = SendMessage(hWndStatus, SB_SETTEXT, SBT_OWNERDRAW|1, (LPARAM)"Second");
     expect(TRUE,r);
-    r = SendMessage(hWndStatus, SB_SETTEXT, 2, (LPARAM)"Third");
+    r = SendMessage(hWndStatus, SB_SETTEXT, SBT_NOBORDERS|2, (LPARAM)"Third");
     expect(TRUE,r);
 
     /* Get RECT Information */
@@ -287,13 +287,21 @@ static void test_status_control(void)
     r = SendMessage(hWndStatus, SB_GETRECT, 3, (LPARAM)&rc);
     expect(FALSE,r);
     /* Get text length and text */
+    r = SendMessage(hWndStatus, SB_GETTEXTLENGTH, 0, 0);
+    expect(5,LOWORD(r));
+    expect(SBT_POPOUT,HIWORD(r));
+    r = SendMessageW(hWndStatus, WM_GETTEXTLENGTH, 0, 0);
+    ok(r == 5 || broken(0x02000005 /* NT4 */), "Expected 5, got %d\n", r);
+    r = SendMessage(hWndStatus, SB_GETTEXTLENGTH, 1, 0);
+    expect(0,LOWORD(r));
+    expect(SBT_OWNERDRAW,HIWORD(r));
     r = SendMessage(hWndStatus, SB_GETTEXTLENGTH, 2, 0);
     expect(5,LOWORD(r));
-    expect(0,HIWORD(r));
+    expect(SBT_NOBORDERS,HIWORD(r));
     r = SendMessage(hWndStatus, SB_GETTEXT, 2, (LPARAM) charArray);
     ok(strcmp(charArray,"Third") == 0, "Expected Third, got %s\n", charArray);
     expect(5,LOWORD(r));
-    expect(0,HIWORD(r));
+    expect(SBT_NOBORDERS,HIWORD(r));
 
     /* Get parts and borders */
     r = SendMessage(hWndStatus, SB_GETPARTS, 3, (LPARAM)checkParts);
-- 

Best Regards, André Hentschel
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Nachrichtenteil als Anhang
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20120120/c3683fe1/attachment.ksh>


More information about the wine-patches mailing list