1 /* Unit test suite for status control.
3 * Copyright 2007 Google (Lei Zhang)
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #include "wine/test.h"
27 static HINSTANCE hinst;
29 static HWND create_status_control(DWORD style, DWORD exstyle)
33 /* make the control */
34 hWndStatus = CreateWindowEx(0, STATUSCLASSNAME, NULL, style,
38 NULL, NULL, hinst, NULL);
43 static void test_status_control(void)
47 int nParts[] = {50, 150, -1};
50 hWndStatus = create_status_control(0, 0);
51 r = SendMessage(hWndStatus, SB_SETPARTS, 3, (long)nParts);
52 ok(r == TRUE, "Expected TRUE, got %d\n", r);
53 r = SendMessage(hWndStatus, SB_SETTEXT, 0, (LPARAM)"First");
54 ok(r == TRUE, "Expected TRUE, got %d\n", r);
55 r = SendMessage(hWndStatus, SB_SETTEXT, 1, (LPARAM)"Second");
56 ok(r == TRUE, "Expected TRUE, got %d\n", r);
57 r = SendMessage(hWndStatus, SB_SETTEXT, 2, (LPARAM)"Third");
58 ok(r == TRUE, "Expected TRUE, got %d\n", r);
60 r = SendMessage(hWndStatus, SB_GETRECT, 0, (LPARAM)&rc);
61 ok(r == TRUE, "Expected TRUE, got %d\n", r);
62 ok(rc.top == 2, "Expected 2, got %d\n", rc.top);
63 ok(rc.bottom == 21, "Expected 21, got %d\n", rc.bottom);
64 ok(rc.left == 0, "Expected 0, got %d\n", rc.left);
65 ok(rc.right == 50, "Expected 50, got %d\n", rc.right);
67 r = SendMessage(hWndStatus, SB_GETRECT, -1, (LPARAM)&rc);
68 ok(r == FALSE, "Expected FALSE, got %d\n", r);
69 r = SendMessage(hWndStatus, SB_GETRECT, 5, (LPARAM)&rc);
70 ok(r == FALSE, "Expected FALSE, got %d\n", r);
72 DestroyWindow(hWndStatus);
77 hinst = GetModuleHandleA(NULL);
81 test_status_control();