=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: comctl32: Test and fix WM_GETTEXTLENGTH for statusbars.

Alexandre Julliard julliard at winehq.org
Mon Jan 23 13:00:58 CST 2012


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

Author: André Hentschel <nerv at dawncrow.de>
Date:   Fri Jan 20 19:33:10 2012 +0100

comctl32: Test and fix WM_GETTEXTLENGTH for statusbars.

---

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




More information about the wine-cvs mailing list