ReactOS 0.4.16-dev-188-g678aa63
status.c
Go to the documentation of this file.
1/*
2 * Interface code to StatusWindow widget/control
3 *
4 * Copyright 1996 Bruce Milner
5 * Copyright 1998, 1999 Eric Kohl
6 * Copyright 2002 Dimitrie O. Paun
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 *
22 * TODO:
23 * -- CCS_BOTTOM (default)
24 * -- CCS_LEFT
25 * -- CCS_NODIVIDER
26 * -- CCS_NOMOVEX
27 * -- CCS_NOMOVEY
28 * -- CCS_NOPARENTALIGN
29 * -- CCS_RIGHT
30 * -- CCS_TOP
31 * -- CCS_VERT (defaults to RIGHT)
32 */
33
34#include <stdarg.h>
35#include <string.h>
36
37#include "windef.h"
38#include "winbase.h"
39#include "wingdi.h"
40#include "winuser.h"
41#include "winnls.h"
42#include "commctrl.h"
43#include "comctl32.h"
44#include "uxtheme.h"
45#include "vssym32.h"
46#include "wine/debug.h"
47
49
50typedef struct
51{
58
59typedef struct
60{
65 UINT minHeight; /* at least MIN_PANE_HEIGHT, can be increased by SB_SETMINHEIGHT */
70 COLORREF clrBk; /* background color */
71 BOOL bUnicode; /* notify format. TRUE if notifies in Unicode */
72 STATUSWINDOWPART part0; /* simple window */
78
79/*
80 * Run tests using Waite Group Windows95 API Bible Vol. 1&2
81 * The second cdrom contains executables drawstat.exe, gettext.exe,
82 * simple.exe, getparts.exe, setparts.exe, statwnd.exe
83 */
84
85#define HORZ_BORDER 0
86#define VERT_BORDER 2
87#define HORZ_GAP 2
88
89static const WCHAR themeClass[] = { 'S','t','a','t','u','s',0 };
90
91/* prototype */
92static void
94static LRESULT
96
98{
100}
101
102static UINT
104{
105 HTHEME theme;
106 UINT height;
108 int margin;
109
110 COMCTL32_GetFontMetrics(infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont, &tm);
111 margin = (tm.tmInternalLeading ? tm.tmInternalLeading : 2);
112 height = max(tm.tmHeight + margin + 2*GetSystemMetrics(SM_CYBORDER), infoPtr->minHeight) + infoPtr->verticalBorder;
113
114 if ((theme = GetWindowTheme(infoPtr->Self)))
115 {
116 /* Determine bar height from theme such that the content area is
117 * textHeight pixels large */
118 HDC hdc = GetDC(infoPtr->Self);
119 RECT r;
120
121 SetRect(&r, 0, 0, 0, max(infoPtr->minHeight, tm.tmHeight));
122 if (SUCCEEDED(GetThemeBackgroundExtent(theme, hdc, SP_PANE, 0, &r, &r)))
123 {
124 height = r.bottom - r.top;
125 }
126 ReleaseDC(infoPtr->Self, hdc);
127 }
128
129 TRACE(" textHeight=%d+%d, final height=%d\n", tm.tmHeight, tm.tmInternalLeading, height);
130 return height;
131}
132
133static void
135{
136 RECT rc = *lpRect;
137
138 TRACE("draw size grip %s\n", wine_dbgstr_rect(lpRect));
139
140 if (theme)
141 {
142 SIZE gripperSize;
143 if (SUCCEEDED (GetThemePartSize (theme, hdc, SP_GRIPPER, 0, lpRect,
144 TS_DRAW, &gripperSize)))
145 {
146 rc.left = rc.right - gripperSize.cx;
147 rc.top = rc.bottom - gripperSize.cy;
148 if (SUCCEEDED (DrawThemeBackground(theme, hdc, SP_GRIPPER, 0, &rc, NULL)))
149 return;
150 }
151 }
152
153 rc.left = max( rc.left, rc.right - GetSystemMetrics(SM_CXVSCROLL) - 1 );
154 rc.top = max( rc.top, rc.bottom - GetSystemMetrics(SM_CYHSCROLL) - 1 );
156}
157
158
159static void
160STATUSBAR_DrawPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
161{
162 RECT r = part->bound;
164 HTHEME theme = GetWindowTheme (infoPtr->Self);
165 int themePart = SP_PANE;
166 int x = 0;
167
168 TRACE("part bound %s\n", wine_dbgstr_rect(&r));
169 if (part->style & SBT_POPOUT)
171 else if (part->style & SBT_NOBORDERS)
172 border = 0;
173
174 if (theme)
175 {
176 if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
177 && (infoPtr->simple || (itemID == (infoPtr->numParts-1))))
178 themePart = SP_GRIPPERPANE;
179 DrawThemeBackground(theme, hdc, themePart, 0, &r, NULL);
180 }
181 else
183
184 if (part->hIcon) {
185 INT cy = r.bottom - r.top;
186 DrawIconEx (hdc, r.left + 2, r.top, part->hIcon, cy, cy, 0, 0, DI_NORMAL);
187 x = 2 + cy;
188 }
189
190 if (part->style & SBT_OWNERDRAW) {
191 DRAWITEMSTRUCT dis;
192
193 dis.CtlID = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
194 dis.itemID = itemID;
195 dis.hwndItem = infoPtr->Self;
196 dis.hDC = hdc;
197 dis.rcItem = r;
198 dis.itemData = (ULONG_PTR)part->text;
199 SendMessageW (infoPtr->Notify, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis);
200 } else {
201 r.left += x;
202#ifdef __REACTOS__
203 if (!theme)
204 {
205 r.left -= 2;
207 }
208 else
209 {
210 r.left += 2;
211 r.right -= 2;
212 DrawThemeText(theme, hdc, SP_PANE, 0, part->text, -1, DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX, 0, &r);
213 }
214#else
216#endif
217 }
218}
219
220
221static void
222STATUSBAR_RefreshPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
223{
224 HBRUSH hbrBk;
225 HTHEME theme;
226
227 TRACE("item %d\n", itemID);
228
229 if (part->bound.right < part->bound.left) return;
230
231 if (!RectVisible(hdc, &part->bound))
232 return;
233
234 if ((theme = GetWindowTheme (infoPtr->Self)))
235 {
236 RECT cr;
237 GetClientRect (infoPtr->Self, &cr);
238 DrawThemeBackground(theme, hdc, 0, 0, &cr, &part->bound);
239 }
240 else
241 {
242 if (infoPtr->clrBk != CLR_DEFAULT)
243 hbrBk = CreateSolidBrush (infoPtr->clrBk);
244 else
246 FillRect(hdc, &part->bound, hbrBk);
247 if (infoPtr->clrBk != CLR_DEFAULT)
248 DeleteObject (hbrBk);
249 }
250
251 STATUSBAR_DrawPart (infoPtr, hdc, part, itemID);
252}
253
254
255static LRESULT
257{
258 RECT rect;
259 HBRUSH hbrBk;
260 HFONT hOldFont;
261 HTHEME theme;
262
263 TRACE("\n");
264 if (!IsWindowVisible(infoPtr->Self))
265 return 0;
266
268
269 GetClientRect (infoPtr->Self, &rect);
270
271 if ((theme = GetWindowTheme (infoPtr->Self)))
272 {
273 DrawThemeBackground(theme, hdc, 0, 0, &rect, NULL);
274 }
275 else
276 {
277 if (infoPtr->clrBk != CLR_DEFAULT)
278 hbrBk = CreateSolidBrush (infoPtr->clrBk);
279 else
281 FillRect(hdc, &rect, hbrBk);
282 if (infoPtr->clrBk != CLR_DEFAULT)
283 DeleteObject (hbrBk);
284 }
285
286 hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
287
288 if (infoPtr->simple) {
289 STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->part0, 0);
290 } else {
291 unsigned int i;
292
293 for (i = 0; i < infoPtr->numParts; i++) {
294 STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->parts[i], i);
295 }
296 }
297
298 SelectObject (hdc, hOldFont);
299
300 if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
301 && !(GetWindowLongW (infoPtr->Notify, GWL_STYLE) & WS_MAXIMIZE))
303
304 return 0;
305}
306
307
308static int
310{
311 unsigned int i;
312
313 if (infoPtr->simple)
314 return 255;
315
316 for (i = 0; i < infoPtr->numParts; i++)
317 if (pt->x >= infoPtr->parts[i].bound.left && pt->x <= infoPtr->parts[i].bound.right)
318 return i;
319 return -2;
320}
321
322
323static void
325{
326 STATUSWINDOWPART *part;
327 RECT rect, *r;
328 UINT i;
329
330 /* get our window size */
331 GetClientRect (infoPtr->Self, &rect);
332 TRACE("client wnd size is %s\n", wine_dbgstr_rect(&rect));
333
334 rect.left += infoPtr->horizontalBorder;
335 rect.top += infoPtr->verticalBorder;
336
337 /* set bounds for simple rectangle */
338 infoPtr->part0.bound = rect;
339
340 /* set bounds for non-simple rectangles */
341 for (i = 0; i < infoPtr->numParts; i++) {
342 part = &infoPtr->parts[i];
343 r = &infoPtr->parts[i].bound;
344 r->top = rect.top;
345 r->bottom = rect.bottom;
346 if (i == 0)
347 r->left = 0;
348 else
349 r->left = infoPtr->parts[i-1].bound.right + infoPtr->horizontalGap;
350 if (part->x == -1)
351 r->right = rect.right;
352 else
353 r->right = part->x;
354
355 if (infoPtr->hwndToolTip) {
356 TTTOOLINFOW ti;
357
358 ti.cbSize = sizeof(TTTOOLINFOW);
359 ti.hwnd = infoPtr->Self;
360 ti.uId = i;
361 ti.rect = *r;
363 0, (LPARAM)&ti);
364 }
365 }
366}
367
368
369static LRESULT
372{
373 MSG msg;
374
375 msg.hwnd = infoPtr->Self;
376 msg.message = uMsg;
377 msg.wParam = wParam;
378 msg.lParam = lParam;
379 msg.time = GetMessageTime ();
380 msg.pt.x = (short)LOWORD(GetMessagePos ());
381 msg.pt.y = (short)HIWORD(GetMessagePos ());
382
383 return SendMessageW (infoPtr->hwndToolTip, TTM_RELAYEVENT, 0, (LPARAM)&msg);
384}
385
386
387static BOOL
389{
390 TRACE("\n");
391 out[0] = infoPtr->horizontalBorder;
392 out[1] = infoPtr->verticalBorder;
393 out[2] = infoPtr->horizontalGap;
394
395 return TRUE;
396}
397
398
399static BOOL
401{
402 TRACE("\n");
403 infoPtr->horizontalBorder = in[0];
404 infoPtr->verticalBorder = in[1];
405 infoPtr->horizontalGap = in[2];
406 InvalidateRect(infoPtr->Self, NULL, FALSE);
407
408 return TRUE;
409}
410
411
412static HICON
413STATUSBAR_GetIcon (const STATUS_INFO *infoPtr, INT nPart)
414{
415 TRACE("%d\n", nPart);
416 /* MSDN says: "simple parts are indexed with -1" */
417 if ((nPart < -1) || (nPart >= infoPtr->numParts))
418 return 0;
419
420 if (nPart == -1)
421 return (infoPtr->part0.hIcon);
422 else
423 return (infoPtr->parts[nPart].hIcon);
424}
425
426
427static INT
428STATUSBAR_GetParts (const STATUS_INFO *infoPtr, INT num_parts, INT parts[])
429{
430 INT i;
431
432 TRACE("(%d)\n", num_parts);
433 if (parts) {
434#ifdef __REACTOS__
435 if (num_parts > infoPtr->numParts)
436 num_parts = infoPtr->numParts;
437#endif
438 for (i = 0; i < num_parts; i++) {
439 parts[i] = infoPtr->parts[i].x;
440 }
441 }
442 return infoPtr->numParts;
443}
444
445
446static BOOL
448{
449 TRACE("part %d\n", nPart);
450 if(nPart >= infoPtr->numParts || nPart < 0)
451 return FALSE;
452 if (infoPtr->simple)
453 *rect = infoPtr->part0.bound;
454 else
455 *rect = infoPtr->parts[nPart].bound;
456 return TRUE;
457}
458
459
460static LRESULT
462{
463 STATUSWINDOWPART *part;
465
466 TRACE("part %d\n", nPart);
467
468 /* MSDN says: "simple parts use index of 0", so this check is ok. */
469 if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
470
471 if (infoPtr->simple)
472 part = &infoPtr->part0;
473 else
474 part = &infoPtr->parts[nPart];
475
476 if (part->style & SBT_OWNERDRAW)
477 result = (LRESULT)part->text;
478 else {
479 DWORD len = part->text ? WideCharToMultiByte( CP_ACP, 0, part->text, -1,
480 NULL, 0, NULL, NULL ) - 1 : 0;
481 result = MAKELONG( len, part->style );
482 if (part->text && buf)
483 WideCharToMultiByte( CP_ACP, 0, part->text, -1, buf, len+1, NULL, NULL );
484 }
485 return result;
486}
487
488
489static LRESULT
491{
492 STATUSWINDOWPART *part;
494
495 TRACE("part %d\n", nPart);
496 if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
497
498 if (infoPtr->simple)
499 part = &infoPtr->part0;
500 else
501 part = &infoPtr->parts[nPart];
502
503 if (part->style & SBT_OWNERDRAW)
504 result = (LRESULT)part->text;
505 else {
506 result = part->text ? lstrlenW (part->text) : 0;
507 result |= (part->style << 16);
508 if (part->text && buf)
509 lstrcpyW (buf, part->text);
510 }
511 return result;
512}
513
514
515static LRESULT
517{
518 STATUSWINDOWPART *part;
520
521 TRACE("part %d\n", nPart);
522
523 /* MSDN says: "simple parts use index of 0", so this check is ok. */
524 if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
525
526 if (infoPtr->simple)
527 part = &infoPtr->part0;
528 else
529 part = &infoPtr->parts[nPart];
530
531 if ((~part->style & SBT_OWNERDRAW) && part->text)
532 result = lstrlenW(part->text);
533 else
534 result = 0;
535
536 result |= (part->style << 16);
537 return result;
538}
539
540static LRESULT
542{
543 TRACE("\n");
544 if (tip) {
546 buf[0]='\0';
547
548 if (infoPtr->hwndToolTip) {
549 TTTOOLINFOA ti;
550 ti.cbSize = sizeof(TTTOOLINFOA);
551 ti.hwnd = infoPtr->Self;
552 ti.uId = id;
553 ti.lpszText = buf;
554 SendMessageA (infoPtr->hwndToolTip, TTM_GETTEXTA, 0, (LPARAM)&ti);
555 }
556 lstrcpynA (tip, buf, size);
557 }
558 return 0;
559}
560
561
562static LRESULT
564{
565 TRACE("\n");
566 if (tip) {
568 buf[0]=0;
569
570 if (infoPtr->hwndToolTip) {
571 TTTOOLINFOW ti;
572 ti.cbSize = sizeof(TTTOOLINFOW);
573 ti.hwnd = infoPtr->Self;
574 ti.uId = id;
575 ti.lpszText = buf;
576 SendMessageW(infoPtr->hwndToolTip, TTM_GETTEXTW, 0, (LPARAM)&ti);
577 }
578 lstrcpynW(tip, buf, size);
579 }
580
581 return 0;
582}
583
584
585static COLORREF
587{
588 COLORREF oldBkColor;
589
590 oldBkColor = infoPtr->clrBk;
591 infoPtr->clrBk = color;
592 InvalidateRect(infoPtr->Self, NULL, FALSE);
593
594 TRACE("CREF: %08x -> %08x\n", oldBkColor, infoPtr->clrBk);
595 return oldBkColor;
596}
597
598
599static BOOL
601{
602 if ((nPart < -1) || (nPart >= infoPtr->numParts))
603 return FALSE;
604
605 TRACE("setting part %d\n", nPart);
606
607 /* FIXME: MSDN says "if nPart is -1, the status bar is assumed simple" */
608 if (nPart == -1) {
609 if (infoPtr->part0.hIcon == hIcon) /* same as - no redraw */
610 return TRUE;
611 infoPtr->part0.hIcon = hIcon;
612 if (infoPtr->simple)
613 InvalidateRect(infoPtr->Self, &infoPtr->part0.bound, FALSE);
614 } else {
615 if (infoPtr->parts[nPart].hIcon == hIcon) /* same as - no redraw */
616 return TRUE;
617
618 infoPtr->parts[nPart].hIcon = hIcon;
619 if (!(infoPtr->simple))
620 InvalidateRect(infoPtr->Self, &infoPtr->parts[nPart].bound, FALSE);
621 }
622 return TRUE;
623}
624
625
626static BOOL
628{
630 if (ysize & 1) ysize--;
631 infoPtr->minHeight = max(height, ysize);
632 infoPtr->height = STATUSBAR_ComputeHeight(infoPtr);
633 /* like native, don't resize the control */
634 return TRUE;
635}
636
637
638static BOOL
640{
641 STATUSWINDOWPART *tmp;
642 INT i, oldNumParts;
643
644 TRACE("(%d,%p)\n", count, parts);
645
646 if(!count) return FALSE;
647
648 oldNumParts = infoPtr->numParts;
649 infoPtr->numParts = count;
650 if (oldNumParts > infoPtr->numParts) {
651 for (i = infoPtr->numParts ; i < oldNumParts; i++) {
652 if (!(infoPtr->parts[i].style & SBT_OWNERDRAW))
653 Free (infoPtr->parts[i].text);
654 }
655 } else if (oldNumParts < infoPtr->numParts) {
656 tmp = Alloc (sizeof(STATUSWINDOWPART) * infoPtr->numParts);
657 if (!tmp) return FALSE;
658 for (i = 0; i < oldNumParts; i++) {
659 tmp[i] = infoPtr->parts[i];
660 }
661 Free (infoPtr->parts);
662 infoPtr->parts = tmp;
663 }
664 if (oldNumParts == infoPtr->numParts) {
665 for (i=0; i < oldNumParts; i++)
666 if (infoPtr->parts[i].x != parts[i])
667 break;
668 if (i==oldNumParts) /* Unchanged? no need to redraw! */
669 return TRUE;
670 }
671
672 for (i = 0; i < infoPtr->numParts; i++)
673 infoPtr->parts[i].x = parts[i];
674
675 if (infoPtr->hwndToolTip) {
676 INT nTipCount;
677 TTTOOLINFOW ti;
678 WCHAR wEmpty = 0;
679
680 ZeroMemory (&ti, sizeof(TTTOOLINFOW));
681 ti.cbSize = sizeof(TTTOOLINFOW);
682 ti.hwnd = infoPtr->Self;
683 ti.lpszText = &wEmpty;
684
685 nTipCount = SendMessageW (infoPtr->hwndToolTip, TTM_GETTOOLCOUNT, 0, 0);
686 if (nTipCount < infoPtr->numParts) {
687 /* add tools */
688 for (i = nTipCount; i < infoPtr->numParts; i++) {
689 TRACE("add tool %d\n", i);
690 ti.uId = i;
692 0, (LPARAM)&ti);
693 }
694 }
695 else if (nTipCount > infoPtr->numParts) {
696 /* delete tools */
697 for (i = nTipCount - 1; i >= infoPtr->numParts; i--) {
698 TRACE("delete tool %d\n", i);
699 ti.uId = i;
701 0, (LPARAM)&ti);
702 }
703 }
704 }
705 STATUSBAR_SetPartBounds (infoPtr);
706 InvalidateRect(infoPtr->Self, NULL, FALSE);
707 return TRUE;
708}
709
710
711static BOOL
714{
716 BOOL changed = FALSE;
717 INT oldStyle;
718
719 if (style & SBT_OWNERDRAW) {
720 TRACE("part %d, text %p\n",nPart,text);
721 }
722 else TRACE("part %d, text %s\n", nPart, debugstr_t(text, isW));
723
724 /* MSDN says: "If the parameter is set to SB_SIMPLEID (255), the status
725 * window is assumed to be a simple window */
726
727 if (nPart == 0x00ff) {
728 part = &infoPtr->part0;
729 } else {
730 if (infoPtr->parts && nPart >= 0 && nPart < infoPtr->numParts) {
731 part = &infoPtr->parts[nPart];
732 }
733 }
734 if (!part) return FALSE;
735
736 if (part->style != style)
737 changed = TRUE;
738
739 oldStyle = part->style;
740 part->style = style;
741 if (style & SBT_OWNERDRAW) {
742 if (!(oldStyle & SBT_OWNERDRAW))
743 Free (part->text);
744 part->text = text;
745 } else {
746 LPWSTR ntext;
747 WCHAR *idx;
748
749 if (text && !isW) {
750 LPCSTR atxt = (LPCSTR)text;
751 DWORD len = MultiByteToWideChar( CP_ACP, 0, atxt, -1, NULL, 0 );
752 ntext = Alloc( (len + 1)*sizeof(WCHAR) );
753 if (!ntext) return FALSE;
754 MultiByteToWideChar( CP_ACP, 0, atxt, -1, ntext, len );
755 } else if (text) {
756 ntext = Alloc( (lstrlenW(text) + 1)*sizeof(WCHAR) );
757 if (!ntext) return FALSE;
758 lstrcpyW (ntext, text);
759 } else ntext = 0;
760
761 /* replace nonprintable characters with spaces */
762 if (ntext) {
763 idx = ntext;
764 while (*idx) {
765 if(!iswprint(*idx))
766 *idx = ' ';
767 idx++;
768 }
769 }
770
771 /* check if text is unchanged -> no need to redraw */
772 if (text) {
773 if (!changed && part->text && !lstrcmpW(ntext, part->text)) {
774 Free(ntext);
775 return TRUE;
776 }
777 } else {
778 if (!changed && !part->text)
779 return TRUE;
780 }
781
782 if (!(oldStyle & SBT_OWNERDRAW))
783 Free (part->text);
784 part->text = ntext;
785 }
786 InvalidateRect(infoPtr->Self, &part->bound, FALSE);
787 UpdateWindow(infoPtr->Self);
788
789 return TRUE;
790}
791
792
793static LRESULT
795{
796 TRACE("part %d: \"%s\"\n", id, text);
797 if (infoPtr->hwndToolTip) {
798 TTTOOLINFOA ti;
799 ti.cbSize = sizeof(TTTOOLINFOA);
800 ti.hwnd = infoPtr->Self;
801 ti.uId = id;
802 ti.hinst = 0;
803 ti.lpszText = text;
805 }
806
807 return 0;
808}
809
810
811static LRESULT
813{
814 TRACE("part %d: \"%s\"\n", id, debugstr_w(text));
815 if (infoPtr->hwndToolTip) {
816 TTTOOLINFOW ti;
817 ti.cbSize = sizeof(TTTOOLINFOW);
818 ti.hwnd = infoPtr->Self;
819 ti.uId = id;
820 ti.hinst = 0;
821 ti.lpszText = text;
823 }
824
825 return 0;
826}
827
828
829static inline LRESULT
831{
832 BOOL bOld = infoPtr->bUnicode;
833
834 TRACE("(0x%x)\n", bUnicode);
835 infoPtr->bUnicode = bUnicode;
836
837 return bOld;
838}
839
840
841static BOOL
843{
844 NMHDR nmhdr;
845
846 TRACE("(simple=%d)\n", simple);
847 if (infoPtr->simple == simple) /* no need to change */
848 return TRUE;
849
850 infoPtr->simple = simple;
851
852 /* send notification */
853 nmhdr.hwndFrom = infoPtr->Self;
854 nmhdr.idFrom = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
856 SendMessageW (infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nmhdr);
857 InvalidateRect(infoPtr->Self, NULL, FALSE);
858 return TRUE;
859}
860
861
862static LRESULT
864{
865 unsigned int i;
866
867 TRACE("\n");
868 for (i = 0; i < infoPtr->numParts; i++) {
869 if (!(infoPtr->parts[i].style & SBT_OWNERDRAW))
870 Free (infoPtr->parts[i].text);
871 }
872 if (!(infoPtr->part0.style & SBT_OWNERDRAW))
873 Free (infoPtr->part0.text);
874 Free (infoPtr->parts);
875
876 /* delete default font */
877 if (infoPtr->hDefaultFont)
878 DeleteObject (infoPtr->hDefaultFont);
879
880 /* delete tool tip control */
881 if (infoPtr->hwndToolTip)
882 DestroyWindow (infoPtr->hwndToolTip);
883
885
886 SetWindowLongPtrW(infoPtr->Self, 0, 0);
887 Free (infoPtr);
888 return 0;
889}
890
891
892static LRESULT
894{
895 STATUS_INFO *infoPtr;
896 NONCLIENTMETRICSW nclm;
897 DWORD dwStyle;
898 RECT rect;
899 int len;
900
901 TRACE("\n");
902 infoPtr = Alloc (sizeof(STATUS_INFO));
903 if (!infoPtr) goto create_fail;
904 SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
905
906 infoPtr->Self = hwnd;
907 infoPtr->Notify = lpCreate->hwndParent;
908 infoPtr->numParts = 1;
909 infoPtr->parts = 0;
910 infoPtr->simple = FALSE;
911 infoPtr->clrBk = CLR_DEFAULT;
912 infoPtr->hFont = 0;
913 infoPtr->horizontalBorder = HORZ_BORDER;
914 infoPtr->verticalBorder = VERT_BORDER;
915 infoPtr->horizontalGap = HORZ_GAP;
917 if (infoPtr->minHeight & 1) infoPtr->minHeight--;
918
919 STATUSBAR_NotifyFormat(infoPtr, infoPtr->Notify, NF_REQUERY);
920
921 ZeroMemory (&nclm, sizeof(nclm));
922 nclm.cbSize = sizeof(nclm);
923 SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, nclm.cbSize, &nclm, 0);
924 infoPtr->hDefaultFont = CreateFontIndirectW (&nclm.lfStatusFont);
925
927
928 /* initialize simple case */
929 infoPtr->part0.bound = rect;
930 infoPtr->part0.text = 0;
931 infoPtr->part0.x = 0;
932 infoPtr->part0.style = 0;
933 infoPtr->part0.hIcon = 0;
934
935 /* initialize first part */
936 infoPtr->parts = Alloc (sizeof(STATUSWINDOWPART));
937 if (!infoPtr->parts) goto create_fail;
938 infoPtr->parts[0].bound = rect;
939 infoPtr->parts[0].text = 0;
940 infoPtr->parts[0].x = -1;
941 infoPtr->parts[0].style = 0;
942 infoPtr->parts[0].hIcon = 0;
943
945
946 if (lpCreate->lpszName && (len = lstrlenW ((LPCWSTR)lpCreate->lpszName)))
947 {
948 infoPtr->parts[0].text = Alloc ((len + 1)*sizeof(WCHAR));
949 if (!infoPtr->parts[0].text) goto create_fail;
950 lstrcpyW (infoPtr->parts[0].text, (LPCWSTR)lpCreate->lpszName);
951 }
952
953 dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
954 /* native seems to clear WS_BORDER, too */
955 dwStyle &= ~WS_BORDER;
956 SetWindowLongW (hwnd, GWL_STYLE, dwStyle);
957
958 infoPtr->height = STATUSBAR_ComputeHeight(infoPtr);
959
960 if (dwStyle & SBT_TOOLTIPS) {
961 infoPtr->hwndToolTip =
966
967 if (infoPtr->hwndToolTip) {
968 NMTOOLTIPSCREATED nmttc;
969
970 nmttc.hdr.hwndFrom = hwnd;
973 nmttc.hwndToolTips = infoPtr->hwndToolTip;
974
975 SendMessageW (lpCreate->hwndParent, WM_NOTIFY, nmttc.hdr.idFrom, (LPARAM)&nmttc);
976 }
977 }
978
979 return 0;
980
981create_fail:
982 TRACE(" failed!\n");
983 if (infoPtr) STATUSBAR_WMDestroy(infoPtr);
984 return -1;
985}
986
987
988/* in contrast to SB_GETTEXT*, WM_GETTEXT handles the text
989 * of the first part only (usual behaviour) */
990static INT
992{
993 INT len;
994
995 TRACE("\n");
996 if (!(infoPtr->parts[0].text))
997 return 0;
998
999 len = lstrlenW (infoPtr->parts[0].text);
1000
1001 if (!size)
1002 return len;
1003 else if (size > len) {
1004 lstrcpyW (buf, infoPtr->parts[0].text);
1005 return len;
1006 }
1007 else {
1008 memcpy (buf, infoPtr->parts[0].text, (size - 1) * sizeof(WCHAR));
1009 buf[size - 1] = 0;
1010 return size - 1;
1011 }
1012}
1013
1014
1015static BOOL
1017{
1018 if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
1019 && !(GetWindowLongW (infoPtr->Notify, GWL_STYLE) & WS_MAXIMIZE)) {
1020 RECT rect;
1021 POINT pt;
1022
1023 GetClientRect (infoPtr->Self, &rect);
1024
1025 pt.x = x;
1026 pt.y = y;
1027 ScreenToClient (infoPtr->Self, &pt);
1028
1029 if (pt.x >= rect.right - GetSystemMetrics(SM_CXVSCROLL))
1030 {
1031 if (GetWindowLongW( infoPtr->Self, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) return HTBOTTOMLEFT;
1032 else return HTBOTTOMRIGHT;
1033 }
1034 }
1035
1036 return HTERROR;
1037}
1038
1039
1040static LRESULT
1042{
1043 PAINTSTRUCT ps;
1044
1045 TRACE("\n");
1046 if (hdc) return STATUSBAR_Refresh (infoPtr, hdc);
1047 hdc = BeginPaint (infoPtr->Self, &ps);
1048 STATUSBAR_Refresh (infoPtr, hdc);
1049 EndPaint (infoPtr->Self, &ps);
1050
1051 return 0;
1052}
1053
1054
1055static LRESULT
1057{
1058 infoPtr->hFont = font;
1059 TRACE("%p\n", infoPtr->hFont);
1060
1061 infoPtr->height = STATUSBAR_ComputeHeight(infoPtr);
1062 SendMessageW(infoPtr->Self, WM_SIZE, 0, 0); /* update size */
1063 if (redraw)
1064 InvalidateRect(infoPtr->Self, NULL, FALSE);
1065
1066 return 0;
1067}
1068
1069
1070static BOOL
1072{
1073 STATUSWINDOWPART *part;
1074 int len;
1075
1076 TRACE("\n");
1077 if (infoPtr->numParts == 0)
1078 return FALSE;
1079
1080 part = &infoPtr->parts[0];
1081 /* duplicate string */
1082 Free (part->text);
1083 part->text = 0;
1084
1085 if (text && (len = lstrlenW((LPCWSTR)text))) {
1086 part->text = Alloc ((len+1)*sizeof(WCHAR));
1087 if (!part->text) return FALSE;
1088 lstrcpyW (part->text, (LPCWSTR)text);
1089 }
1090
1091 InvalidateRect(infoPtr->Self, &part->bound, FALSE);
1092
1093 return TRUE;
1094}
1095
1096
1097static BOOL
1099{
1100 INT width, x, y;
1101 RECT parent_rect;
1102
1103 /* Need to resize width to match parent */
1104 TRACE("flags %04x\n", flags);
1105
1106 if (flags != SIZE_RESTORED && flags != SIZE_MAXIMIZED) {
1107 WARN("flags MUST be SIZE_RESTORED or SIZE_MAXIMIZED\n");
1108 return FALSE;
1109 }
1110
1111 if (GetWindowLongW(infoPtr->Self, GWL_STYLE) & CCS_NORESIZE) return FALSE;
1112
1113 /* width and height don't apply */
1114 if (!GetClientRect (infoPtr->Notify, &parent_rect))
1115 return FALSE;
1116
1117 width = parent_rect.right - parent_rect.left;
1118 x = parent_rect.left;
1119 y = parent_rect.bottom - infoPtr->height;
1120 MoveWindow (infoPtr->Self, x, y, width, infoPtr->height, TRUE);
1121 STATUSBAR_SetPartBounds (infoPtr);
1122#ifdef __REACTOS__
1123 parent_rect = infoPtr->parts[infoPtr->numParts - 1].bound;
1124 InvalidateRect(infoPtr->Self, &parent_rect, TRUE);
1125#endif
1126 return TRUE;
1127}
1128
1129
1130/* update theme after a WM_THEMECHANGED message */
1131static LRESULT theme_changed (const STATUS_INFO* infoPtr)
1132{
1133 HTHEME theme = GetWindowTheme (infoPtr->Self);
1134 CloseThemeData (theme);
1135 OpenThemeData (infoPtr->Self, themeClass);
1136 return 0;
1137}
1138
1139
1140static LRESULT
1142{
1143 if (cmd == NF_REQUERY) {
1144 INT i = SendMessageW(from, WM_NOTIFYFORMAT, (WPARAM)infoPtr->Self, NF_QUERY);
1145 infoPtr->bUnicode = (i == NFR_UNICODE);
1146 }
1147 return infoPtr->bUnicode ? NFR_UNICODE : NFR_ANSI;
1148}
1149
1150
1151static LRESULT
1153{
1154 NMMOUSE nm;
1155
1156 TRACE("code %04x, lParam=%lx\n", code, lParam);
1157 nm.hdr.hwndFrom = infoPtr->Self;
1158 nm.hdr.idFrom = GetWindowLongPtrW(infoPtr->Self, GWLP_ID);
1159 nm.hdr.code = code;
1160 nm.pt.x = (short)LOWORD(lParam);
1161 nm.pt.y = (short)HIWORD(lParam);
1162 nm.dwItemSpec = STATUSBAR_InternalHitTest(infoPtr, &nm.pt);
1163 nm.dwItemData = 0;
1164 nm.dwHitInfo = 0x30000; /* seems constant */
1165
1166 /* Do default processing if WM_NOTIFY returns zero */
1167 if(!SendMessageW(infoPtr->Notify, WM_NOTIFY, nm.hdr.idFrom, (LPARAM)&nm))
1168 {
1169 return DefWindowProcW(infoPtr->Self, msg, wParam, lParam);
1170 }
1171 return 0;
1172}
1173
1174
1175
1176static LRESULT WINAPI
1178{
1179 STATUS_INFO *infoPtr = (STATUS_INFO *)GetWindowLongPtrW (hwnd, 0);
1180 INT nPart = ((INT) wParam) & 0x00ff;
1181 LRESULT res;
1182
1183 TRACE("hwnd=%p msg=%x wparam=%lx lparam=%lx\n", hwnd, msg, wParam, lParam);
1184 if (!infoPtr && msg != WM_CREATE)
1185 return DefWindowProcW (hwnd, msg, wParam, lParam);
1186
1187 switch (msg) {
1188 case SB_GETBORDERS:
1189 return STATUSBAR_GetBorders (infoPtr, (INT *)lParam);
1190
1191 case SB_GETICON:
1192 return (LRESULT)STATUSBAR_GetIcon (infoPtr, nPart);
1193
1194 case SB_GETPARTS:
1195 return STATUSBAR_GetParts (infoPtr, (INT)wParam, (INT *)lParam);
1196
1197 case SB_GETRECT:
1198 return STATUSBAR_GetRect (infoPtr, nPart, (LPRECT)lParam);
1199
1200 case SB_GETTEXTA:
1201 return STATUSBAR_GetTextA (infoPtr, nPart, (LPSTR)lParam);
1202
1203 case SB_GETTEXTW:
1204 return STATUSBAR_GetTextW (infoPtr, nPart, (LPWSTR)lParam);
1205
1206 case SB_GETTEXTLENGTHA:
1207 case SB_GETTEXTLENGTHW:
1208 return STATUSBAR_GetTextLength (infoPtr, nPart);
1209
1210 case SB_GETTIPTEXTA:
1212
1213 case SB_GETTIPTEXTW:
1215
1217 return infoPtr->bUnicode;
1218
1219 case SB_ISSIMPLE:
1220 return infoPtr->simple;
1221
1222 case SB_SETBORDERS:
1223 return STATUSBAR_SetBorders (infoPtr, (INT *)lParam);
1224
1225 case SB_SETBKCOLOR:
1226 return STATUSBAR_SetBkColor (infoPtr, (COLORREF)lParam);
1227
1228 case SB_SETICON:
1229 return STATUSBAR_SetIcon (infoPtr, nPart, (HICON)lParam);
1230
1231 case SB_SETMINHEIGHT:
1232 return STATUSBAR_SetMinHeight (infoPtr, (INT)wParam);
1233
1234 case SB_SETPARTS:
1235 return STATUSBAR_SetParts (infoPtr, (INT)wParam, (LPINT)lParam);
1236
1237 case SB_SETTEXTA:
1238 return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPWSTR)lParam, FALSE);
1239
1240 case SB_SETTEXTW:
1241 return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPWSTR)lParam, TRUE);
1242
1243 case SB_SETTIPTEXTA:
1244 return STATUSBAR_SetTipTextA (infoPtr, (INT)wParam, (LPSTR)lParam);
1245
1246 case SB_SETTIPTEXTW:
1247 return STATUSBAR_SetTipTextW (infoPtr, (INT)wParam, (LPWSTR)lParam);
1248
1250 return STATUSBAR_SetUnicodeFormat (infoPtr, (BOOL)wParam);
1251
1252 case SB_SIMPLE:
1253 return STATUSBAR_Simple (infoPtr, (BOOL)wParam);
1254
1255 case WM_CREATE:
1257
1258 case WM_DESTROY:
1259 return STATUSBAR_WMDestroy (infoPtr);
1260
1261 case WM_GETFONT:
1262 return (LRESULT)(infoPtr->hFont? infoPtr->hFont : infoPtr->hDefaultFont);
1263
1264 case WM_GETTEXT:
1265 return STATUSBAR_WMGetText (infoPtr, (INT)wParam, (LPWSTR)lParam);
1266
1267 case WM_GETTEXTLENGTH:
1268 return LOWORD(STATUSBAR_GetTextLength (infoPtr, 0));
1269
1270 case WM_LBUTTONDBLCLK:
1272
1273 case WM_LBUTTONUP:
1275
1276 case WM_MOUSEMOVE:
1277 return STATUSBAR_Relay2Tip (infoPtr, msg, wParam, lParam);
1278
1279 case WM_NCHITTEST:
1280 res = STATUSBAR_WMNCHitTest(infoPtr, (short)LOWORD(lParam),
1281 (short)HIWORD(lParam));
1282 if (res != HTERROR) return res;
1283 return DefWindowProcW (hwnd, msg, wParam, lParam);
1284
1285 case WM_NCLBUTTONUP:
1286 case WM_NCLBUTTONDOWN:
1287 PostMessageW (infoPtr->Notify, msg, wParam, lParam);
1288 return 0;
1289
1290 case WM_NOTIFYFORMAT:
1291 return STATUSBAR_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam);
1292
1293 case WM_PRINTCLIENT:
1294 case WM_PAINT:
1295 return STATUSBAR_WMPaint (infoPtr, (HDC)wParam);
1296
1297 case WM_RBUTTONDBLCLK:
1299
1300 case WM_RBUTTONUP:
1302
1303 case WM_SETFONT:
1304 return STATUSBAR_WMSetFont (infoPtr, (HFONT)wParam, LOWORD(lParam));
1305
1306 case WM_SETTEXT:
1307 return STATUSBAR_WMSetText (infoPtr, (LPCSTR)lParam);
1308
1309 case WM_SIZE:
1310 if (STATUSBAR_WMSize (infoPtr, (WORD)wParam)) return 0;
1311 return DefWindowProcW (hwnd, msg, wParam, lParam);
1312
1313 case WM_SYSCOLORCHANGE:
1315 return 0;
1316
1317 case WM_THEMECHANGED:
1318 return theme_changed (infoPtr);
1319
1320 default:
1321 if ((msg >= WM_USER) && (msg < WM_APP) && !COMCTL32_IsReflectedMessage(msg))
1322 ERR("unknown msg %04x wp=%04lx lp=%08lx\n",
1323 msg, wParam, lParam);
1324 return DefWindowProcW (hwnd, msg, wParam, lParam);
1325 }
1326}
1327
1328
1329/***********************************************************************
1330 * STATUS_Register [Internal]
1331 *
1332 * Registers the status window class.
1333 */
1334
1335void
1337{
1338 WNDCLASSW wndClass;
1339
1340 ZeroMemory (&wndClass, sizeof(WNDCLASSW));
1342 wndClass.lpfnWndProc = StatusWindowProc;
1343 wndClass.cbClsExtra = 0;
1344 wndClass.cbWndExtra = sizeof(STATUS_INFO *);
1345 wndClass.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
1346 wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
1348
1349 RegisterClassW (&wndClass);
1350}
1351
1352
1353/***********************************************************************
1354 * STATUS_Unregister [Internal]
1355 *
1356 * Unregisters the status window class.
1357 */
1358
1359void
1361{
1363}
std::map< E_STRING, PART_TEST > parts
Definition: LocaleTests.cpp:67
Arabic default style
Definition: afstyles.h:94
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL COMCTL32_IsReflectedMessage(UINT uMsg) DECLSPEC_HIDDEN
Definition: commctrl.c:1755
void COMCTL32_GetFontMetrics(HFONT hFont, TEXTMETRICW *ptm) DECLSPEC_HIDDEN
Definition: commctrl.c:1728
VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN
Definition: commctrl.c:1593
void WINAPI DrawStatusTextW(HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style)
Definition: commctrl.c:677
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
static LRESULT STATUSBAR_SendMouseNotify(const STATUS_INFO *infoPtr, UINT code, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: status.c:1152
static LRESULT STATUSBAR_SetUnicodeFormat(STATUS_INFO *infoPtr, BOOL bUnicode)
Definition: status.c:830
#define HORZ_GAP
Definition: status.c:87
static LRESULT STATUSBAR_GetTipTextW(const STATUS_INFO *infoPtr, INT id, LPWSTR tip, INT size)
Definition: status.c:563
static BOOL STATUSBAR_SetMinHeight(STATUS_INFO *infoPtr, INT height)
Definition: status.c:627
static LRESULT theme_changed(const STATUS_INFO *infoPtr)
Definition: status.c:1131
static LRESULT STATUSBAR_WMPaint(STATUS_INFO *infoPtr, HDC hdc)
Definition: status.c:1041
static LRESULT STATUSBAR_WMCreate(HWND hwnd, const CREATESTRUCTA *lpCreate)
Definition: status.c:893
static INT STATUSBAR_GetParts(const STATUS_INFO *infoPtr, INT num_parts, INT parts[])
Definition: status.c:428
static UINT STATUSBAR_ComputeHeight(STATUS_INFO *infoPtr)
Definition: status.c:103
static COLORREF STATUSBAR_SetBkColor(STATUS_INFO *infoPtr, COLORREF color)
Definition: status.c:586
static LRESULT STATUSBAR_Refresh(STATUS_INFO *infoPtr, HDC hdc)
Definition: status.c:256
static BOOL STATUSBAR_WMSetText(const STATUS_INFO *infoPtr, LPCSTR text)
Definition: status.c:1071
#define HORZ_BORDER
Definition: status.c:85
static BOOL STATUSBAR_WMSize(STATUS_INFO *infoPtr, WORD flags)
Definition: status.c:1098
static LRESULT STATUSBAR_GetTextW(STATUS_INFO *infoPtr, INT nPart, LPWSTR buf)
Definition: status.c:490
static BOOL STATUSBAR_Simple(STATUS_INFO *infoPtr, BOOL simple)
Definition: status.c:842
static LRESULT STATUSBAR_Relay2Tip(const STATUS_INFO *infoPtr, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: status.c:370
static int STATUSBAR_InternalHitTest(const STATUS_INFO *infoPtr, const POINT *pt)
Definition: status.c:309
static void STATUSBAR_SetPartBounds(STATUS_INFO *infoPtr)
Definition: status.c:324
static INT STATUSBAR_WMGetText(const STATUS_INFO *infoPtr, INT size, LPWSTR buf)
Definition: status.c:991
static BOOL STATUSBAR_SetTextT(STATUS_INFO *infoPtr, INT nPart, WORD style, LPWSTR text, BOOL isW)
Definition: status.c:712
static LRESULT STATUSBAR_GetTipTextA(const STATUS_INFO *infoPtr, INT id, LPSTR tip, INT size)
Definition: status.c:541
static BOOL STATUSBAR_GetRect(const STATUS_INFO *infoPtr, INT nPart, LPRECT rect)
Definition: status.c:447
static BOOL STATUSBAR_SetParts(STATUS_INFO *infoPtr, INT count, LPINT parts)
Definition: status.c:639
static LRESULT STATUSBAR_SetTipTextW(const STATUS_INFO *infoPtr, INT id, LPWSTR text)
Definition: status.c:812
static void STATUSBAR_RefreshPart(const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
Definition: status.c:222
static LRESULT STATUSBAR_SetTipTextA(const STATUS_INFO *infoPtr, INT id, LPSTR text)
Definition: status.c:794
static LRESULT STATUSBAR_WMDestroy(STATUS_INFO *infoPtr)
Definition: status.c:863
static const WCHAR themeClass[]
Definition: status.c:89
static void STATUSBAR_DrawSizeGrip(HTHEME theme, HDC hdc, LPRECT lpRect)
Definition: status.c:134
static HICON STATUSBAR_GetIcon(const STATUS_INFO *infoPtr, INT nPart)
Definition: status.c:413
static LRESULT STATUSBAR_GetTextLength(STATUS_INFO *infoPtr, INT nPart)
Definition: status.c:516
static BOOL STATUSBAR_GetBorders(const STATUS_INFO *infoPtr, INT out[])
Definition: status.c:388
static BOOL STATUSBAR_WMNCHitTest(const STATUS_INFO *infoPtr, INT x, INT y)
Definition: status.c:1016
void STATUS_Register(void)
Definition: status.c:1336
static void STATUSBAR_DrawPart(const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
Definition: status.c:160
static LRESULT STATUSBAR_GetTextA(STATUS_INFO *infoPtr, INT nPart, LPSTR buf)
Definition: status.c:461
static LRESULT STATUSBAR_WMSetFont(STATUS_INFO *infoPtr, HFONT font, BOOL redraw)
Definition: status.c:1056
static BOOL STATUSBAR_SetIcon(STATUS_INFO *infoPtr, INT nPart, HICON hIcon)
Definition: status.c:600
#define VERT_BORDER
Definition: status.c:86
void STATUS_Unregister(void)
Definition: status.c:1360
static LRESULT WINAPI StatusWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: status.c:1177
static BOOL STATUSBAR_SetBorders(STATUS_INFO *infoPtr, const INT in[])
Definition: status.c:400
static LRESULT STATUSBAR_NotifyFormat(STATUS_INFO *infoPtr, HWND from, INT cmd)
Definition: status.c:1141
#define CP_ACP
Definition: compat.h:109
#define lstrcpynA
Definition: compat.h:751
#define lstrcpyW
Definition: compat.h:749
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243
#define debugstr_t
Definition: utils.cpp:194
const WCHAR * text
Definition: package.c:1794
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
HRESULT WINAPI GetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz)
Definition: draw.c:1821
HRESULT WINAPI GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pContentRect, RECT *pExtentRect)
Definition: draw.c:1572
HRESULT WINAPI DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT *pRect)
Definition: draw.c:1500
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:835
HTHEME WINAPI GetWindowTheme(HWND hwnd)
Definition: system.c:851
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define pt(x, y)
Definition: drawing.c:79
#define ULONG_PTR
Definition: config.h:101
#define WM_APP
Definition: eventvwr.h:73
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
pKey DeleteObject()
GLint GLint GLsizei GLsizei GLsizei GLint border
Definition: gl.h:1546
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLuint res
Definition: glext.h:9613
GLuint color
Definition: glext.h:6243
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint in
Definition: glext.h:9616
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
GLuint64EXT * result
Definition: glext.h:11304
GLuint id
Definition: glext.h:5910
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define iswprint(_c)
Definition: ctype.h:672
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
if(dx< 0)
Definition: linetemp.h:194
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static HICON
Definition: imagelist.c:80
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
HICON hIcon
Definition: msconfig.c:44
Definition: mk_font.cpp:20
unsigned int UINT
Definition: ndis.h:50
#define LRESULT
Definition: ole.h:14
#define LOWORD(l)
Definition: pedump.c:82
#define WS_MAXIMIZE
Definition: pedump.c:623
#define WS_POPUP
Definition: pedump.c:616
#define INT
Definition: polytest.cpp:20
#define NM_RDBLCLK
Definition: commctrl.h:134
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define SB_SIMPLE
Definition: commctrl.h:1963
#define SB_GETTEXTA
Definition: commctrl.h:1948
#define SB_GETTEXTLENGTHA
Definition: commctrl.h:1950
#define SB_GETRECT
Definition: commctrl.h:1964
#define NM_DBLCLK
Definition: commctrl.h:131
#define SB_GETPARTS
Definition: commctrl.h:1960
#define SB_SETBKCOLOR
Definition: commctrl.h:1981
#define SBT_NOBORDERS
Definition: commctrl.h:1976
#define SBT_POPOUT
Definition: commctrl.h:1977
#define TTM_RELAYEVENT
Definition: commctrl.h:1797
#define SB_GETICON
Definition: commctrl.h:1971
#define TTM_DELTOOLW
Definition: commctrl.h:1794
struct tagTOOLINFOW TTTOOLINFOW
#define TTM_GETTEXTW
Definition: commctrl.h:1808
#define TOOLTIPS_CLASSW
Definition: commctrl.h:1707
#define STATUSCLASSNAMEW
Definition: commctrl.h:1941
#define SB_GETTIPTEXTA
Definition: commctrl.h:1969
#define NM_TOOLTIPSCREATED
Definition: commctrl.h:144
#define NM_CLICK
Definition: commctrl.h:130
#define SB_SETICON
Definition: commctrl.h:1966
#define SB_GETTEXTLENGTHW
Definition: commctrl.h:1951
#define SB_SETTEXTA
Definition: commctrl.h:1946
#define SB_SETUNICODEFORMAT
Definition: commctrl.h:1972
#define TTM_NEWTOOLRECTW
Definition: commctrl.h:1796
#define INFOTIPSIZE
Definition: commctrl.h:124
#define SB_GETTEXTW
Definition: commctrl.h:1949
#define TTM_GETTOOLCOUNT
Definition: commctrl.h:1811
#define TTM_ADDTOOLW
Definition: commctrl.h:1792
#define TTS_ALWAYSTIP
Definition: commctrl.h:1757
#define TTM_UPDATETIPTEXTA
Definition: commctrl.h:1809
#define SB_ISSIMPLE
Definition: commctrl.h:1965
#define SBT_TOOLTIPS
Definition: commctrl.h:1930
#define CLR_DEFAULT
Definition: commctrl.h:320
#define SB_GETTIPTEXTW
Definition: commctrl.h:1970
#define SB_SETTIPTEXTW
Definition: commctrl.h:1968
#define SB_SETMINHEIGHT
Definition: commctrl.h:1962
#define TTM_UPDATETIPTEXTW
Definition: commctrl.h:1810
#define SB_SETTIPTEXTA
Definition: commctrl.h:1967
#define NM_RCLICK
Definition: commctrl.h:133
#define SBN_SIMPLEMODECHANGE
Definition: commctrl.h:1983
#define SB_GETUNICODEFORMAT
Definition: commctrl.h:1973
#define SB_SETPARTS
Definition: commctrl.h:1959
#define CCS_NORESIZE
Definition: commctrl.h:2250
#define SB_SETTEXTW
Definition: commctrl.h:1947
#define SBARS_SIZEGRIP
Definition: commctrl.h:1928
#define TTM_GETTEXTA
Definition: commctrl.h:1807
#define SB_GETBORDERS
Definition: commctrl.h:1961
struct tagTOOLINFOA TTTOOLINFOA
#define SBT_OWNERDRAW
Definition: commctrl.h:1975
void redraw(int x, int y, int cx, int cy)
Definition: qtewin.cpp:1248
#define SB_SETBORDERS
Definition: commctrl.h:60
static FILE * out
Definition: regtests2xml.c:44
#define WM_PRINTCLIENT
Definition: richedit.h:70
#define WM_NOTIFY
Definition: richedit.h:61
#define TRACE(s)
Definition: solgame.cpp:4
CardRegion * from
Definition: spigame.cpp:19
& rect
Definition: startmenu.cpp:1413
LPWSTR text
Definition: status.c:55
HICON hIcon
Definition: status.c:56
INT verticalBorder
Definition: status.c:75
HFONT hFont
Definition: status.c:68
UINT height
Definition: status.c:64
BOOL simple
Definition: status.c:66
WORD numParts
Definition: status.c:63
UINT minHeight
Definition: status.c:65
COLORREF clrBk
Definition: status.c:70
STATUSWINDOWPART part0
Definition: status.c:72
HWND Notify
Definition: status.c:62
HFONT hDefaultFont
Definition: status.c:69
HWND Self
Definition: status.c:61
STATUSWINDOWPART * parts
Definition: status.c:73
INT horizontalBorder
Definition: status.c:74
BOOL bUnicode
Definition: status.c:71
HWND hwndToolTip
Definition: status.c:67
INT horizontalGap
Definition: status.c:76
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
LPCWSTR lpszClassName
Definition: winuser.h:3188
HBRUSH hbrBackground
Definition: winuser.h:3186
int cbClsExtra
Definition: winuser.h:3181
UINT style
Definition: winuser.h:3179
WNDPROC lpfnWndProc
Definition: winuser.h:3180
int cbWndExtra
Definition: winuser.h:3182
HCURSOR hCursor
Definition: winuser.h:3185
Definition: ftp_var.h:139
Definition: inflate.c:139
LPCSTR lpszName
Definition: winuser.h:2952
ULONG_PTR itemData
Definition: winuser.h:3096
UINT_PTR idFrom
Definition: winuser.h:3161
UINT code
Definition: winuser.h:3162
HWND hwndFrom
Definition: winuser.h:3160
POINT pt
Definition: commctrl.h:166
DWORD_PTR dwItemData
Definition: commctrl.h:165
DWORD_PTR dwItemSpec
Definition: commctrl.h:164
NMHDR hdr
Definition: commctrl.h:163
LPARAM dwHitInfo
Definition: commctrl.h:167
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
HINSTANCE hinst
Definition: commctrl.h:1733
LPSTR lpszText
Definition: commctrl.h:1734
UINT_PTR uId
Definition: commctrl.h:1731
HINSTANCE hinst
Definition: commctrl.h:1745
UINT_PTR uId
Definition: commctrl.h:1743
LPWSTR lpszText
Definition: commctrl.h:1746
Definition: time.h:68
#define max(a, b)
Definition: svc.c:63
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
uint32_t DWORD_PTR
Definition: typedefs.h:65
int32_t INT
Definition: typedefs.h:58
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define HIWORD(l)
Definition: typedefs.h:247
static const WCHAR isW[]
Definition: lex.c:62
@ SP_GRIPPERPANE
Definition: vsstyle.h:1199
@ SP_PANE
Definition: vsstyle.h:1198
@ SP_GRIPPER
Definition: vsstyle.h:1200
#define ZeroMemory
Definition: winbase.h:1712
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
int * LPINT
Definition: windef.h:178
DWORD COLORREF
Definition: windef.h:300
#define WINAPI
Definition: msvc.h:6
BOOL WINAPI RectVisible(_In_ HDC, _In_ LPCRECT)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define DI_NORMAL
Definition: wingdi.h:72
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define WM_PAINT
Definition: winuser.h:1623
#define WS_EX_LAYOUTRTL
Definition: winuser.h:390
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CS_VREDRAW
Definition: winuser.h:658
#define WM_GETTEXTLENGTH
Definition: winuser.h:1622
#define DFC_SCROLL
Definition: winuser.h:475
#define DT_NOPREFIX
Definition: winuser.h:537
#define BDR_SUNKENOUTER
Definition: winuser.h:443
#define GetWindowLongPtrW
Definition: winuser.h:4832
DWORD WINAPI GetMessagePos(void)
Definition: message.c:1351
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SM_CYSIZE
Definition: winuser.h:995
#define WM_CREATE
Definition: winuser.h:1611
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define SM_CXVSCROLL
Definition: winuser.h:964
#define WM_SIZE
Definition: winuser.h:1614
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define HTERROR
Definition: winuser.h:2475
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define DT_SINGLELINE
Definition: winuser.h:540
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1781
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:687
#define WM_NCHITTEST
Definition: winuser.h:1689
#define WM_RBUTTONUP
Definition: winuser.h:1783
#define DFCS_SCROLLSIZEGRIP
Definition: winuser.h:494
#define WM_RBUTTONDBLCLK
Definition: winuser.h:1784
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BF_ADJUST
Definition: winuser.h:470
#define WM_MOUSEMOVE
Definition: winuser.h:1778
#define WM_GETTEXT
Definition: winuser.h:1621
#define CS_DBLCLKS
Definition: winuser.h:651
#define NF_REQUERY
Definition: winuser.h:2464
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1629
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2157
#define WM_GETFONT
Definition: winuser.h:1654
#define GWLP_HINSTANCE
Definition: winuser.h:859
#define SM_CYHSCROLL
Definition: winuser.h:965
#define WM_DRAWITEM
Definition: winuser.h:1648
#define WM_SETTEXT
Definition: winuser.h:1620
#define SM_CYBORDER
Definition: winuser.h:968
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define SIZE_MAXIMIZED
Definition: winuser.h:2510
#define WM_SETFONT
Definition: winuser.h:1653
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:2080
BOOL WINAPI UpdateWindow(_In_ HWND)
#define HTBOTTOMRIGHT
Definition: winuser.h:2498
HDC WINAPI GetDC(_In_opt_ HWND)
#define WM_LBUTTONUP
Definition: winuser.h:1780
LONG WINAPI GetMessageTime(void)
Definition: message.c:1361
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define DT_VCENTER
Definition: winuser.h:543
#define CW_USEDEFAULT
Definition: winuser.h:225
#define CS_GLOBALCLASS
Definition: winuser.h:652
#define NFR_ANSI
Definition: winuser.h:2461
#define SIZE_RESTORED
Definition: winuser.h:2508
#define HTBOTTOMLEFT
Definition: winuser.h:2497
#define WM_NCLBUTTONUP
Definition: winuser.h:1696
#define GWLP_ID
Definition: winuser.h:863
#define WM_USER
Definition: winuser.h:1898
#define BDR_RAISEDOUTER
Definition: winuser.h:442
#define WM_DESTROY
Definition: winuser.h:1612
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define SetWindowLongPtrW
Definition: winuser.h:5358
#define NFR_UNICODE
Definition: winuser.h:2462
#define BF_RECT
Definition: winuser.h:462
#define GWL_STYLE
Definition: winuser.h:855
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1695
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define NF_QUERY
Definition: winuser.h:2463
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define COLOR_BTNFACE
Definition: winuser.h:931
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define GWL_EXSTYLE
Definition: winuser.h:854
#define COLOR_3DFACE
Definition: winuser.h:932
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175