Added parser template and made AVISplitter use it.
[wine] / dlls / comctl32 / status.c
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  *
22  * NOTE
23  * 
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.
26  * 
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.
30  * 
31  * TODO:
32  *      -- CCS_BOTTOM (default)
33  *      -- CCS_LEFT
34  *      -- CCS_NODEVIDER
35  *      -- CCS_NOMOVEX
36  *      -- CCS_NOMOVEY
37  *      -- CCS_NOPARENTALIGN
38  *      -- CCS_RIGHT
39  *      -- CCS_TOP
40  *      -- CCS_VERT (defaults to RIGHT)
41  */
42
43 #include <stdarg.h>
44 #include <string.h>
45
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 "wine/debug.h"
55
56 WINE_DEFAULT_DEBUG_CHANNEL(statusbar);
57
58 typedef struct
59 {
60     INT         x;
61     INT         style;
62     RECT        bound;
63     LPWSTR      text;
64     HICON       hIcon;
65 } STATUSWINDOWPART;
66
67 typedef struct
68 {
69     HWND              Self;
70     HWND              Notify;
71     WORD              numParts;
72     UINT              height;
73     BOOL              simple;
74     HWND              hwndToolTip;
75     HFONT             hFont;
76     HFONT             hDefaultFont;
77     COLORREF          clrBk;            /* background color */
78     BOOL              bUnicode;         /* unicode flag */
79     BOOL              NtfUnicode;       /* notify format */
80     STATUSWINDOWPART  part0;            /* simple window */
81     STATUSWINDOWPART* parts;
82 } STATUS_INFO;
83
84 /*
85  * Run tests using Waite Group Windows95 API Bible Vol. 1&2
86  * The second cdrom contains executables drawstat.exe, gettext.exe,
87  * simple.exe, getparts.exe, setparts.exe, statwnd.exe
88  */
89
90 #define HORZ_BORDER 0
91 #define VERT_BORDER 2
92 #define HORZ_GAP    2
93
94 /* prototype */
95 static void
96 STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr);
97
98 static inline LPCSTR debugstr_t(LPCWSTR text, BOOL isW)
99 {
100   return isW ? debugstr_w(text) : debugstr_a((LPCSTR)text);
101 }
102
103 static void
104 STATUSBAR_DrawSizeGrip (HDC hdc, LPRECT lpRect)
105 {
106     HPEN hPenFace, hPenShadow, hPenHighlight, hOldPen;
107     POINT pt;
108     INT i;
109
110     TRACE("draw size grip %ld,%ld - %ld,%ld\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
111
112     pt.x = lpRect->right - 1;
113     pt.y = lpRect->bottom - 1;
114
115     hPenFace = CreatePen( PS_SOLID, 1, GetSysColor( COLOR_3DFACE ));
116     hOldPen = SelectObject( hdc, hPenFace );
117     MoveToEx (hdc, pt.x - 12, pt.y, NULL);
118     LineTo (hdc, pt.x, pt.y);
119     LineTo (hdc, pt.x, pt.y - 13);
120
121     pt.x--;
122     pt.y--;
123
124     hPenShadow = CreatePen( PS_SOLID, 1, GetSysColor( COLOR_3DSHADOW ));
125     SelectObject( hdc, hPenShadow );
126     for (i = 1; i < 11; i += 4) {
127         MoveToEx (hdc, pt.x - i, pt.y, NULL);
128         LineTo (hdc, pt.x + 1, pt.y - i - 1);
129
130         MoveToEx (hdc, pt.x - i - 1, pt.y, NULL);
131         LineTo (hdc, pt.x + 1, pt.y - i - 2);
132     }
133
134     hPenHighlight = CreatePen( PS_SOLID, 1, GetSysColor( COLOR_3DHIGHLIGHT ));
135     SelectObject( hdc, hPenHighlight );
136     for (i = 3; i < 13; i += 4) {
137         MoveToEx (hdc, pt.x - i, pt.y, NULL);
138         LineTo (hdc, pt.x + 1, pt.y - i - 1);
139     }
140
141     SelectObject (hdc, hOldPen);
142     DeleteObject( hPenFace );
143     DeleteObject( hPenShadow );
144     DeleteObject( hPenHighlight );
145 }
146
147
148 static void
149 STATUSBAR_DrawPart (STATUS_INFO *infoPtr, HDC hdc, STATUSWINDOWPART *part, int itemID)
150 {
151     RECT r = part->bound;
152     UINT border = BDR_SUNKENOUTER;
153
154     TRACE("part bound %ld,%ld - %ld,%ld\n", r.left, r.top, r.right, r.bottom);
155     if (part->style & SBT_POPOUT)
156         border = BDR_RAISEDOUTER;
157     else if (part->style & SBT_NOBORDERS)
158         border = 0;
159
160     DrawEdge(hdc, &r, border, BF_RECT|BF_ADJUST);
161
162     if (part->style & SBT_OWNERDRAW)
163         {
164             DRAWITEMSTRUCT dis;
165
166             dis.CtlID = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
167             dis.itemID = itemID;
168             dis.hwndItem = infoPtr->Self;
169             dis.hDC = hdc;
170             dis.rcItem = r;
171             dis.itemData = (INT)part->text;
172             SendMessageW (infoPtr->Notify, WM_DRAWITEM, (WPARAM)dis.CtlID, (LPARAM)&dis);
173     }
174     else
175         {
176             if (part->hIcon)
177                 {
178                 INT cy = r.bottom - r.top;
179
180                 r.left += 2;
181                 DrawIconEx (hdc, r.left, r.top, part->hIcon, cy, cy, 0, 0, DI_NORMAL);
182                 r.left += cy;
183                 }
184         DrawStatusTextW (hdc, &r, part->text, SBT_NOBORDERS);
185     }
186 }
187
188
189 static void
190 STATUSBAR_RefreshPart (STATUS_INFO *infoPtr, HDC hdc, STATUSWINDOWPART *part, int itemID)
191 {
192     HBRUSH hbrBk;
193     HFONT  hOldFont;
194
195     TRACE("item %d\n", itemID);
196     if (!IsWindowVisible (infoPtr->Self))
197         return;
198
199     if (part->bound.right < part->bound.left) return;
200
201     if (infoPtr->clrBk != CLR_DEFAULT)
202             hbrBk = CreateSolidBrush (infoPtr->clrBk);
203     else
204             hbrBk = GetSysColorBrush (COLOR_3DFACE);
205     FillRect(hdc, &part->bound, hbrBk);
206
207     hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
208
209         STATUSBAR_DrawPart (infoPtr, hdc, part, itemID);
210
211     SelectObject (hdc, hOldFont);
212
213     if (infoPtr->clrBk != CLR_DEFAULT)
214             DeleteObject (hbrBk);
215
216     if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
217         {
218             RECT rect;
219
220             GetClientRect (infoPtr->Self, &rect);
221             STATUSBAR_DrawSizeGrip (hdc, &rect);
222     }
223 }
224
225
226 static LRESULT
227 STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
228 {
229     int      i;
230     RECT   rect;
231     HBRUSH hbrBk;
232     HFONT  hOldFont;
233
234     TRACE("\n");
235     if (!IsWindowVisible(infoPtr->Self))
236         return 0;
237
238     STATUSBAR_SetPartBounds(infoPtr);
239
240     GetClientRect (infoPtr->Self, &rect);
241
242     if (infoPtr->clrBk != CLR_DEFAULT)
243             hbrBk = CreateSolidBrush (infoPtr->clrBk);
244     else
245             hbrBk = GetSysColorBrush (COLOR_3DFACE);
246     FillRect(hdc, &rect, hbrBk);
247
248     hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
249
250     if (infoPtr->simple) {
251             STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->part0, 0);
252     } else {
253             for (i = 0; i < infoPtr->numParts; i++) {
254                     STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->parts[i], i);
255             }
256     }
257
258     SelectObject (hdc, hOldFont);
259
260     if (infoPtr->clrBk != CLR_DEFAULT)
261             DeleteObject (hbrBk);
262
263     if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
264             STATUSBAR_DrawSizeGrip (hdc, &rect);
265
266     return 0;
267 }
268
269
270 static void
271 STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr)
272 {
273     STATUSWINDOWPART *part;
274     RECT rect, *r;
275     int i;
276
277     /* get our window size */
278     GetClientRect (infoPtr->Self, &rect);
279     TRACE("client wnd size is %ld,%ld - %ld,%ld\n", rect.left, rect.top, rect.right, rect.bottom);
280
281     rect.top += VERT_BORDER;
282
283     /* set bounds for simple rectangle */
284     infoPtr->part0.bound = rect;
285
286     /* set bounds for non-simple rectangles */
287     for (i = 0; i < infoPtr->numParts; i++) {
288         part = &infoPtr->parts[i];
289         r = &infoPtr->parts[i].bound;
290         r->top = rect.top;
291         r->bottom = rect.bottom;
292         if (i == 0)
293             r->left = 0;
294         else
295             r->left = infoPtr->parts[i-1].bound.right + HORZ_GAP;
296         if (part->x == -1)
297             r->right = rect.right;
298         else
299             r->right = part->x;
300
301         if (infoPtr->hwndToolTip) {
302             TTTOOLINFOW ti;
303
304             ti.cbSize = sizeof(TTTOOLINFOW);
305             ti.hwnd = infoPtr->Self;
306             ti.uId = i;
307             ti.rect = *r;
308             SendMessageW (infoPtr->hwndToolTip, TTM_NEWTOOLRECTW,
309                             0, (LPARAM)&ti);
310         }
311     }
312 }
313
314
315 static LRESULT
316 STATUSBAR_Relay2Tip (STATUS_INFO *infoPtr, UINT uMsg,
317                      WPARAM wParam, LPARAM lParam)
318 {
319     MSG msg;
320
321     msg.hwnd = infoPtr->Self;
322     msg.message = uMsg;
323     msg.wParam = wParam;
324     msg.lParam = lParam;
325     msg.time = GetMessageTime ();
326     msg.pt.x = LOWORD(GetMessagePos ());
327     msg.pt.y = HIWORD(GetMessagePos ());
328
329     return SendMessageW (infoPtr->hwndToolTip, TTM_RELAYEVENT, 0, (LPARAM)&msg);
330 }
331
332
333 static BOOL
334 STATUSBAR_GetBorders (INT out[])
335 {
336     TRACE("\n");
337     out[0] = HORZ_BORDER; /* horizontal border width */
338     out[1] = VERT_BORDER; /* vertical border width */
339     out[2] = HORZ_GAP; /* width of border between rectangles */
340
341     return TRUE;
342 }
343
344
345 static HICON
346 STATUSBAR_GetIcon (STATUS_INFO *infoPtr, INT nPart)
347 {
348     TRACE("%d\n", nPart);
349     /* MSDN says: "simple parts are indexed with -1" */
350     if ((nPart < -1) || (nPart >= infoPtr->numParts))
351         return 0;
352
353     if (nPart == -1)
354         return (infoPtr->part0.hIcon);
355     else
356         return (infoPtr->parts[nPart].hIcon);
357 }
358
359
360 static INT
361 STATUSBAR_GetParts (STATUS_INFO *infoPtr, INT num_parts, INT parts[])
362 {
363     INT   i;
364
365     TRACE("(%d)\n", num_parts);
366     if (parts) {
367         for (i = 0; i < num_parts; i++) {
368             parts[i] = infoPtr->parts[i].x;
369         }
370     }
371     return infoPtr->numParts;
372 }
373
374
375 static BOOL
376 STATUSBAR_GetRect (STATUS_INFO *infoPtr, INT nPart, LPRECT rect)
377 {
378     TRACE("part %d\n", nPart);
379     if (infoPtr->simple)
380         *rect = infoPtr->part0.bound;
381     else
382         *rect = infoPtr->parts[nPart].bound;
383     return TRUE;
384 }
385
386
387 static LRESULT
388 STATUSBAR_GetTextA (STATUS_INFO *infoPtr, INT nPart, LPSTR buf)
389 {
390     STATUSWINDOWPART *part;
391     LRESULT result;
392
393     TRACE("part %d\n", nPart);
394
395     /* MSDN says: "simple parts use index of 0", so this check is ok. */
396     if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
397
398     if (infoPtr->simple)
399         part = &infoPtr->part0;
400     else
401         part = &infoPtr->parts[nPart];
402
403     if (part->style & SBT_OWNERDRAW)
404         result = (LRESULT)part->text;
405     else {
406         DWORD len = part->text ? WideCharToMultiByte( CP_ACP, 0, part->text, -1,
407                                                       NULL, 0, NULL, NULL ) - 1 : 0;
408         result = MAKELONG( len, part->style );
409         if (part->text && buf)
410             WideCharToMultiByte( CP_ACP, 0, part->text, -1, buf, len+1, NULL, NULL );
411     }
412     return result;
413 }
414
415
416 static LRESULT
417 STATUSBAR_GetTextW (STATUS_INFO *infoPtr, INT nPart, LPWSTR buf)
418 {
419     STATUSWINDOWPART *part;
420     LRESULT result;
421
422     TRACE("part %d\n", nPart);
423     if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
424
425     if (infoPtr->simple)
426         part = &infoPtr->part0;
427     else
428         part = &infoPtr->parts[nPart];
429
430     if (part->style & SBT_OWNERDRAW)
431         result = (LRESULT)part->text;
432     else {
433         result = part->text ? strlenW (part->text) : 0;
434         result |= (part->style << 16);
435         if (part->text && buf)
436             strcpyW (buf, part->text);
437     }
438     return result;
439 }
440
441
442 static LRESULT
443 STATUSBAR_GetTextLength (STATUS_INFO *infoPtr, INT nPart)
444 {
445     STATUSWINDOWPART *part;
446     DWORD result;
447
448     TRACE("part %d\n", nPart);
449
450     /* MSDN says: "simple parts use index of 0", so this check is ok. */
451     if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
452
453     if (infoPtr->simple)
454         part = &infoPtr->part0;
455     else
456         part = &infoPtr->parts[nPart];
457
458     if ((~part->style & SBT_OWNERDRAW) && part->text)
459         result = strlenW(part->text);
460     else
461         result = 0;
462
463     result |= (part->style << 16);
464     return result;
465 }
466
467 static LRESULT
468 STATUSBAR_GetTipTextA (STATUS_INFO *infoPtr, INT id, LPSTR tip, INT size)
469 {
470     TRACE("\n");
471     if (tip) {
472         CHAR buf[INFOTIPSIZE];
473         buf[0]='\0';
474
475         if (infoPtr->hwndToolTip) {
476             TTTOOLINFOA ti;
477             ti.cbSize = sizeof(TTTOOLINFOA);
478             ti.hwnd = infoPtr->Self;
479             ti.uId = id;
480             ti.lpszText = buf;
481             SendMessageA (infoPtr->hwndToolTip, TTM_GETTEXTA, 0, (LPARAM)&ti);
482         }
483         lstrcpynA (tip, buf, size);
484     }
485     return 0;
486 }
487
488
489 static LRESULT
490 STATUSBAR_GetTipTextW (STATUS_INFO *infoPtr, INT id, LPWSTR tip, INT size)
491 {
492     TRACE("\n");
493     if (tip) {
494         WCHAR buf[INFOTIPSIZE];
495         buf[0]=0;
496
497         if (infoPtr->hwndToolTip) {
498             TTTOOLINFOW ti;
499             ti.cbSize = sizeof(TTTOOLINFOW);
500             ti.hwnd = infoPtr->Self;
501             ti.uId = id;
502             ti.lpszText = buf;
503             SendMessageW(infoPtr->hwndToolTip, TTM_GETTEXTW, 0, (LPARAM)&ti);
504         }
505         lstrcpynW(tip, buf, size);
506     }
507
508     return 0;
509 }
510
511
512 static COLORREF
513 STATUSBAR_SetBkColor (STATUS_INFO *infoPtr, COLORREF color)
514 {
515     COLORREF oldBkColor;
516
517     oldBkColor = infoPtr->clrBk;
518     infoPtr->clrBk = color;
519     InvalidateRect(infoPtr->Self, NULL, FALSE);
520
521     TRACE("CREF: %08lx -> %08lx\n", oldBkColor, infoPtr->clrBk);
522     return oldBkColor;
523 }
524
525
526 static BOOL
527 STATUSBAR_SetIcon (STATUS_INFO *infoPtr, INT nPart, HICON hIcon)
528 {
529     if ((nPart < -1) || (nPart >= infoPtr->numParts))
530         return FALSE;
531
532     TRACE("setting part %d\n", nPart);
533
534     /* FIXME: MSDN says "if nPart is -1, the status bar is assumed simple" */
535     if (nPart == -1) {
536         if (infoPtr->part0.hIcon == hIcon) /* same as - no redraw */
537             return TRUE;
538         infoPtr->part0.hIcon = hIcon;
539         if (infoPtr->simple)
540             InvalidateRect(infoPtr->Self, &infoPtr->part0.bound, FALSE);
541     } else {
542         if (infoPtr->parts[nPart].hIcon == hIcon) /* same as - no redraw */
543             return TRUE;
544
545         infoPtr->parts[nPart].hIcon = hIcon;
546         if (!(infoPtr->simple))
547             InvalidateRect(infoPtr->Self, &infoPtr->parts[nPart].bound, FALSE);
548     }
549     return TRUE;
550 }
551
552
553 static BOOL
554 STATUSBAR_SetMinHeight (STATUS_INFO *infoPtr, INT height)
555 {
556
557     TRACE("(height=%d)\n", height);
558     if (IsWindowVisible (infoPtr->Self)) {
559         INT  width, x, y;
560         RECT parent_rect;
561
562         GetClientRect (infoPtr->Notify, &parent_rect);
563         infoPtr->height = height + VERT_BORDER;
564         width = parent_rect.right - parent_rect.left;
565         x = parent_rect.left;
566         y = parent_rect.bottom - infoPtr->height;
567         MoveWindow (infoPtr->Self, parent_rect.left,
568                       parent_rect.bottom - infoPtr->height,
569                       width, infoPtr->height, TRUE);
570         STATUSBAR_SetPartBounds (infoPtr);
571     }
572
573     return TRUE;
574 }
575
576
577 static BOOL
578 STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
579 {
580     STATUSWINDOWPART *tmp;
581     int i, oldNumParts;
582
583     TRACE("(%d,%p)\n", count, parts);
584
585     oldNumParts = infoPtr->numParts;
586     infoPtr->numParts = count;
587     if (oldNumParts > infoPtr->numParts) {
588         for (i = infoPtr->numParts ; i < oldNumParts; i++) {
589             if (infoPtr->parts[i].text && !(infoPtr->parts[i].style & SBT_OWNERDRAW))
590                 Free (infoPtr->parts[i].text);
591         }
592     } else if (oldNumParts < infoPtr->numParts) {
593         tmp = Alloc (sizeof(STATUSWINDOWPART) * infoPtr->numParts);
594         if (!tmp) return FALSE;
595         for (i = 0; i < oldNumParts; i++) {
596             tmp[i] = infoPtr->parts[i];
597         }
598         if (infoPtr->parts)
599             Free (infoPtr->parts);
600         infoPtr->parts = tmp;
601     }
602     if (oldNumParts == infoPtr->numParts) {
603         for (i=0; i < oldNumParts; i++)
604             if (infoPtr->parts[i].x != parts[i])
605                 break;
606         if (i==oldNumParts) /* Unchanged? no need to redraw! */
607             return TRUE;
608     }
609
610     for (i = 0; i < infoPtr->numParts; i++)
611         infoPtr->parts[i].x = parts[i];
612
613     if (infoPtr->hwndToolTip) {
614         INT nTipCount, i;
615         TTTOOLINFOW ti;
616
617         ZeroMemory (&ti, sizeof(TTTOOLINFOW));
618         ti.cbSize = sizeof(TTTOOLINFOW);
619         ti.hwnd = infoPtr->Self;
620
621         nTipCount = SendMessageW (infoPtr->hwndToolTip, TTM_GETTOOLCOUNT, 0, 0);
622         if (nTipCount < infoPtr->numParts) {
623             /* add tools */
624             for (i = nTipCount; i < infoPtr->numParts; i++) {
625                 TRACE("add tool %d\n", i);
626                 ti.uId = i;
627                 SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW,
628                                 0, (LPARAM)&ti);
629             }
630         }
631         else if (nTipCount > infoPtr->numParts) {
632             /* delete tools */
633             for (i = nTipCount - 1; i >= infoPtr->numParts; i--) {
634                 TRACE("delete tool %d\n", i);
635                 ti.uId = i;
636                 SendMessageW (infoPtr->hwndToolTip, TTM_DELTOOLW,
637                                 0, (LPARAM)&ti);
638             }
639         }
640     }
641     STATUSBAR_SetPartBounds (infoPtr);
642     InvalidateRect(infoPtr->Self, NULL, FALSE);
643     return TRUE;
644 }
645
646
647 static BOOL
648 STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
649                     LPCWSTR text, BOOL isW)
650 {
651     STATUSWINDOWPART *part=NULL;
652     BOOL changed = FALSE;
653     INT  oldStyle;
654
655     if (style & SBT_OWNERDRAW) {
656          TRACE("part %d, text %p\n",nPart,text);
657     }
658     else TRACE("part %d, text %s\n", nPart, debugstr_t(text, isW));
659
660     /* MSDN says: "If the parameter is set to SB_SIMPLEID (255), the status
661      * window is assumed to be a simple window */
662
663     if (nPart == 0x00ff) {
664         part = &infoPtr->part0;
665     } else {
666         if (infoPtr->parts && nPart >= 0 && nPart < infoPtr->numParts) {
667             part = &infoPtr->parts[nPart];
668         }
669     }
670     if (!part) return FALSE;
671
672     if (part->style != style)
673         changed = TRUE;
674
675     oldStyle = part->style;
676     part->style = style;
677     if (style & SBT_OWNERDRAW) {
678         if (!(oldStyle & SBT_OWNERDRAW)) {
679             if (part->text)
680                 Free (part->text);
681         } else if (part->text == text)
682             return TRUE;
683         part->text = (LPWSTR)text;
684     } else {
685         LPWSTR ntext;
686
687         if (text && !isW) {
688             LPCSTR atxt = (LPCSTR)text;
689             DWORD len = MultiByteToWideChar( CP_ACP, 0, atxt, -1, NULL, 0 );
690             ntext = Alloc( (len + 1)*sizeof(WCHAR) );
691             if (!ntext) return FALSE;
692             MultiByteToWideChar( CP_ACP, 0, atxt, -1, ntext, len );
693         } else if (text) {
694             ntext = Alloc( (strlenW(text) + 1)*sizeof(WCHAR) );
695             if (!ntext) return FALSE;
696             strcpyW (ntext, text);
697         } else ntext = 0;
698
699         /* check if text is unchanged -> no need to redraw */
700         if (text) {
701             if (!changed && part->text && !lstrcmpW(ntext, part->text)) {
702                 Free(ntext);
703                 return TRUE;
704             }
705         } else {
706             if (!changed && !part->text)
707                 return TRUE;
708         }
709
710         if (part->text && !(oldStyle & SBT_OWNERDRAW))
711             Free (part->text);
712         part->text = ntext;
713     }
714     InvalidateRect(infoPtr->Self, &part->bound, FALSE);
715
716     return TRUE;
717 }
718
719
720 static LRESULT
721 STATUSBAR_SetTipTextA (STATUS_INFO *infoPtr, INT id, LPSTR text)
722 {
723     TRACE("part %d: \"%s\"\n", id, text);
724     if (infoPtr->hwndToolTip) {
725         TTTOOLINFOA ti;
726         ti.cbSize = sizeof(TTTOOLINFOA);
727         ti.hwnd = infoPtr->Self;
728         ti.uId = id;
729         ti.hinst = 0;
730         ti.lpszText = text;
731         SendMessageA (infoPtr->hwndToolTip, TTM_UPDATETIPTEXTA,
732                         0, (LPARAM)&ti);
733     }
734
735     return 0;
736 }
737
738
739 static LRESULT
740 STATUSBAR_SetTipTextW (STATUS_INFO *infoPtr, INT id, LPWSTR text)
741 {
742     TRACE("part %d: \"%s\"\n", id, debugstr_w(text));
743     if (infoPtr->hwndToolTip) {
744         TTTOOLINFOW ti;
745         ti.cbSize = sizeof(TTTOOLINFOW);
746         ti.hwnd = infoPtr->Self;
747         ti.uId = id;
748         ti.hinst = 0;
749         ti.lpszText = text;
750         SendMessageW (infoPtr->hwndToolTip, TTM_UPDATETIPTEXTW,
751                         0, (LPARAM)&ti);
752     }
753
754     return 0;
755 }
756
757
758 inline static LRESULT
759 STATUSBAR_SetUnicodeFormat (STATUS_INFO *infoPtr, BOOL bUnicode)
760 {
761     BOOL bOld = infoPtr->bUnicode;
762
763     TRACE("(0x%x)\n", bUnicode);
764     infoPtr->bUnicode = bUnicode;
765
766     return bOld;
767 }
768
769
770 static BOOL
771 STATUSBAR_Simple (STATUS_INFO *infoPtr, BOOL simple)
772 {
773     NMHDR  nmhdr;
774
775     TRACE("(simple=%d)\n", simple);
776     if (infoPtr->simple == simple) /* no need to change */
777         return TRUE;
778
779     infoPtr->simple = simple;
780
781     /* send notification */
782     nmhdr.hwndFrom = infoPtr->Self;
783     nmhdr.idFrom = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
784     nmhdr.code = SBN_SIMPLEMODECHANGE;
785     SendMessageW (infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nmhdr);
786     InvalidateRect(infoPtr->Self, NULL, FALSE);
787     return TRUE;
788 }
789
790
791 static LRESULT
792 STATUSBAR_WMDestroy (STATUS_INFO *infoPtr)
793 {
794     int i;
795
796     TRACE("\n");
797     for (i = 0; i < infoPtr->numParts; i++) {
798         if (infoPtr->parts[i].text && !(infoPtr->parts[i].style & SBT_OWNERDRAW))
799             Free (infoPtr->parts[i].text);
800     }
801     if (infoPtr->part0.text && !(infoPtr->part0.style & SBT_OWNERDRAW))
802         Free (infoPtr->part0.text);
803     Free (infoPtr->parts);
804
805     /* delete default font */
806     if (infoPtr->hDefaultFont)
807         DeleteObject (infoPtr->hDefaultFont);
808
809     /* delete tool tip control */
810     if (infoPtr->hwndToolTip)
811         DestroyWindow (infoPtr->hwndToolTip);
812
813     SetWindowLongPtrW(infoPtr->Self, 0, 0);
814     Free (infoPtr);
815     return 0;
816 }
817
818
819 static LRESULT
820 STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
821 {
822     STATUS_INFO *infoPtr;
823     NONCLIENTMETRICSW nclm;
824     DWORD dwStyle;
825     RECT rect;
826     int i, width, len, textHeight = 0;
827     HDC hdc;
828
829     TRACE("\n");
830     infoPtr = (STATUS_INFO*)Alloc (sizeof(STATUS_INFO));
831     if (!infoPtr) goto create_fail;
832     SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
833
834     infoPtr->Self = hwnd;
835     infoPtr->Notify = lpCreate->hwndParent;
836     infoPtr->numParts = 1;
837     infoPtr->parts = 0;
838     infoPtr->simple = FALSE;
839     infoPtr->clrBk = CLR_DEFAULT;
840     infoPtr->hFont = 0;
841
842     i = SendMessageW(infoPtr->Notify, WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_QUERY);
843     infoPtr->NtfUnicode = (i == NFR_UNICODE);
844
845     GetClientRect (hwnd, &rect);
846     InvalidateRect (hwnd, &rect, 0);
847     UpdateWindow(hwnd);
848
849     ZeroMemory (&nclm, sizeof(nclm));
850     nclm.cbSize = sizeof(nclm);
851     SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, nclm.cbSize, &nclm, 0);
852     infoPtr->hDefaultFont = CreateFontIndirectW (&nclm.lfStatusFont);
853
854     /* initialize simple case */
855     infoPtr->part0.bound = rect;
856     infoPtr->part0.text = 0;
857     infoPtr->part0.x = 0;
858     infoPtr->part0.style = 0;
859     infoPtr->part0.hIcon = 0;
860
861     /* initialize first part */
862     infoPtr->parts = Alloc (sizeof(STATUSWINDOWPART));
863     if (!infoPtr->parts) goto create_fail;
864     infoPtr->parts[0].bound = rect;
865     infoPtr->parts[0].text = 0;
866     infoPtr->parts[0].x = -1;
867     infoPtr->parts[0].style = 0;
868     infoPtr->parts[0].hIcon = 0;
869
870     if (IsWindowUnicode (hwnd)) {
871         infoPtr->bUnicode = TRUE;
872         if (lpCreate->lpszName &&
873             (len = strlenW ((LPCWSTR)lpCreate->lpszName))) {
874             infoPtr->parts[0].text = Alloc ((len + 1)*sizeof(WCHAR));
875             if (!infoPtr->parts[0].text) goto create_fail;
876             strcpyW (infoPtr->parts[0].text, (LPCWSTR)lpCreate->lpszName);
877         }
878     }
879     else {
880         if (lpCreate->lpszName &&
881             (len = strlen((LPCSTR)lpCreate->lpszName))) {
882             DWORD lenW = MultiByteToWideChar( CP_ACP, 0, (LPCSTR)lpCreate->lpszName, -1, NULL, 0 );
883             infoPtr->parts[0].text = Alloc (lenW*sizeof(WCHAR));
884             if (!infoPtr->parts[0].text) goto create_fail;
885             MultiByteToWideChar( CP_ACP, 0, (LPCSTR)lpCreate->lpszName, -1,
886                                  infoPtr->parts[0].text, lenW );
887         }
888     }
889
890     dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
891
892     /* statusbars on managed windows should not have SIZEGRIP style */
893     if ((dwStyle & SBARS_SIZEGRIP) && lpCreate->hwndParent &&
894         GetPropA( lpCreate->hwndParent, "__wine_x11_managed" ))
895         SetWindowLongW (hwnd, GWL_STYLE, dwStyle & ~SBARS_SIZEGRIP);
896
897     if ((hdc = GetDC (hwnd))) {
898         TEXTMETRICW tm;
899         HFONT hOldFont;
900
901         hOldFont = SelectObject (hdc, infoPtr->hDefaultFont);
902         GetTextMetricsW (hdc, &tm);
903         textHeight = tm.tmHeight;
904         SelectObject (hdc, hOldFont);
905         ReleaseDC (hwnd, hdc);
906     }
907     TRACE("    textHeight=%d\n", textHeight);
908
909     if (dwStyle & SBT_TOOLTIPS) {
910         infoPtr->hwndToolTip =
911             CreateWindowExW (0, TOOLTIPS_CLASSW, NULL, 0,
912                              CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
913                              CW_USEDEFAULT, hwnd, 0,
914                              (HINSTANCE)GetWindowLongPtrW(hwnd, GWLP_HINSTANCE), NULL);
915
916         if (infoPtr->hwndToolTip) {
917             NMTOOLTIPSCREATED nmttc;
918
919             nmttc.hdr.hwndFrom = hwnd;
920             nmttc.hdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID);
921             nmttc.hdr.code = NM_TOOLTIPSCREATED;
922             nmttc.hwndToolTips = infoPtr->hwndToolTip;
923
924             SendMessageW (lpCreate->hwndParent, WM_NOTIFY,
925                             (WPARAM)nmttc.hdr.idFrom, (LPARAM)&nmttc);
926         }
927     }
928
929     if (!(dwStyle & CCS_NORESIZE)) { /* don't resize wnd if it doesn't want it ! */
930         GetClientRect (infoPtr->Notify, &rect);
931         width = rect.right - rect.left;
932         infoPtr->height = textHeight + 4 + VERT_BORDER;
933         SetWindowPos(hwnd, 0, lpCreate->x, lpCreate->y - 1,
934                         width, infoPtr->height, SWP_NOZORDER);
935         STATUSBAR_SetPartBounds (infoPtr);
936     }
937
938     return 0;
939
940 create_fail:
941     TRACE("    failed!\n");
942     if (infoPtr) STATUSBAR_WMDestroy(infoPtr);
943     return -1;
944 }
945
946
947 /* in contrast to SB_GETTEXT*, WM_GETTEXT handles the text
948  * of the first part only (usual behaviour) */
949 static INT
950 STATUSBAR_WMGetText (STATUS_INFO *infoPtr, INT size, LPWSTR buf)
951 {
952     INT len;
953
954     TRACE("\n");
955     if (!(infoPtr->parts[0].text))
956         return 0;
957     if (infoPtr->bUnicode)
958         len = strlenW (infoPtr->parts[0].text);
959     else
960         len = WideCharToMultiByte( CP_ACP, 0, infoPtr->parts[0].text, -1, NULL, 0, NULL, NULL )-1;
961
962     if (size > len) {
963         if (infoPtr->bUnicode)
964             strcpyW (buf, infoPtr->parts[0].text);
965         else
966             WideCharToMultiByte( CP_ACP, 0, infoPtr->parts[0].text, -1,
967                                  (LPSTR)buf, len+1, NULL, NULL );
968         return len;
969     }
970
971     return -1;
972 }
973
974
975 static BOOL
976 STATUSBAR_WMNCHitTest (STATUS_INFO *infoPtr, INT x, INT y)
977 {
978     if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) {
979         RECT  rect;
980         POINT pt;
981
982         GetClientRect (infoPtr->Self, &rect);
983
984         pt.x = x;
985         pt.y = y;
986         ScreenToClient (infoPtr->Self, &pt);
987
988         rect.left = rect.right - 13;
989         rect.top += 2;
990
991         if (PtInRect (&rect, pt))
992             return HTBOTTOMRIGHT;
993     }
994
995     return HTERROR;
996 }
997
998
999 static LRESULT
1000 STATUSBAR_WMPaint (STATUS_INFO *infoPtr, HDC hdc)
1001 {
1002     PAINTSTRUCT ps;
1003
1004     TRACE("\n");
1005     if (hdc) return STATUSBAR_Refresh (infoPtr, hdc);
1006     hdc = BeginPaint (infoPtr->Self, &ps);
1007     STATUSBAR_Refresh (infoPtr, hdc);
1008     EndPaint (infoPtr->Self, &ps);
1009
1010     return 0;
1011 }
1012
1013
1014 static LRESULT
1015 STATUSBAR_WMSetFont (STATUS_INFO *infoPtr, HFONT font, BOOL redraw)
1016 {
1017     infoPtr->hFont = font;
1018     TRACE("%p\n", infoPtr->hFont);
1019     if (redraw)
1020         InvalidateRect(infoPtr->Self, NULL, FALSE);
1021
1022     return 0;
1023 }
1024
1025
1026 static BOOL
1027 STATUSBAR_WMSetText (STATUS_INFO *infoPtr, LPCSTR text)
1028 {
1029     STATUSWINDOWPART *part;
1030     int len;
1031
1032     TRACE("\n");
1033     if (infoPtr->numParts == 0)
1034         return FALSE;
1035
1036     part = &infoPtr->parts[0];
1037     /* duplicate string */
1038     if (part->text)
1039         Free (part->text);
1040     part->text = 0;
1041     if (infoPtr->bUnicode) {
1042         if (text && (len = strlenW((LPCWSTR)text))) {
1043             part->text = Alloc ((len+1)*sizeof(WCHAR));
1044             if (!part->text) return FALSE;
1045             strcpyW (part->text, (LPCWSTR)text);
1046         }
1047     }
1048     else {
1049         if (text && (len = lstrlenA(text))) {
1050             DWORD lenW = MultiByteToWideChar( CP_ACP, 0, text, -1, NULL, 0 );
1051             part->text = Alloc (lenW*sizeof(WCHAR));
1052             if (!part->text) return FALSE;
1053             MultiByteToWideChar( CP_ACP, 0, text, -1, part->text, lenW );
1054         }
1055     }
1056
1057     InvalidateRect(infoPtr->Self, &part->bound, FALSE);
1058
1059     return TRUE;
1060 }
1061
1062
1063 static BOOL
1064 STATUSBAR_WMSize (STATUS_INFO *infoPtr, WORD flags)
1065 {
1066     INT  width, x, y;
1067     RECT parent_rect;
1068
1069     /* Need to resize width to match parent */
1070     TRACE("flags %04x\n", flags);
1071
1072     if (flags != SIZE_RESTORED && flags != SIZE_MAXIMIZED)
1073     {
1074         WARN("flags MUST be SIZE_RESTORED or SIZE_MAXIMIZED\n");
1075         return FALSE;
1076     }
1077
1078     if (GetWindowLongW(infoPtr->Self, GWL_STYLE) & CCS_NORESIZE) return FALSE;
1079
1080     /* width and height don't apply */
1081     GetClientRect (infoPtr->Notify, &parent_rect);
1082     width = parent_rect.right - parent_rect.left;
1083     x = parent_rect.left;
1084     y = parent_rect.bottom - infoPtr->height;
1085     MoveWindow (infoPtr->Self, parent_rect.left,
1086                 parent_rect.bottom - infoPtr->height,
1087                 width, infoPtr->height, TRUE);
1088     STATUSBAR_SetPartBounds (infoPtr);
1089     return TRUE;
1090 }
1091
1092
1093 static LRESULT
1094 STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd)
1095 {
1096     if (cmd == NF_REQUERY) {
1097         INT i = SendMessageW(from, WM_NOTIFYFORMAT, (WPARAM)infoPtr->Self, NF_QUERY);
1098         infoPtr->NtfUnicode = (i == NFR_UNICODE);
1099     }
1100     return infoPtr->NtfUnicode ? NFR_UNICODE : NFR_ANSI;
1101 }
1102
1103
1104 static LRESULT
1105 STATUSBAR_SendNotify (STATUS_INFO *infoPtr, UINT code)
1106 {
1107     NMHDR  nmhdr;
1108
1109     TRACE("code %04x\n", code);
1110     nmhdr.hwndFrom = infoPtr->Self;
1111     nmhdr.idFrom = GetWindowLongPtrW (infoPtr->Self, GWLP_ID);
1112     nmhdr.code = code;
1113     SendMessageW (infoPtr->Notify, WM_NOTIFY, 0, (LPARAM)&nmhdr);
1114     return 0;
1115 }
1116
1117
1118
1119 static LRESULT WINAPI
1120 StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
1121 {
1122     STATUS_INFO *infoPtr = (STATUS_INFO *)GetWindowLongPtrW (hwnd, 0);
1123     INT nPart = ((INT) wParam) & 0x00ff;
1124     LRESULT res;
1125
1126     TRACE("hwnd=%p msg=%x wparam=%x lparam=%lx\n", hwnd, msg, wParam, lParam);
1127     if (!infoPtr && msg != WM_CREATE)
1128         return DefWindowProcW (hwnd, msg, wParam, lParam);
1129
1130     switch (msg) {
1131         case SB_GETBORDERS:
1132             return STATUSBAR_GetBorders ((INT *)lParam);
1133
1134         case SB_GETICON:
1135             return (LRESULT)STATUSBAR_GetIcon (infoPtr, nPart);
1136
1137         case SB_GETPARTS:
1138             return STATUSBAR_GetParts (infoPtr, (INT)wParam, (INT *)lParam);
1139
1140         case SB_GETRECT:
1141             return STATUSBAR_GetRect (infoPtr, nPart, (LPRECT)lParam);
1142
1143         case SB_GETTEXTA:
1144             return STATUSBAR_GetTextA (infoPtr, nPart, (LPSTR)lParam);
1145
1146         case SB_GETTEXTW:
1147             return STATUSBAR_GetTextW (infoPtr, nPart, (LPWSTR)lParam);
1148
1149         case SB_GETTEXTLENGTHA:
1150         case SB_GETTEXTLENGTHW:
1151             return STATUSBAR_GetTextLength (infoPtr, nPart);
1152
1153         case SB_GETTIPTEXTA:
1154             return STATUSBAR_GetTipTextA (infoPtr,  LOWORD(wParam), (LPSTR)lParam,  HIWORD(wParam));
1155
1156         case SB_GETTIPTEXTW:
1157             return STATUSBAR_GetTipTextW (infoPtr,  LOWORD(wParam), (LPWSTR)lParam,  HIWORD(wParam));
1158
1159         case SB_GETUNICODEFORMAT:
1160             return infoPtr->bUnicode;
1161
1162         case SB_ISSIMPLE:
1163             return infoPtr->simple;
1164
1165         case SB_SETBKCOLOR:
1166             return STATUSBAR_SetBkColor (infoPtr, (COLORREF)lParam);
1167
1168         case SB_SETICON:
1169             return STATUSBAR_SetIcon (infoPtr, nPart, (HICON)lParam);
1170
1171         case SB_SETMINHEIGHT:
1172             return STATUSBAR_SetMinHeight (infoPtr, (INT)wParam);
1173
1174         case SB_SETPARTS:
1175             return STATUSBAR_SetParts (infoPtr, (INT)wParam, (LPINT)lParam);
1176
1177         case SB_SETTEXTA:
1178             return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPCWSTR)lParam, FALSE);
1179
1180         case SB_SETTEXTW:
1181             return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPCWSTR)lParam, TRUE);
1182
1183         case SB_SETTIPTEXTA:
1184             return STATUSBAR_SetTipTextA (infoPtr, (INT)wParam, (LPSTR)lParam);
1185
1186         case SB_SETTIPTEXTW:
1187             return STATUSBAR_SetTipTextW (infoPtr, (INT)wParam, (LPWSTR)lParam);
1188
1189         case SB_SETUNICODEFORMAT:
1190             return STATUSBAR_SetUnicodeFormat (infoPtr, (BOOL)wParam);
1191
1192         case SB_SIMPLE:
1193             return STATUSBAR_Simple (infoPtr, (BOOL)wParam);
1194
1195         case WM_CREATE:
1196             return STATUSBAR_WMCreate (hwnd, (LPCREATESTRUCTA)lParam);
1197
1198         case WM_DESTROY:
1199             return STATUSBAR_WMDestroy (infoPtr);
1200
1201         case WM_GETFONT:
1202             return (LRESULT)(infoPtr->hFont? infoPtr->hFont : infoPtr->hDefaultFont);
1203
1204         case WM_GETTEXT:
1205             return STATUSBAR_WMGetText (infoPtr, (INT)wParam, (LPWSTR)lParam);
1206
1207         case WM_GETTEXTLENGTH:
1208             return STATUSBAR_GetTextLength (infoPtr, 0);
1209
1210         case WM_LBUTTONDBLCLK:
1211             return STATUSBAR_SendNotify (infoPtr, NM_DBLCLK);
1212
1213         case WM_LBUTTONUP:
1214             return STATUSBAR_SendNotify (infoPtr, NM_CLICK);
1215
1216         case WM_MOUSEMOVE:
1217             return STATUSBAR_Relay2Tip (infoPtr, msg, wParam, lParam);
1218
1219         case WM_NCHITTEST:
1220             res = STATUSBAR_WMNCHitTest(infoPtr, (INT)LOWORD(lParam),
1221                                         (INT)HIWORD(lParam));
1222             if (res != HTERROR) return res;
1223             return DefWindowProcW (hwnd, msg, wParam, lParam);
1224
1225         case WM_NCLBUTTONUP:
1226         case WM_NCLBUTTONDOWN:
1227             PostMessageW (infoPtr->Notify, msg, wParam, lParam);
1228             return 0;
1229
1230         case WM_NOTIFYFORMAT:
1231             return STATUSBAR_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam);
1232
1233         case WM_PAINT:
1234             return STATUSBAR_WMPaint (infoPtr, (HDC)wParam);
1235
1236         case WM_RBUTTONDBLCLK:
1237             return STATUSBAR_SendNotify (infoPtr, NM_RDBLCLK);
1238
1239         case WM_RBUTTONUP:
1240             return STATUSBAR_SendNotify (infoPtr, NM_RCLICK);
1241
1242         case WM_SETFONT:
1243             return STATUSBAR_WMSetFont (infoPtr, (HFONT)wParam, LOWORD(lParam));
1244
1245         case WM_SETTEXT:
1246             return STATUSBAR_WMSetText (infoPtr, (LPCSTR)lParam);
1247
1248         case WM_SIZE:
1249             if (STATUSBAR_WMSize (infoPtr, (WORD)wParam)) return 0;
1250             return DefWindowProcW (hwnd, msg, wParam, lParam);
1251
1252         default:
1253             if ((msg >= WM_USER) && (msg < WM_APP))
1254                 ERR("unknown msg %04x wp=%04x lp=%08lx\n",
1255                      msg, wParam, lParam);
1256             return DefWindowProcW (hwnd, msg, wParam, lParam);
1257     }
1258 }
1259
1260
1261 /***********************************************************************
1262  * STATUS_Register [Internal]
1263  *
1264  * Registers the status window class.
1265  */
1266
1267 void
1268 STATUS_Register (void)
1269 {
1270     WNDCLASSW wndClass;
1271
1272     ZeroMemory (&wndClass, sizeof(WNDCLASSW));
1273     wndClass.style         = CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW;
1274     wndClass.lpfnWndProc   = StatusWindowProc;
1275     wndClass.cbClsExtra    = 0;
1276     wndClass.cbWndExtra    = sizeof(STATUS_INFO *);
1277     wndClass.hCursor       = LoadCursorW (0, (LPWSTR)IDC_ARROW);
1278     wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
1279     wndClass.lpszClassName = STATUSCLASSNAMEW;
1280
1281     RegisterClassW (&wndClass);
1282 }
1283
1284
1285 /***********************************************************************
1286  * STATUS_Unregister [Internal]
1287  *
1288  * Unregisters the status window class.
1289  */
1290
1291 void
1292 STATUS_Unregister (void)
1293 {
1294     UnregisterClassW (STATUSCLASSNAMEW, NULL);
1295 }