quartz: Free two assert calls from having side effects.
[wine/testsucceed.git] / dlls / comctl32 / status.c
blob1cb69ebad1f1f5117df6e7bea21af9372923e7a3
1 /*
2 * Interface code to StatusWindow widget/control
4 * Copyright 1996 Bruce Milner
5 * Copyright 1998, 1999 Eric Kohl
6 * Copyright 2002 Dimitrie O. Paun
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.
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.
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
22 * NOTE
24 * This code was audited for completeness against the documented features
25 * of Comctl32.dll version 6.0 on Sep. 24, 2002, by Dimitrie O. Paun.
27 * Unless otherwise noted, we believe this code to be complete, as per
28 * the specification mentioned above.
29 * If you discover missing features, or bugs, please note them below.
31 * TODO:
32 * -- CCS_BOTTOM (default)
33 * -- CCS_LEFT
34 * -- CCS_NODIVIDER
35 * -- CCS_NOMOVEX
36 * -- CCS_NOMOVEY
37 * -- CCS_NOPARENTALIGN
38 * -- CCS_RIGHT
39 * -- CCS_TOP
40 * -- CCS_VERT (defaults to RIGHT)
43 #include <stdarg.h>
44 #include <string.h>
46 #include "windef.h"
47 #include "winbase.h"
48 #include "wine/unicode.h"
49 #include "wingdi.h"
50 #include "winuser.h"
51 #include "winnls.h"
52 #include "commctrl.h"
53 #include "comctl32.h"
54 #include "uxtheme.h"
55 #include "vssym32.h"
56 #include "wine/debug.h"
58 WINE_DEFAULT_DEBUG_CHANNEL(statusbar);
60 typedef struct
62 INT x;
63 INT style;
64 RECT bound;
65 LPWSTR text;
66 HICON hIcon;
67 } STATUSWINDOWPART;
69 typedef struct
71 HWND Self;
72 HWND Notify;
73 WORD numParts;
74 UINT height;
75 UINT minHeight; /* at least MIN_PANE_HEIGHT, can be increased by SB_SETMINHEIGHT */
76 BOOL simple;
77 HWND hwndToolTip;
78 HFONT hFont;
79 HFONT hDefaultFont;
80 COLORREF clrBk; /* background color */
81 BOOL bUnicode; /* notify format. TRUE if notifies in Unicode */
82 STATUSWINDOWPART part0; /* simple window */
83 STATUSWINDOWPART* parts;
84 INT horizontalBorder;
85 INT verticalBorder;
86 INT horizontalGap;
87 } STATUS_INFO;
90 * Run tests using Waite Group Windows95 API Bible Vol. 1&2
91 * The second cdrom contains executables drawstat.exe, gettext.exe,
92 * simple.exe, getparts.exe, setparts.exe, statwnd.exe
95 #define HORZ_BORDER 0
96 #define VERT_BORDER 2
97 #define HORZ_GAP 2
99 static const WCHAR themeClass[] = { 'S','t','a','t','u','s',0 };
101 /* prototype */
102 static void
103 STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr);
104 static LRESULT
105 STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd);
107 static inline LPCSTR debugstr_t(LPCWSTR text, BOOL isW)
109 return isW ? debugstr_w(text) : debugstr_a((LPCSTR)text);
112 static UINT
113 STATUSBAR_ComputeHeight(STATUS_INFO *infoPtr)
115 HTHEME theme;
116 UINT height;
117 TEXTMETRICW tm;
118 int margin;
120 COMCTL32_GetFontMetrics(infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont, &tm);
121 margin = (tm.tmInternalLeading ? tm.tmInternalLeading : 2);
122 height = max(tm.tmHeight + margin + 2*GetSystemMetrics(SM_CYBORDER), infoPtr->minHeight) + infoPtr->verticalBorder;
124 if ((theme = GetWindowTheme(infoPtr->Self)))
126 /* Determine bar height from theme such that the content area is
127 * textHeight pixels large */
128 HDC hdc = GetDC(infoPtr->Self);
129 RECT r;
130 memset (&r, 0, sizeof (r));
131 r.bottom = max(infoPtr->minHeight, tm.tmHeight);
132 if (SUCCEEDED(GetThemeBackgroundExtent(theme, hdc, SP_PANE, 0, &r, &r)))
134 height = r.bottom - r.top;
136 ReleaseDC(infoPtr->Self, hdc);
139 TRACE(" textHeight=%d+%d, final height=%d\n", tm.tmHeight, tm.tmInternalLeading, height);
140 return height;
143 static void
144 STATUSBAR_DrawSizeGrip (HTHEME theme, HDC hdc, LPRECT lpRect)
146 HPEN hPenFace, hPenShadow, hPenHighlight, hOldPen;
147 POINT pt;
148 INT i;
150 TRACE("draw size grip %s\n", wine_dbgstr_rect(lpRect));
152 if (theme)
154 RECT gripperRect;
155 SIZE gripperSize;
156 gripperRect = *lpRect;
157 if (SUCCEEDED (GetThemePartSize (theme, hdc, SP_GRIPPER, 0, lpRect,
158 TS_DRAW, &gripperSize)))
160 gripperRect.left = gripperRect.right - gripperSize.cx;
161 gripperRect.top = gripperRect.bottom - gripperSize.cy;
162 if (SUCCEEDED (DrawThemeBackground(theme, hdc, SP_GRIPPER, 0, &gripperRect, NULL)))
163 return;
167 pt.x = lpRect->right - 1;
168 pt.y = lpRect->bottom - 1;
170 hPenFace = CreatePen( PS_SOLID, 1, comctl32_color.clr3dFace);
171 hOldPen = SelectObject( hdc, hPenFace );
172 MoveToEx (hdc, pt.x - 12, pt.y, NULL);
173 LineTo (hdc, pt.x, pt.y);
174 LineTo (hdc, pt.x, pt.y - 13);
176 pt.x--;
177 pt.y--;
179 hPenShadow = CreatePen( PS_SOLID, 1, comctl32_color.clr3dShadow);
180 SelectObject( hdc, hPenShadow );
181 for (i = 1; i < 11; i += 4) {
182 MoveToEx (hdc, pt.x - i, pt.y, NULL);
183 LineTo (hdc, pt.x + 1, pt.y - i - 1);
185 MoveToEx (hdc, pt.x - i - 1, pt.y, NULL);
186 LineTo (hdc, pt.x + 1, pt.y - i - 2);
189 hPenHighlight = CreatePen( PS_SOLID, 1, comctl32_color.clr3dHilight);
190 SelectObject( hdc, hPenHighlight );
191 for (i = 3; i < 13; i += 4) {
192 MoveToEx (hdc, pt.x - i, pt.y, NULL);
193 LineTo (hdc, pt.x + 1, pt.y - i - 1);
196 SelectObject (hdc, hOldPen);
197 DeleteObject( hPenFace );
198 DeleteObject( hPenShadow );
199 DeleteObject( hPenHighlight );
203 static void
204 STATUSBAR_DrawPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
206 RECT r = part->bound;
207 UINT border = BDR_SUNKENOUTER;
208 HTHEME theme = GetWindowTheme (infoPtr->Self);
209 int themePart = SP_PANE;
211 TRACE("part bound %s\n", wine_dbgstr_rect(&r));
212 if (part->style & SBT_POPOUT)
213 border = BDR_RAISEDOUTER;
214 else if (part->style & SBT_NOBORDERS)
215 border = 0;
217 if (theme)
219 if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
220 && (infoPtr->simple || (itemID == (infoPtr->numParts-1))))
221 themePart = SP_GRIPPERPANE;
222 DrawThemeBackground(theme, hdc, themePart, 0, &r, NULL);
224 else
225 DrawEdge(hdc, &r, border, BF_RECT|BF_ADJUST);
227 if (part->style & SBT_OWNERDRAW) {
228 DRAWITEMSTRUCT dis;
230 dis.CtlID = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
231 dis.itemID = itemID;
232 dis.hwndItem = infoPtr->Self;
233 dis.hDC = hdc;
234 dis.rcItem = r;
235 dis.itemData = (ULONG_PTR)part->text;
236 SendMessageW (infoPtr->Notify, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis);
237 } else {
238 if (part->hIcon) {
239 INT cy = r.bottom - r.top;
241 r.left += 2;
242 DrawIconEx (hdc, r.left, r.top, part->hIcon, cy, cy, 0, 0, DI_NORMAL);
243 r.left += cy;
245 DrawStatusTextW (hdc, &r, part->text, SBT_NOBORDERS);
250 static void
251 STATUSBAR_RefreshPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
253 HBRUSH hbrBk;
254 HTHEME theme;
256 TRACE("item %d\n", itemID);
258 if (part->bound.right < part->bound.left) return;
260 if (!RectVisible(hdc, &part->bound))
261 return;
263 if ((theme = GetWindowTheme (infoPtr->Self)))
265 RECT cr;
266 GetClientRect (infoPtr->Self, &cr);
267 DrawThemeBackground(theme, hdc, 0, 0, &cr, &part->bound);
269 else
271 if (infoPtr->clrBk != CLR_DEFAULT)
272 hbrBk = CreateSolidBrush (infoPtr->clrBk);
273 else
274 hbrBk = GetSysColorBrush (COLOR_3DFACE);
275 FillRect(hdc, &part->bound, hbrBk);
276 if (infoPtr->clrBk != CLR_DEFAULT)
277 DeleteObject (hbrBk);
280 STATUSBAR_DrawPart (infoPtr, hdc, part, itemID);
284 static LRESULT
285 STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
287 int i;
288 RECT rect;
289 HBRUSH hbrBk;
290 HFONT hOldFont;
291 HTHEME theme;
293 TRACE("\n");
294 if (!IsWindowVisible(infoPtr->Self))
295 return 0;
297 STATUSBAR_SetPartBounds(infoPtr);
299 GetClientRect (infoPtr->Self, &rect);
301 if ((theme = GetWindowTheme (infoPtr->Self)))
303 DrawThemeBackground(theme, hdc, 0, 0, &rect, NULL);
305 else
307 if (infoPtr->clrBk != CLR_DEFAULT)
308 hbrBk = CreateSolidBrush (infoPtr->clrBk);
309 else
310 hbrBk = GetSysColorBrush (COLOR_3DFACE);
311 FillRect(hdc, &rect, hbrBk);
312 if (infoPtr->clrBk != CLR_DEFAULT)
313 DeleteObject (hbrBk);
316 hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
318 if (infoPtr->simple) {
319 STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->part0, 0);
320 } else {
321 for (i = 0; i < infoPtr->numParts; i++) {
322 STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->parts[i], i);
326 SelectObject (hdc, hOldFont);
328 if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
329 STATUSBAR_DrawSizeGrip (theme, hdc, &rect);
331 return 0;
335 static int
336 STATUSBAR_InternalHitTest(const STATUS_INFO *infoPtr, const POINT *pt)
338 int i;
339 if (infoPtr->simple)
340 return 255;
342 for (i = 0; i < infoPtr->numParts; i++)
343 if (pt->x >= infoPtr->parts[i].bound.left && pt->x <= infoPtr->parts[i].bound.right)
344 return i;
345 return -2;
349 static void
350 STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr)
352 STATUSWINDOWPART *part;
353 RECT rect, *r;
354 int i;
356 /* get our window size */
357 GetClientRect (infoPtr->Self, &rect);
358 TRACE("client wnd size is %s\n", wine_dbgstr_rect(&rect));
360 rect.left += infoPtr->horizontalBorder;
361 rect.top += infoPtr->verticalBorder;
363 /* set bounds for simple rectangle */
364 infoPtr->part0.bound = rect;
366 /* set bounds for non-simple rectangles */
367 for (i = 0; i < infoPtr->numParts; i++) {
368 part = &infoPtr->parts[i];
369 r = &infoPtr->parts[i].bound;
370 r->top = rect.top;
371 r->bottom = rect.bottom;
372 if (i == 0)
373 r->left = 0;
374 else
375 r->left = infoPtr->parts[i-1].bound.right + infoPtr->horizontalGap;
376 if (part->x == -1)
377 r->right = rect.right;
378 else
379 r->right = part->x;
381 if (infoPtr->hwndToolTip) {
382 TTTOOLINFOW ti;
384 ti.cbSize = sizeof(TTTOOLINFOW);
385 ti.hwnd = infoPtr->Self;
386 ti.uId = i;
387 ti.rect = *r;
388 SendMessageW (infoPtr->hwndToolTip, TTM_NEWTOOLRECTW,
389 0, (LPARAM)&ti);
395 static LRESULT
396 STATUSBAR_Relay2Tip (const STATUS_INFO *infoPtr, UINT uMsg,
397 WPARAM wParam, LPARAM lParam)
399 MSG msg;
401 msg.hwnd = infoPtr->Self;
402 msg.message = uMsg;
403 msg.wParam = wParam;
404 msg.lParam = lParam;
405 msg.time = GetMessageTime ();
406 msg.pt.x = (short)LOWORD(GetMessagePos ());
407 msg.pt.y = (short)HIWORD(GetMessagePos ());
409 return SendMessageW (infoPtr->hwndToolTip, TTM_RELAYEVENT, 0, (LPARAM)&msg);
413 static BOOL
414 STATUSBAR_GetBorders (const STATUS_INFO *infoPtr, INT out[])
416 TRACE("\n");
417 out[0] = infoPtr->horizontalBorder;
418 out[1] = infoPtr->verticalBorder;
419 out[2] = infoPtr->horizontalGap;
421 return TRUE;
425 static BOOL
426 STATUSBAR_SetBorders (STATUS_INFO *infoPtr, const INT in[])
428 TRACE("\n");
429 infoPtr->horizontalBorder = in[0];
430 infoPtr->verticalBorder = in[1];
431 infoPtr->horizontalGap = in[2];
432 InvalidateRect(infoPtr->Self, NULL, FALSE);
434 return TRUE;
438 static HICON
439 STATUSBAR_GetIcon (const STATUS_INFO *infoPtr, INT nPart)
441 TRACE("%d\n", nPart);
442 /* MSDN says: "simple parts are indexed with -1" */
443 if ((nPart < -1) || (nPart >= infoPtr->numParts))
444 return 0;
446 if (nPart == -1)
447 return (infoPtr->part0.hIcon);
448 else
449 return (infoPtr->parts[nPart].hIcon);
453 static INT
454 STATUSBAR_GetParts (const STATUS_INFO *infoPtr, INT num_parts, INT parts[])
456 INT i;
458 TRACE("(%d)\n", num_parts);
459 if (parts) {
460 for (i = 0; i < num_parts; i++) {
461 parts[i] = infoPtr->parts[i].x;
464 return infoPtr->numParts;
468 static BOOL
469 STATUSBAR_GetRect (const STATUS_INFO *infoPtr, INT nPart, LPRECT rect)
471 TRACE("part %d\n", nPart);
472 if(nPart >= infoPtr->numParts || nPart < 0)
473 return FALSE;
474 if (infoPtr->simple)
475 *rect = infoPtr->part0.bound;
476 else
477 *rect = infoPtr->parts[nPart].bound;
478 return TRUE;
482 static LRESULT
483 STATUSBAR_GetTextA (STATUS_INFO *infoPtr, INT nPart, LPSTR buf)
485 STATUSWINDOWPART *part;
486 LRESULT result;
488 TRACE("part %d\n", nPart);
490 /* MSDN says: "simple parts use index of 0", so this check is ok. */
491 if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
493 if (infoPtr->simple)
494 part = &infoPtr->part0;
495 else
496 part = &infoPtr->parts[nPart];
498 if (part->style & SBT_OWNERDRAW)
499 result = (LRESULT)part->text;
500 else {
501 DWORD len = part->text ? WideCharToMultiByte( CP_ACP, 0, part->text, -1,
502 NULL, 0, NULL, NULL ) - 1 : 0;
503 result = MAKELONG( len, part->style );
504 if (part->text && buf)
505 WideCharToMultiByte( CP_ACP, 0, part->text, -1, buf, len+1, NULL, NULL );
507 return result;
511 static LRESULT
512 STATUSBAR_GetTextW (STATUS_INFO *infoPtr, INT nPart, LPWSTR buf)
514 STATUSWINDOWPART *part;
515 LRESULT result;
517 TRACE("part %d\n", nPart);
518 if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
520 if (infoPtr->simple)
521 part = &infoPtr->part0;
522 else
523 part = &infoPtr->parts[nPart];
525 if (part->style & SBT_OWNERDRAW)
526 result = (LRESULT)part->text;
527 else {
528 result = part->text ? strlenW (part->text) : 0;
529 result |= (part->style << 16);
530 if (part->text && buf)
531 strcpyW (buf, part->text);
533 return result;
537 static LRESULT
538 STATUSBAR_GetTextLength (STATUS_INFO *infoPtr, INT nPart)
540 STATUSWINDOWPART *part;
541 DWORD result;
543 TRACE("part %d\n", nPart);
545 /* MSDN says: "simple parts use index of 0", so this check is ok. */
546 if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
548 if (infoPtr->simple)
549 part = &infoPtr->part0;
550 else
551 part = &infoPtr->parts[nPart];
553 if ((~part->style & SBT_OWNERDRAW) && part->text)
554 result = strlenW(part->text);
555 else
556 result = 0;
558 result |= (part->style << 16);
559 return result;
562 static LRESULT
563 STATUSBAR_GetTipTextA (const STATUS_INFO *infoPtr, INT id, LPSTR tip, INT size)
565 TRACE("\n");
566 if (tip) {
567 CHAR buf[INFOTIPSIZE];
568 buf[0]='\0';
570 if (infoPtr->hwndToolTip) {
571 TTTOOLINFOA ti;
572 ti.cbSize = sizeof(TTTOOLINFOA);
573 ti.hwnd = infoPtr->Self;
574 ti.uId = id;
575 ti.lpszText = buf;
576 SendMessageA (infoPtr->hwndToolTip, TTM_GETTEXTA, 0, (LPARAM)&ti);
578 lstrcpynA (tip, buf, size);
580 return 0;
584 static LRESULT
585 STATUSBAR_GetTipTextW (const STATUS_INFO *infoPtr, INT id, LPWSTR tip, INT size)
587 TRACE("\n");
588 if (tip) {
589 WCHAR buf[INFOTIPSIZE];
590 buf[0]=0;
592 if (infoPtr->hwndToolTip) {
593 TTTOOLINFOW ti;
594 ti.cbSize = sizeof(TTTOOLINFOW);
595 ti.hwnd = infoPtr->Self;
596 ti.uId = id;
597 ti.lpszText = buf;
598 SendMessageW(infoPtr->hwndToolTip, TTM_GETTEXTW, 0, (LPARAM)&ti);
600 lstrcpynW(tip, buf, size);
603 return 0;
607 static COLORREF
608 STATUSBAR_SetBkColor (STATUS_INFO *infoPtr, COLORREF color)
610 COLORREF oldBkColor;
612 oldBkColor = infoPtr->clrBk;
613 infoPtr->clrBk = color;
614 InvalidateRect(infoPtr->Self, NULL, FALSE);
616 TRACE("CREF: %08x -> %08x\n", oldBkColor, infoPtr->clrBk);
617 return oldBkColor;
621 static BOOL
622 STATUSBAR_SetIcon (STATUS_INFO *infoPtr, INT nPart, HICON hIcon)
624 if ((nPart < -1) || (nPart >= infoPtr->numParts))
625 return FALSE;
627 TRACE("setting part %d\n", nPart);
629 /* FIXME: MSDN says "if nPart is -1, the status bar is assumed simple" */
630 if (nPart == -1) {
631 if (infoPtr->part0.hIcon == hIcon) /* same as - no redraw */
632 return TRUE;
633 infoPtr->part0.hIcon = hIcon;
634 if (infoPtr->simple)
635 InvalidateRect(infoPtr->Self, &infoPtr->part0.bound, FALSE);
636 } else {
637 if (infoPtr->parts[nPart].hIcon == hIcon) /* same as - no redraw */
638 return TRUE;
640 infoPtr->parts[nPart].hIcon = hIcon;
641 if (!(infoPtr->simple))
642 InvalidateRect(infoPtr->Self, &infoPtr->parts[nPart].bound, FALSE);
644 return TRUE;
648 static BOOL
649 STATUSBAR_SetMinHeight (STATUS_INFO *infoPtr, INT height)
651 DWORD ysize = GetSystemMetrics(SM_CYSIZE);
652 if (ysize & 1) ysize--;
653 infoPtr->minHeight = max(height, ysize);
654 infoPtr->height = STATUSBAR_ComputeHeight(infoPtr);
655 /* like native, don't resize the control */
656 return TRUE;
660 static BOOL
661 STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
663 STATUSWINDOWPART *tmp;
664 INT i, oldNumParts;
666 TRACE("(%d,%p)\n", count, parts);
668 if(!count) return FALSE;
670 oldNumParts = infoPtr->numParts;
671 infoPtr->numParts = count;
672 if (oldNumParts > infoPtr->numParts) {
673 for (i = infoPtr->numParts ; i < oldNumParts; i++) {
674 if (!(infoPtr->parts[i].style & SBT_OWNERDRAW))
675 Free (infoPtr->parts[i].text);
677 } else if (oldNumParts < infoPtr->numParts) {
678 tmp = Alloc (sizeof(STATUSWINDOWPART) * infoPtr->numParts);
679 if (!tmp) return FALSE;
680 for (i = 0; i < oldNumParts; i++) {
681 tmp[i] = infoPtr->parts[i];
683 Free (infoPtr->parts);
684 infoPtr->parts = tmp;
686 if (oldNumParts == infoPtr->numParts) {
687 for (i=0; i < oldNumParts; i++)
688 if (infoPtr->parts[i].x != parts[i])
689 break;
690 if (i==oldNumParts) /* Unchanged? no need to redraw! */
691 return TRUE;
694 for (i = 0; i < infoPtr->numParts; i++)
695 infoPtr->parts[i].x = parts[i];
697 if (infoPtr->hwndToolTip) {
698 INT nTipCount;
699 TTTOOLINFOW ti;
701 ZeroMemory (&ti, sizeof(TTTOOLINFOW));
702 ti.cbSize = sizeof(TTTOOLINFOW);
703 ti.hwnd = infoPtr->Self;
705 nTipCount = SendMessageW (infoPtr->hwndToolTip, TTM_GETTOOLCOUNT, 0, 0);
706 if (nTipCount < infoPtr->numParts) {
707 /* add tools */
708 for (i = nTipCount; i < infoPtr->numParts; i++) {
709 TRACE("add tool %d\n", i);
710 ti.uId = i;
711 SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW,
712 0, (LPARAM)&ti);
715 else if (nTipCount > infoPtr->numParts) {
716 /* delete tools */
717 for (i = nTipCount - 1; i >= infoPtr->numParts; i--) {
718 TRACE("delete tool %d\n", i);
719 ti.uId = i;
720 SendMessageW (infoPtr->hwndToolTip, TTM_DELTOOLW,
721 0, (LPARAM)&ti);
725 STATUSBAR_SetPartBounds (infoPtr);
726 InvalidateRect(infoPtr->Self, NULL, FALSE);
727 return TRUE;
731 static BOOL
732 STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
733 LPWSTR text, BOOL isW)
735 STATUSWINDOWPART *part=NULL;
736 BOOL changed = FALSE;
737 INT oldStyle;
739 if (style & SBT_OWNERDRAW) {
740 TRACE("part %d, text %p\n",nPart,text);
742 else TRACE("part %d, text %s\n", nPart, debugstr_t(text, isW));
744 /* MSDN says: "If the parameter is set to SB_SIMPLEID (255), the status
745 * window is assumed to be a simple window */
747 if (nPart == 0x00ff) {
748 part = &infoPtr->part0;
749 } else {
750 if (infoPtr->parts && nPart >= 0 && nPart < infoPtr->numParts) {
751 part = &infoPtr->parts[nPart];
754 if (!part) return FALSE;
756 if (part->style != style)
757 changed = TRUE;
759 oldStyle = part->style;
760 part->style = style;
761 if (style & SBT_OWNERDRAW) {
762 if (!(oldStyle & SBT_OWNERDRAW))
763 Free (part->text);
764 part->text = text;
765 } else {
766 LPWSTR ntext;
767 WCHAR *idx;
769 if (text && !isW) {
770 LPCSTR atxt = (LPCSTR)text;
771 DWORD len = MultiByteToWideChar( CP_ACP, 0, atxt, -1, NULL, 0 );
772 ntext = Alloc( (len + 1)*sizeof(WCHAR) );
773 if (!ntext) return FALSE;
774 MultiByteToWideChar( CP_ACP, 0, atxt, -1, ntext, len );
775 } else if (text) {
776 ntext = Alloc( (strlenW(text) + 1)*sizeof(WCHAR) );
777 if (!ntext) return FALSE;
778 strcpyW (ntext, text);
779 } else ntext = 0;
781 /* replace nonprintable characters with spaces */
782 if (ntext) {
783 idx = ntext;
784 while (*idx) {
785 if(!isprintW(*idx))
786 *idx = ' ';
787 idx++;
791 /* check if text is unchanged -> no need to redraw */
792 if (text) {
793 if (!changed && part->text && !lstrcmpW(ntext, part->text)) {
794 Free(ntext);
795 return TRUE;
797 } else {
798 if (!changed && !part->text)
799 return TRUE;
802 if (!(oldStyle & SBT_OWNERDRAW))
803 Free (part->text);
804 part->text = ntext;
806 InvalidateRect(infoPtr->Self, &part->bound, FALSE);
807 UpdateWindow(infoPtr->Self);
809 return TRUE;
813 static LRESULT
814 STATUSBAR_SetTipTextA (const STATUS_INFO *infoPtr, INT id, LPSTR text)
816 TRACE("part %d: \"%s\"\n", id, text);
817 if (infoPtr->hwndToolTip) {
818 TTTOOLINFOA ti;
819 ti.cbSize = sizeof(TTTOOLINFOA);
820 ti.hwnd = infoPtr->Self;
821 ti.uId = id;
822 ti.hinst = 0;
823 ti.lpszText = text;
824 SendMessageA (infoPtr->hwndToolTip, TTM_UPDATETIPTEXTA, 0, (LPARAM)&ti);
827 return 0;
831 static LRESULT
832 STATUSBAR_SetTipTextW (const STATUS_INFO *infoPtr, INT id, LPWSTR text)
834 TRACE("part %d: \"%s\"\n", id, debugstr_w(text));
835 if (infoPtr->hwndToolTip) {
836 TTTOOLINFOW ti;
837 ti.cbSize = sizeof(TTTOOLINFOW);
838 ti.hwnd = infoPtr->Self;
839 ti.uId = id;
840 ti.hinst = 0;
841 ti.lpszText = text;
842 SendMessageW (infoPtr->hwndToolTip, TTM_UPDATETIPTEXTW, 0, (LPARAM)&ti);
845 return 0;
849 static inline LRESULT
850 STATUSBAR_SetUnicodeFormat (STATUS_INFO *infoPtr, BOOL bUnicode)
852 BOOL bOld = infoPtr->bUnicode;
854 TRACE("(0x%x)\n", bUnicode);
855 infoPtr->bUnicode = bUnicode;
857 return bOld;
861 static BOOL
862 STATUSBAR_Simple (STATUS_INFO *infoPtr, BOOL simple)
864 NMHDR nmhdr;
866 TRACE("(simple=%d)\n", simple);
867 if (infoPtr->simple == simple) /* no need to change */
868 return TRUE;
870 infoPtr->simple = simple;
872 /* send notification */
873 nmhdr.hwndFrom = infoPtr->Self;
874 nmhdr.idFrom = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
875 nmhdr.code = SBN_SIMPLEMODECHANGE;
876 SendMessageW (infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nmhdr);
877 InvalidateRect(infoPtr->Self, NULL, FALSE);
878 return TRUE;
882 static LRESULT
883 STATUSBAR_WMDestroy (STATUS_INFO *infoPtr)
885 int i;
887 TRACE("\n");
888 for (i = 0; i < infoPtr->numParts; i++) {
889 if (!(infoPtr->parts[i].style & SBT_OWNERDRAW))
890 Free (infoPtr->parts[i].text);
892 if (!(infoPtr->part0.style & SBT_OWNERDRAW))
893 Free (infoPtr->part0.text);
894 Free (infoPtr->parts);
896 /* delete default font */
897 if (infoPtr->hDefaultFont)
898 DeleteObject (infoPtr->hDefaultFont);
900 /* delete tool tip control */
901 if (infoPtr->hwndToolTip)
902 DestroyWindow (infoPtr->hwndToolTip);
904 CloseThemeData (GetWindowTheme (infoPtr->Self));
906 SetWindowLongPtrW(infoPtr->Self, 0, 0);
907 Free (infoPtr);
908 return 0;
912 static LRESULT
913 STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
915 STATUS_INFO *infoPtr;
916 NONCLIENTMETRICSW nclm;
917 DWORD dwStyle;
918 RECT rect;
919 int len;
921 TRACE("\n");
922 infoPtr = Alloc (sizeof(STATUS_INFO));
923 if (!infoPtr) goto create_fail;
924 SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
926 infoPtr->Self = hwnd;
927 infoPtr->Notify = lpCreate->hwndParent;
928 infoPtr->numParts = 1;
929 infoPtr->parts = 0;
930 infoPtr->simple = FALSE;
931 infoPtr->clrBk = CLR_DEFAULT;
932 infoPtr->hFont = 0;
933 infoPtr->horizontalBorder = HORZ_BORDER;
934 infoPtr->verticalBorder = VERT_BORDER;
935 infoPtr->horizontalGap = HORZ_GAP;
936 infoPtr->minHeight = GetSystemMetrics(SM_CYSIZE);
937 if (infoPtr->minHeight & 1) infoPtr->minHeight--;
939 STATUSBAR_NotifyFormat(infoPtr, infoPtr->Notify, NF_REQUERY);
941 ZeroMemory (&nclm, sizeof(nclm));
942 nclm.cbSize = sizeof(nclm);
943 SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, nclm.cbSize, &nclm, 0);
944 infoPtr->hDefaultFont = CreateFontIndirectW (&nclm.lfStatusFont);
946 GetClientRect (hwnd, &rect);
948 /* initialize simple case */
949 infoPtr->part0.bound = rect;
950 infoPtr->part0.text = 0;
951 infoPtr->part0.x = 0;
952 infoPtr->part0.style = 0;
953 infoPtr->part0.hIcon = 0;
955 /* initialize first part */
956 infoPtr->parts = Alloc (sizeof(STATUSWINDOWPART));
957 if (!infoPtr->parts) goto create_fail;
958 infoPtr->parts[0].bound = rect;
959 infoPtr->parts[0].text = 0;
960 infoPtr->parts[0].x = -1;
961 infoPtr->parts[0].style = 0;
962 infoPtr->parts[0].hIcon = 0;
964 OpenThemeData (hwnd, themeClass);
966 if (lpCreate->lpszName && (len = strlenW ((LPCWSTR)lpCreate->lpszName)))
968 infoPtr->parts[0].text = Alloc ((len + 1)*sizeof(WCHAR));
969 if (!infoPtr->parts[0].text) goto create_fail;
970 strcpyW (infoPtr->parts[0].text, (LPCWSTR)lpCreate->lpszName);
973 dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
974 /* native seems to clear WS_BORDER, too */
975 dwStyle &= ~WS_BORDER;
976 SetWindowLongW (hwnd, GWL_STYLE, dwStyle);
978 infoPtr->height = STATUSBAR_ComputeHeight(infoPtr);
980 if (dwStyle & SBT_TOOLTIPS) {
981 infoPtr->hwndToolTip =
982 CreateWindowExW (0, TOOLTIPS_CLASSW, NULL, WS_POPUP | TTS_ALWAYSTIP,
983 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
984 CW_USEDEFAULT, hwnd, 0,
985 (HINSTANCE)GetWindowLongPtrW(hwnd, GWLP_HINSTANCE), NULL);
987 if (infoPtr->hwndToolTip) {
988 NMTOOLTIPSCREATED nmttc;
990 nmttc.hdr.hwndFrom = hwnd;
991 nmttc.hdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID);
992 nmttc.hdr.code = NM_TOOLTIPSCREATED;
993 nmttc.hwndToolTips = infoPtr->hwndToolTip;
995 SendMessageW (lpCreate->hwndParent, WM_NOTIFY, nmttc.hdr.idFrom, (LPARAM)&nmttc);
999 return 0;
1001 create_fail:
1002 TRACE(" failed!\n");
1003 if (infoPtr) STATUSBAR_WMDestroy(infoPtr);
1004 return -1;
1008 /* in contrast to SB_GETTEXT*, WM_GETTEXT handles the text
1009 * of the first part only (usual behaviour) */
1010 static INT
1011 STATUSBAR_WMGetText (const STATUS_INFO *infoPtr, INT size, LPWSTR buf)
1013 INT len;
1015 TRACE("\n");
1016 if (!(infoPtr->parts[0].text))
1017 return 0;
1019 len = strlenW (infoPtr->parts[0].text);
1021 if (!size)
1022 return len;
1023 else if (size > len) {
1024 strcpyW (buf, infoPtr->parts[0].text);
1025 return len;
1027 else {
1028 memcpy (buf, infoPtr->parts[0].text, (size - 1) * sizeof(WCHAR));
1029 buf[size - 1] = 0;
1030 return size - 1;
1035 static BOOL
1036 STATUSBAR_WMNCHitTest (const STATUS_INFO *infoPtr, INT x, INT y)
1038 if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) {
1039 RECT rect;
1040 POINT pt;
1042 GetClientRect (infoPtr->Self, &rect);
1044 pt.x = x;
1045 pt.y = y;
1046 ScreenToClient (infoPtr->Self, &pt);
1048 rect.left = rect.right - 13;
1049 rect.top += 2;
1051 if (PtInRect (&rect, pt))
1053 if (GetWindowLongW( infoPtr->Self, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) return HTBOTTOMLEFT;
1054 else return HTBOTTOMRIGHT;
1058 return HTERROR;
1062 static LRESULT
1063 STATUSBAR_WMPaint (STATUS_INFO *infoPtr, HDC hdc)
1065 PAINTSTRUCT ps;
1067 TRACE("\n");
1068 if (hdc) return STATUSBAR_Refresh (infoPtr, hdc);
1069 hdc = BeginPaint (infoPtr->Self, &ps);
1070 STATUSBAR_Refresh (infoPtr, hdc);
1071 EndPaint (infoPtr->Self, &ps);
1073 return 0;
1077 static LRESULT
1078 STATUSBAR_WMSetFont (STATUS_INFO *infoPtr, HFONT font, BOOL redraw)
1080 infoPtr->hFont = font;
1081 TRACE("%p\n", infoPtr->hFont);
1083 infoPtr->height = STATUSBAR_ComputeHeight(infoPtr);
1084 SendMessageW(infoPtr->Self, WM_SIZE, 0, 0); /* update size */
1085 if (redraw)
1086 InvalidateRect(infoPtr->Self, NULL, FALSE);
1088 return 0;
1092 static BOOL
1093 STATUSBAR_WMSetText (const STATUS_INFO *infoPtr, LPCSTR text)
1095 STATUSWINDOWPART *part;
1096 int len;
1098 TRACE("\n");
1099 if (infoPtr->numParts == 0)
1100 return FALSE;
1102 part = &infoPtr->parts[0];
1103 /* duplicate string */
1104 Free (part->text);
1105 part->text = 0;
1107 if (text && (len = strlenW((LPCWSTR)text))) {
1108 part->text = Alloc ((len+1)*sizeof(WCHAR));
1109 if (!part->text) return FALSE;
1110 strcpyW (part->text, (LPCWSTR)text);
1113 InvalidateRect(infoPtr->Self, &part->bound, FALSE);
1115 return TRUE;
1119 static BOOL
1120 STATUSBAR_WMSize (STATUS_INFO *infoPtr, WORD flags)
1122 INT width, x, y;
1123 RECT parent_rect;
1125 /* Need to resize width to match parent */
1126 TRACE("flags %04x\n", flags);
1128 if (flags != SIZE_RESTORED && flags != SIZE_MAXIMIZED) {
1129 WARN("flags MUST be SIZE_RESTORED or SIZE_MAXIMIZED\n");
1130 return FALSE;
1133 if (GetWindowLongW(infoPtr->Self, GWL_STYLE) & CCS_NORESIZE) return FALSE;
1135 /* width and height don't apply */
1136 if (!GetClientRect (infoPtr->Notify, &parent_rect))
1137 return FALSE;
1139 width = parent_rect.right - parent_rect.left;
1140 x = parent_rect.left;
1141 y = parent_rect.bottom - infoPtr->height;
1142 MoveWindow (infoPtr->Self, x, y, width, infoPtr->height, TRUE);
1143 STATUSBAR_SetPartBounds (infoPtr);
1144 return TRUE;
1148 /* update theme after a WM_THEMECHANGED message */
1149 static LRESULT theme_changed (const STATUS_INFO* infoPtr)
1151 HTHEME theme = GetWindowTheme (infoPtr->Self);
1152 CloseThemeData (theme);
1153 OpenThemeData (infoPtr->Self, themeClass);
1154 return 0;
1158 static LRESULT
1159 STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd)
1161 if (cmd == NF_REQUERY) {
1162 INT i = SendMessageW(from, WM_NOTIFYFORMAT, (WPARAM)infoPtr->Self, NF_QUERY);
1163 infoPtr->bUnicode = (i == NFR_UNICODE);
1165 return infoPtr->bUnicode ? NFR_UNICODE : NFR_ANSI;
1169 static LRESULT
1170 STATUSBAR_SendMouseNotify(const STATUS_INFO *infoPtr, UINT code, UINT msg, WPARAM wParam, LPARAM lParam)
1172 NMMOUSE nm;
1174 TRACE("code %04x, lParam=%lx\n", code, lParam);
1175 nm.hdr.hwndFrom = infoPtr->Self;
1176 nm.hdr.idFrom = GetWindowLongPtrW(infoPtr->Self, GWLP_ID);
1177 nm.hdr.code = code;
1178 nm.pt.x = (short)LOWORD(lParam);
1179 nm.pt.y = (short)HIWORD(lParam);
1180 nm.dwItemSpec = STATUSBAR_InternalHitTest(infoPtr, &nm.pt);
1181 nm.dwItemData = 0;
1182 nm.dwHitInfo = 0x30000; /* seems constant */
1184 /* Do default processing if WM_NOTIFY returns zero */
1185 if(!SendMessageW(infoPtr->Notify, WM_NOTIFY, nm.hdr.idFrom, (LPARAM)&nm))
1187 return DefWindowProcW(infoPtr->Self, msg, wParam, lParam);
1189 return 0;
1194 static LRESULT WINAPI
1195 StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
1197 STATUS_INFO *infoPtr = (STATUS_INFO *)GetWindowLongPtrW (hwnd, 0);
1198 INT nPart = ((INT) wParam) & 0x00ff;
1199 LRESULT res;
1201 TRACE("hwnd=%p msg=%x wparam=%lx lparam=%lx\n", hwnd, msg, wParam, lParam);
1202 if (!infoPtr && msg != WM_CREATE)
1203 return DefWindowProcW (hwnd, msg, wParam, lParam);
1205 switch (msg) {
1206 case SB_GETBORDERS:
1207 return STATUSBAR_GetBorders (infoPtr, (INT *)lParam);
1209 case SB_GETICON:
1210 return (LRESULT)STATUSBAR_GetIcon (infoPtr, nPart);
1212 case SB_GETPARTS:
1213 return STATUSBAR_GetParts (infoPtr, (INT)wParam, (INT *)lParam);
1215 case SB_GETRECT:
1216 return STATUSBAR_GetRect (infoPtr, nPart, (LPRECT)lParam);
1218 case SB_GETTEXTA:
1219 return STATUSBAR_GetTextA (infoPtr, nPart, (LPSTR)lParam);
1221 case SB_GETTEXTW:
1222 return STATUSBAR_GetTextW (infoPtr, nPart, (LPWSTR)lParam);
1224 case SB_GETTEXTLENGTHA:
1225 case SB_GETTEXTLENGTHW:
1226 return STATUSBAR_GetTextLength (infoPtr, nPart);
1228 case SB_GETTIPTEXTA:
1229 return STATUSBAR_GetTipTextA (infoPtr, LOWORD(wParam), (LPSTR)lParam, HIWORD(wParam));
1231 case SB_GETTIPTEXTW:
1232 return STATUSBAR_GetTipTextW (infoPtr, LOWORD(wParam), (LPWSTR)lParam, HIWORD(wParam));
1234 case SB_GETUNICODEFORMAT:
1235 return infoPtr->bUnicode;
1237 case SB_ISSIMPLE:
1238 return infoPtr->simple;
1240 case SB_SETBORDERS:
1241 return STATUSBAR_SetBorders (infoPtr, (INT *)lParam);
1243 case SB_SETBKCOLOR:
1244 return STATUSBAR_SetBkColor (infoPtr, (COLORREF)lParam);
1246 case SB_SETICON:
1247 return STATUSBAR_SetIcon (infoPtr, nPart, (HICON)lParam);
1249 case SB_SETMINHEIGHT:
1250 return STATUSBAR_SetMinHeight (infoPtr, (INT)wParam);
1252 case SB_SETPARTS:
1253 return STATUSBAR_SetParts (infoPtr, (INT)wParam, (LPINT)lParam);
1255 case SB_SETTEXTA:
1256 return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPWSTR)lParam, FALSE);
1258 case SB_SETTEXTW:
1259 return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPWSTR)lParam, TRUE);
1261 case SB_SETTIPTEXTA:
1262 return STATUSBAR_SetTipTextA (infoPtr, (INT)wParam, (LPSTR)lParam);
1264 case SB_SETTIPTEXTW:
1265 return STATUSBAR_SetTipTextW (infoPtr, (INT)wParam, (LPWSTR)lParam);
1267 case SB_SETUNICODEFORMAT:
1268 return STATUSBAR_SetUnicodeFormat (infoPtr, (BOOL)wParam);
1270 case SB_SIMPLE:
1271 return STATUSBAR_Simple (infoPtr, (BOOL)wParam);
1273 case WM_CREATE:
1274 return STATUSBAR_WMCreate (hwnd, (LPCREATESTRUCTA)lParam);
1276 case WM_DESTROY:
1277 return STATUSBAR_WMDestroy (infoPtr);
1279 case WM_GETFONT:
1280 return (LRESULT)(infoPtr->hFont? infoPtr->hFont : infoPtr->hDefaultFont);
1282 case WM_GETTEXT:
1283 return STATUSBAR_WMGetText (infoPtr, (INT)wParam, (LPWSTR)lParam);
1285 case WM_GETTEXTLENGTH:
1286 return STATUSBAR_GetTextLength (infoPtr, 0);
1288 case WM_LBUTTONDBLCLK:
1289 return STATUSBAR_SendMouseNotify(infoPtr, NM_DBLCLK, msg, wParam, lParam);
1291 case WM_LBUTTONUP:
1292 return STATUSBAR_SendMouseNotify(infoPtr, NM_CLICK, msg, wParam, lParam);
1294 case WM_MOUSEMOVE:
1295 return STATUSBAR_Relay2Tip (infoPtr, msg, wParam, lParam);
1297 case WM_NCHITTEST:
1298 res = STATUSBAR_WMNCHitTest(infoPtr, (short)LOWORD(lParam),
1299 (short)HIWORD(lParam));
1300 if (res != HTERROR) return res;
1301 return DefWindowProcW (hwnd, msg, wParam, lParam);
1303 case WM_NCLBUTTONUP:
1304 case WM_NCLBUTTONDOWN:
1305 PostMessageW (infoPtr->Notify, msg, wParam, lParam);
1306 return 0;
1308 case WM_NOTIFYFORMAT:
1309 return STATUSBAR_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam);
1311 case WM_PRINTCLIENT:
1312 case WM_PAINT:
1313 return STATUSBAR_WMPaint (infoPtr, (HDC)wParam);
1315 case WM_RBUTTONDBLCLK:
1316 return STATUSBAR_SendMouseNotify(infoPtr, NM_RDBLCLK, msg, wParam, lParam);
1318 case WM_RBUTTONUP:
1319 return STATUSBAR_SendMouseNotify(infoPtr, NM_RCLICK, msg, wParam, lParam);
1321 case WM_SETFONT:
1322 return STATUSBAR_WMSetFont (infoPtr, (HFONT)wParam, LOWORD(lParam));
1324 case WM_SETTEXT:
1325 return STATUSBAR_WMSetText (infoPtr, (LPCSTR)lParam);
1327 case WM_SIZE:
1328 if (STATUSBAR_WMSize (infoPtr, (WORD)wParam)) return 0;
1329 return DefWindowProcW (hwnd, msg, wParam, lParam);
1331 case WM_SYSCOLORCHANGE:
1332 COMCTL32_RefreshSysColors();
1333 return 0;
1335 case WM_THEMECHANGED:
1336 return theme_changed (infoPtr);
1338 default:
1339 if ((msg >= WM_USER) && (msg < WM_APP) && !COMCTL32_IsReflectedMessage(msg))
1340 ERR("unknown msg %04x wp=%04lx lp=%08lx\n",
1341 msg, wParam, lParam);
1342 return DefWindowProcW (hwnd, msg, wParam, lParam);
1347 /***********************************************************************
1348 * STATUS_Register [Internal]
1350 * Registers the status window class.
1353 void
1354 STATUS_Register (void)
1356 WNDCLASSW wndClass;
1358 ZeroMemory (&wndClass, sizeof(WNDCLASSW));
1359 wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW;
1360 wndClass.lpfnWndProc = StatusWindowProc;
1361 wndClass.cbClsExtra = 0;
1362 wndClass.cbWndExtra = sizeof(STATUS_INFO *);
1363 wndClass.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
1364 wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
1365 wndClass.lpszClassName = STATUSCLASSNAMEW;
1367 RegisterClassW (&wndClass);
1371 /***********************************************************************
1372 * STATUS_Unregister [Internal]
1374 * Unregisters the status window class.
1377 void
1378 STATUS_Unregister (void)
1380 UnregisterClassW (STATUSCLASSNAMEW, NULL);