~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/comctl32/tests/status.c

Version: ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /* Unit test suite for status control.
  2  *
  3  * Copyright 2007 Google (Lei Zhang)
  4  * Copyright 2007 Alex Arazi
  5  *
  6  * This library is free software; you can redistribute it and/or
  7  * modify it under the terms of the GNU Lesser General Public
  8  * License as published by the Free Software Foundation; either
  9  * version 2.1 of the License, or (at your option) any later version.
 10  *
 11  * This library is distributed in the hope that it will be useful,
 12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14  * Lesser General Public License for more details.
 15  *
 16  * You should have received a copy of the GNU Lesser General Public
 17  * License along with this library; if not, write to the Free Software
 18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 19  */
 20 
 21 #include <assert.h>
 22 #include <windows.h>
 23 #include <commctrl.h>
 24 
 25 #include "wine/test.h"
 26 
 27 #define SUBCLASS_NAME "MyStatusBar"
 28 
 29 #define expect(expected,got) ok (expected == got,"Expected %d, got %d\n",expected,got)
 30 #define expect_rect(_left,_top,_right,_bottom,got) do { \
 31         RECT exp = {abs(got.left - _left), abs(got.top - _top), \
 32                     abs(got.right - _right), abs(got.bottom - _bottom)}; \
 33         ok(exp.left <= 2 && exp.top <= 2 && exp.right <= 2 && exp.bottom <= 2, \
 34            "Expected rect {%d,%d, %d,%d}, got {%d,%d, %d,%d}\n", \
 35            _left, _top, _right, _bottom, \
 36            (got).left, (got).top, (got).right, (got).bottom); } while (0)
 37 
 38 static HINSTANCE hinst;
 39 static WNDPROC g_status_wndproc;
 40 static RECT g_rcCreated;
 41 static HWND g_hMainWnd;
 42 static int g_wmsize_count = 0;
 43 static DWORD g_ysize;
 44 static DWORD g_dpisize;
 45 static int g_wmdrawitm_ctr;
 46 static WNDPROC g_wndproc_saved;
 47 
 48 static HWND create_status_control(DWORD style, DWORD exstyle)
 49 {
 50     HWND hWndStatus;
 51 
 52     /* make the control */
 53     hWndStatus = CreateWindowEx(exstyle, STATUSCLASSNAME, NULL, style,
 54         /* placement */
 55         0, 0, 300, 20,
 56         /* parent, etc */
 57         NULL, NULL, hinst, NULL);
 58     assert (hWndStatus);
 59     return hWndStatus;
 60 }
 61 
 62 static LRESULT WINAPI create_test_wndproc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 63 {
 64     LRESULT ret;
 65 
 66     if (msg == WM_CREATE)
 67     {
 68         CREATESTRUCT *cs = (CREATESTRUCT *)lParam;
 69         ret = CallWindowProc(g_status_wndproc, hwnd, msg, wParam, lParam);
 70         GetWindowRect(hwnd, &g_rcCreated);
 71         MapWindowPoints(HWND_DESKTOP, g_hMainWnd, (LPPOINT)&g_rcCreated, 2);
 72         ok(cs->x == g_rcCreated.left, "CREATESTRUCT.x modified\n");
 73         ok(cs->y == g_rcCreated.top, "CREATESTRUCT.y modified\n");
 74     } else if (msg == WM_SIZE)
 75     {
 76         g_wmsize_count++;
 77         ret = CallWindowProc(g_status_wndproc, hwnd, msg, wParam, lParam);
 78     }
 79     else
 80         ret = CallWindowProc(g_status_wndproc, hwnd, msg, wParam, lParam);
 81 
 82     return ret;
 83 }
 84 
 85 static void register_subclass(void)
 86 {
 87     WNDCLASSEX cls;
 88 
 89     cls.cbSize = sizeof(WNDCLASSEX);
 90     GetClassInfoEx(NULL, STATUSCLASSNAME, &cls);
 91     g_status_wndproc = cls.lpfnWndProc;
 92     cls.lpfnWndProc = create_test_wndproc;
 93     cls.lpszClassName = SUBCLASS_NAME;
 94     cls.hInstance = NULL;
 95     ok(RegisterClassEx(&cls), "RegisterClassEx failed\n");
 96 }
 97 
 98 static void test_create(void)
 99 {
100     RECT rc;
101     HWND hwnd;
102 
103     ok((hwnd = CreateWindowA(SUBCLASS_NAME, "", WS_CHILD|WS_VISIBLE|SBARS_SIZEGRIP, 0, 0, 100, 100,
104         g_hMainWnd, NULL, NULL, 0)) != NULL, "CreateWindowA failed\n");
105     MapWindowPoints(HWND_DESKTOP, g_hMainWnd, (LPPOINT)&rc, 2);
106     GetWindowRect(hwnd, &rc);
107     MapWindowPoints(HWND_DESKTOP, g_hMainWnd, (LPPOINT)&rc, 2);
108     expect_rect(0, 0, 100, 100, g_rcCreated);
109     expect(0, rc.left);
110     expect(672, rc.right);
111     expect(226, rc.bottom);
112     /* we don't check rc.top as this may depend on user font settings */
113     DestroyWindow(hwnd);
114 }
115 
116 static int CALLBACK check_height_font_enumproc(ENUMLOGFONTEX *enumlf, NEWTEXTMETRICEX *ntm, DWORD type, LPARAM lParam)
117 {
118     HWND hwndStatus = (HWND)lParam;
119     HDC hdc = GetDC(NULL);
120     static const int sizes[] = { 6,  7,  8,  9, 10, 11, 12, 13, 15, 16,
121                                 20, 22, 28, 36, 48, 72};
122     DWORD i;
123     DWORD y;
124     LPSTR facename = (CHAR *)enumlf->elfFullName;
125 
126     /* on win9x, enumlf->elfFullName is only valid for truetype fonts */
127     if (type != TRUETYPE_FONTTYPE)
128         facename = enumlf->elfLogFont.lfFaceName;
129 
130     for (i = 0; i < sizeof(sizes)/sizeof(sizes[0]); i++)
131     {
132         HFONT hFont;
133         TEXTMETRIC tm;
134         HFONT hCtrlFont;
135         HFONT hOldFont;
136         RECT rcCtrl;
137 
138         enumlf->elfLogFont.lfHeight = sizes[i];
139         hFont = CreateFontIndirect(&enumlf->elfLogFont);
140         hCtrlFont = (HFONT)SendMessage(hwndStatus, WM_SETFONT, (WPARAM)hFont, TRUE);
141         hOldFont = SelectObject(hdc, hFont);
142 
143         GetClientRect(hwndStatus, &rcCtrl);
144         GetTextMetrics(hdc, &tm);
145         y = tm.tmHeight + (tm.tmInternalLeading ? tm.tmInternalLeading : 2) + 4;
146 
147         ok( (rcCtrl.bottom == max(y, g_ysize)) || (rcCtrl.bottom == max(y, g_dpisize)),
148             "got %d (expected %d or %d) for %s #%d\n",
149             rcCtrl.bottom, max(y, g_ysize), max(y, g_dpisize), facename, sizes[i]);
150 
151         SelectObject(hdc, hOldFont);
152         SendMessage(hwndStatus, WM_SETFONT, (WPARAM)hCtrlFont, TRUE);
153         DeleteObject(hFont);
154     }
155     ReleaseDC(NULL, hdc);
156     return 1;
157 }
158 
159 static int CALLBACK check_height_family_enumproc(ENUMLOGFONTEX *enumlf, NEWTEXTMETRICEX *ntm, DWORD type, LPARAM lParam)
160 {
161     HDC hdc = GetDC(NULL);
162     enumlf->elfLogFont.lfHeight = 0;
163     EnumFontFamiliesEx(hdc, &enumlf->elfLogFont, (FONTENUMPROC)check_height_font_enumproc, lParam, 0);
164     ReleaseDC(NULL, hdc);
165     return 1;
166 }
167 
168 static void test_height(void)
169 {
170     LOGFONT lf;
171     HFONT hFont, hFontSm;
172     RECT rc1, rc2;
173     HWND hwndStatus = CreateWindow(SUBCLASS_NAME, NULL, WS_CHILD|WS_VISIBLE,
174         0, 0, 300, 20, g_hMainWnd, NULL, NULL, NULL);
175     HDC hdc;
176 
177     GetClientRect(hwndStatus, &rc1);
178     hFont = CreateFont(32, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET,
179         OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_DONTCARE, "Tahoma");
180 
181     g_wmsize_count = 0;
182     SendMessage(hwndStatus, WM_SETFONT, (WPARAM)hFont, TRUE);
183     if (!g_wmsize_count)
184     {
185         skip("Status control not resized in win95, skipping broken tests.\n");
186         return;
187     }
188     ok(g_wmsize_count > 0, "WM_SETFONT should issue WM_SIZE\n");
189 
190     GetClientRect(hwndStatus, &rc2);
191     expect_rect(0, 0, 672, 42, rc2); /* GetTextMetrics returns invalid tmInternalLeading for this font */
192 
193     g_wmsize_count = 0;
194     SendMessage(hwndStatus, WM_SETFONT, (WPARAM)hFont, TRUE);
195     ok(g_wmsize_count > 0, "WM_SETFONT should issue WM_SIZE\n");
196 
197     GetClientRect(hwndStatus, &rc2);
198     expect_rect(0, 0, 672, 42, rc2);
199 
200     /* minheight < fontsize - no effects*/
201     SendMessage(hwndStatus, SB_SETMINHEIGHT, 12, 0);
202     SendMessage(hwndStatus, WM_SIZE, 0, 0);
203     GetClientRect(hwndStatus, &rc2);
204     expect_rect(0, 0, 672, 42, rc2);
205 
206     /* minheight > fontsize - has an effect after WM_SIZE */
207     SendMessage(hwndStatus, SB_SETMINHEIGHT, 60, 0);
208     GetClientRect(hwndStatus, &rc2);
209     expect_rect(0, 0, 672, 42, rc2);
210     SendMessage(hwndStatus, WM_SIZE, 0, 0);
211     GetClientRect(hwndStatus, &rc2);
212     expect_rect(0, 0, 672, 62, rc2);
213 
214     /* font changed to smaller than minheight - has an effect */
215     SendMessage(hwndStatus, SB_SETMINHEIGHT, 30, 0);
216     expect_rect(0, 0, 672, 62, rc2);
217     SendMessage(hwndStatus, WM_SIZE, 0, 0);
218     GetClientRect(hwndStatus, &rc2);
219     expect_rect(0, 0, 672, 42, rc2);
220     hFontSm = CreateFont(9, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET,
221         OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_DONTCARE, "Tahoma");
222     SendMessage(hwndStatus, WM_SETFONT, (WPARAM)hFontSm, TRUE);
223     GetClientRect(hwndStatus, &rc2);
224     expect_rect(0, 0, 672, 32, rc2);
225 
226     /* test the height formula */
227     ZeroMemory(&lf, sizeof(lf));
228     SendMessage(hwndStatus, SB_SETMINHEIGHT, 0, 0);
229     hdc = GetDC(NULL);
230 
231     /* used only for some fonts (tahoma as example) */
232     g_ysize = GetSystemMetrics(SM_CYSIZE) + 2;
233     if (g_ysize & 1) g_ysize--;     /* The min height is always even */
234 
235     g_dpisize = MulDiv(18, GetDeviceCaps(hdc, LOGPIXELSY), 96) + 2;
236     if (g_dpisize & 1) g_dpisize--; /* The min height is always even */
237 
238 
239     trace("dpi=%d (min height: %d or %d) SM_CYSIZE: %d\n",
240             GetDeviceCaps(hdc, LOGPIXELSY), g_ysize, g_dpisize,
241             GetSystemMetrics(SM_CYSIZE));
242 
243     EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC)check_height_family_enumproc, (LPARAM)hwndStatus, 0);
244     ReleaseDC(NULL, hdc);
245 
246     DestroyWindow(hwndStatus);
247     DeleteObject(hFont);
248     DeleteObject(hFontSm);
249 }
250 
251 static void test_status_control(void)
252 {
253     HWND hWndStatus;
254     int r;
255     int nParts[] = {50, 150, -1};
256     int checkParts[] = {0, 0, 0};
257     int borders[] = {0, 0, 0};
258     RECT rc;
259     CHAR charArray[20];
260     HICON hIcon;
261     char ch;
262     char chstr[10] = "Inval id";
263 
264     hWndStatus = create_status_control(WS_VISIBLE, 0);
265 
266     /* Divide into parts and set text */
267     r = SendMessage(hWndStatus, SB_SETPARTS, 3, (LPARAM)nParts);
268     expect(TRUE,r);
269     r = SendMessage(hWndStatus, SB_SETTEXT, 0, (LPARAM)"First");
270     expect(TRUE,r);
271     r = SendMessage(hWndStatus, SB_SETTEXT, 1, (LPARAM)"Second");
272     expect(TRUE,r);
273     r = SendMessage(hWndStatus, SB_SETTEXT, 2, (LPARAM)"Third");
274     expect(TRUE,r);
275 
276     /* Get RECT Information */
277     r = SendMessage(hWndStatus, SB_GETRECT, 0, (LPARAM)&rc);
278     expect(TRUE,r);
279     expect(2,rc.top);
280     /* The rc.bottom test is system dependent
281     expect(22,rc.bottom); */
282     expect(0,rc.left);
283     expect(50,rc.right);
284     r = SendMessage(hWndStatus, SB_GETRECT, -1, (LPARAM)&rc);
285     expect(FALSE,r);
286     r = SendMessage(hWndStatus, SB_GETRECT, 3, (LPARAM)&rc);
287     expect(FALSE,r);
288     /* Get text length and text */
289     r = SendMessage(hWndStatus, SB_GETTEXTLENGTH, 2, 0);
290     expect(5,LOWORD(r));
291     expect(0,HIWORD(r));
292     r = SendMessage(hWndStatus, SB_GETTEXT, 2, (LPARAM) charArray);
293     ok(strcmp(charArray,"Third") == 0, "Expected Third, got %s\n", charArray);
294     expect(5,LOWORD(r));
295     expect(0,HIWORD(r));
296 
297     /* Get parts and borders */
298     r = SendMessage(hWndStatus, SB_GETPARTS, 3, (LPARAM)checkParts);
299     ok(r == 3, "Expected 3, got %d\n", r);
300     expect(50,checkParts[0]);
301     expect(150,checkParts[1]);
302     expect(-1,checkParts[2]);
303     r = SendMessage(hWndStatus, SB_GETBORDERS, 0, (LPARAM)borders);
304     ok(r == TRUE, "Expected TRUE, got %d\n", r);
305     expect(0,borders[0]);
306     expect(2,borders[1]);
307     expect(2,borders[2]);
308 
309     /* Test resetting text with different characters */
310     r = SendMessage(hWndStatus, SB_SETTEXT, 0, (LPARAM)"First@Again");
311     expect(TRUE,r);
312     r = SendMessage(hWndStatus, SB_SETTEXT, 1, (LPARAM)"Invalid\tChars\\7\7");
313         expect(TRUE,r);
314     r = SendMessage(hWndStatus, SB_SETTEXT, 2, (LPARAM)"InvalidChars\\n\n");
315         expect(TRUE,r);
316 
317     /* Get text again */
318     r = SendMessage(hWndStatus, SB_GETTEXT, 0, (LPARAM) charArray);
319     ok(strcmp(charArray,"First@Again") == 0, "Expected First@Again, got %s\n", charArray);
320     expect(11,LOWORD(r));
321     expect(0,HIWORD(r));
322     r = SendMessage(hWndStatus, SB_GETTEXT, 1, (LPARAM) charArray);
323     ok(strcmp(charArray,"Invalid\tChars\\7 ") == 0, "Expected Invalid\tChars\\7 , got %s\n", charArray);
324 
325     expect(16,LOWORD(r));
326     expect(0,HIWORD(r));
327     r = SendMessage(hWndStatus, SB_GETTEXT, 2, (LPARAM) charArray);
328     ok(strcmp(charArray,"InvalidChars\\n ") == 0, "Expected InvalidChars\\n , got %s\n", charArray);
329 
330     expect(15,LOWORD(r));
331     expect(0,HIWORD(r));
332 
333     /* test more nonprintable chars */
334     for(ch = 0x00; ch < 0x7F; ch++) {
335         chstr[5] = ch;
336         r = SendMessage(hWndStatus, SB_SETTEXT, 0, (LPARAM)chstr);
337         expect(TRUE,r);
338         r = SendMessage(hWndStatus, SB_GETTEXT, 0, (LPARAM)charArray);
339         /* substitution with single space */
340         if (ch > 0x00 && ch < 0x20 && ch != '\t')
341             chstr[5] = ' ';
342         ok(strcmp(charArray, chstr) == 0, "Expected %s, got %s\n", chstr, charArray);
343     }
344 
345     /* Set background color */
346     r = SendMessage(hWndStatus, SB_SETBKCOLOR , 0, RGB(255,0,0));
347     ok(r == CLR_DEFAULT ||
348        broken(r == 0), /* win95 */
349        "Expected %d, got %d\n", CLR_DEFAULT, r);
350     r = SendMessage(hWndStatus, SB_SETBKCOLOR , 0, CLR_DEFAULT);
351     ok(r == RGB(255,0,0) ||
352        broken(r == 0), /* win95 */
353        "Expected %d, got %d\n", RGB(255,0,0), r);
354 
355     /* Add an icon to the status bar */
356     hIcon = LoadIcon(NULL, IDI_QUESTION);
357     r = SendMessage(hWndStatus, SB_SETICON, 1, 0);
358     ok(r != 0 ||
359        broken(r == 0), /* win95 */
360        "Expected non-zero, got %d\n", r);
361     r = SendMessage(hWndStatus, SB_SETICON, 1, (LPARAM) hIcon);
362     ok(r != 0 ||
363        broken(r == 0), /* win95 */
364        "Expected non-zero, got %d\n", r);
365     r = SendMessage(hWndStatus, SB_SETICON, 1, 0);
366     ok(r != 0 ||
367        broken(r == 0), /* win95 */
368        "Expected non-zero, got %d\n", r);
369 
370     /* Set the Unicode format */
371     r = SendMessage(hWndStatus, SB_SETUNICODEFORMAT, FALSE, 0);
372     r = SendMessage(hWndStatus, SB_GETUNICODEFORMAT, 0, 0);
373     expect(FALSE,r);
374     r = SendMessage(hWndStatus, SB_SETUNICODEFORMAT, TRUE, 0);
375     expect(FALSE,r);
376     r = SendMessage(hWndStatus, SB_GETUNICODEFORMAT, 0, 0);
377     ok(r == TRUE ||
378        broken(r == FALSE), /* win95 */
379        "Expected TRUE, got %d\n", r);
380 
381     /* Reset number of parts */
382     r = SendMessage(hWndStatus, SB_SETPARTS, 2, (LPARAM)nParts);
383     expect(TRUE,r);
384 
385     /* Set the minimum height and get rectangle information again */
386     SendMessage(hWndStatus, SB_SETMINHEIGHT, 50, 0);
387     r = SendMessage(hWndStatus, WM_SIZE, 0, 0);
388     expect(0,r);
389     r = SendMessage(hWndStatus, SB_GETRECT, 0, (LPARAM)&rc);
390     expect(TRUE,r);
391     expect(2,rc.top);
392     /* The rc.bottom test is system dependent
393     expect(22,rc.bottom); */
394     expect(0,rc.left);
395     expect(50,rc.right);
396     r = SendMessage(hWndStatus, SB_GETRECT, -1, (LPARAM)&rc);
397     expect(FALSE,r);
398     r = SendMessage(hWndStatus, SB_GETRECT, 3, (LPARAM)&rc);
399     expect(FALSE,r);
400 
401     /* Set the ToolTip text */
402     todo_wine
403     {
404         SendMessage(hWndStatus, SB_SETTIPTEXT, 0,(LPARAM) "Tooltip Text");
405         lstrcpyA(charArray, "apple");
406         SendMessage(hWndStatus, SB_GETTIPTEXT, MAKEWPARAM (0, 20),(LPARAM) charArray);
407         ok(strcmp(charArray,"Tooltip Text") == 0 ||
408            broken(!strcmp(charArray, "apple")), /* win95 */
409            "Expected Tooltip Text, got %s\n", charArray);
410     }
411 
412     /* Make simple */
413     SendMessage(hWndStatus, SB_SIMPLE, TRUE, 0);
414     r = SendMessage(hWndStatus, SB_ISSIMPLE, 0, 0);
415     ok(r == TRUE ||
416        broken(r == FALSE), /* win95 */
417        "Expected TRUE, got %d\n", r);
418 
419     DestroyWindow(hWndStatus);
420 }
421 
422 static LRESULT WINAPI ownerdraw_test_wndproc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
423 {
424     LRESULT ret;
425     if (msg == WM_DRAWITEM)
426         g_wmdrawitm_ctr++;
427     ret = CallWindowProc(g_wndproc_saved, hwnd, msg, wParam, lParam);
428     return ret;
429 }
430 
431 static void test_status_ownerdraw(void)
432 {
433     HWND hWndStatus;
434     int r;
435     const char* statustext = "STATUS TEXT";
436     LONG oldstyle;
437 
438     /* subclass the main window and make sure it is visible */
439     g_wndproc_saved = (WNDPROC) SetWindowLongPtr( g_hMainWnd, GWLP_WNDPROC,
440                                                   (LONG_PTR)ownerdraw_test_wndproc );
441     ok( g_wndproc_saved != 0, "failed to set the WndProc\n");
442     SetWindowPos( g_hMainWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE);
443     oldstyle = GetWindowLong( g_hMainWnd, GWL_STYLE);
444     SetWindowLong( g_hMainWnd, GWL_STYLE, oldstyle | WS_VISIBLE);
445     /* create a status child window */
446     ok((hWndStatus = CreateWindowA(SUBCLASS_NAME, "", WS_CHILD|WS_VISIBLE, 0, 0, 100, 100,
447                     g_hMainWnd, NULL, NULL, 0)) != NULL, "CreateWindowA failed\n");
448     /* set text */
449     g_wmdrawitm_ctr = 0;
450     r = SendMessage(hWndStatus, SB_SETTEXT, 0, (LPARAM)statustext);
451     ok( r == TRUE, "Sendmessage returned %d, expected 1\n", r);
452     ok( 0 == g_wmdrawitm_ctr, "got %d drawitem messages expected none\n", g_wmdrawitm_ctr);
453     /* set same text, with ownerdraw flag */
454     g_wmdrawitm_ctr = 0;
455     r = SendMessage(hWndStatus, SB_SETTEXT, SBT_OWNERDRAW, (LPARAM)statustext);
456     ok( r == TRUE, "Sendmessage returned %d, expected 1\n", r);
457     ok( 1 == g_wmdrawitm_ctr, "got %d drawitem messages expected 1\n", g_wmdrawitm_ctr);
458     /* ;and again */
459     g_wmdrawitm_ctr = 0;
460     r = SendMessage(hWndStatus, SB_SETTEXT, SBT_OWNERDRAW, (LPARAM)statustext);
461     ok( r == TRUE, "Sendmessage returned %d, expected 1\n", r);
462     ok( 1 == g_wmdrawitm_ctr, "got %d drawitem messages expected 1\n", g_wmdrawitm_ctr);
463     /* clean up */
464     DestroyWindow(hWndStatus);
465     SetWindowLong( g_hMainWnd, GWL_STYLE, oldstyle);
466     SetWindowLongPtr( g_hMainWnd, GWLP_WNDPROC, (LONG_PTR)g_wndproc_saved );
467 }
468 
469 START_TEST(status)
470 {
471     hinst = GetModuleHandleA(NULL);
472 
473     g_hMainWnd = CreateWindowExA(0, "static", "", WS_OVERLAPPEDWINDOW,
474       CW_USEDEFAULT, CW_USEDEFAULT, 672+2*GetSystemMetrics(SM_CXSIZEFRAME),
475       226+GetSystemMetrics(SM_CYCAPTION)+2*GetSystemMetrics(SM_CYSIZEFRAME),
476       NULL, NULL, GetModuleHandleA(NULL), 0);
477 
478     InitCommonControls();
479 
480     register_subclass();
481 
482     test_status_control();
483     test_create();
484     test_height();
485     test_status_ownerdraw();
486 }
487 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.