source: trunk/src/comctl32/status.c@ 1804

Last change on this file since 1804 was 1804, checked in by cbratschi, 26 years ago

* empty log message *

File size: 33.9 KB
Line 
1/* $Id: status.c,v 1.15 1999-11-21 18:13:44 cbratschi Exp $ */
2/*
3 * Interface code to StatusWindow widget/control
4 *
5 * Copyright 1996 Bruce Milner
6 * Copyright 1998, 1999 Eric Kohl
7 * Copyright 1999 Achim Hasenmueller
8 * Copyright 1999 Christoph Bratschi
9 */
10
11/* WINE 990923 level */
12
13#include "winbase.h"
14#include "commctrl.h"
15#include "comctl32.h"
16#include "status.h"
17#include <string.h>
18
19/*
20 * Run tests using Waite Group Windows95 API Bible Vol. 1&2
21 * The second cdrom contains executables drawstat.exe,gettext.exe,
22 * simple.exe, getparts.exe, setparts.exe, statwnd.exe
23 */
24
25/*
26 * Fixme/Todo
27 * 1) Don't hard code bar to bottom of window, allow CCS_TOP also.
28 * 2) Tooltip support (almost done).
29 */
30
31/* CB: Odin problems
32 - DrawText: DT_VCENTER doesn't work
33*/
34
35#define _MAX(a,b) (((a)>(b))?(a):(b))
36#define _MIN(a,b) (((a)>(b))?(b):(a))
37
38#define HORZ_BORDER 0
39#define VERT_BORDER 2
40#define VERT_SPACE 2 //space between boder and text
41#define HORZ_GAP 2
42#define TOP_MARGIN 2
43#define ICON_SPACE 2
44#define TEXT_SPACE 3
45
46#define STATUSBAR_GetInfoPtr(hwnd) ((STATUSWINDOWINFO *)GetWindowLongA (hwnd, 0))
47
48
49static RECT STATUSBAR_GetSizeBox(HWND hwnd)
50{
51 RECT rect;
52
53 GetClientRect(hwnd,&rect);
54 rect.left = rect.right-GetSystemMetrics(SM_CXVSCROLL);
55 rect.top = rect.bottom-GetSystemMetrics(SM_CYHSCROLL);
56
57 return rect;
58}
59
60static void
61STATUSBAR_DrawSizeGrip (HDC hdc, LPRECT lpRect)
62{
63 HPEN hOldPen;
64 POINT pt;
65 INT i;
66
67 pt.x = lpRect->right - 1;
68 pt.y = lpRect->bottom - 1;
69
70 hOldPen = SelectObject (hdc, GetSysColorPen (COLOR_3DFACE));
71 MoveToEx (hdc, pt.x - 12, pt.y, NULL);
72 LineTo (hdc, pt.x, pt.y);
73 LineTo (hdc, pt.x, pt.y - 12);
74
75 pt.x--;
76 pt.y--;
77
78 SelectObject (hdc, GetSysColorPen (COLOR_3DSHADOW));
79 for (i = 1; i < 11; i += 4) {
80 MoveToEx (hdc, pt.x - i, pt.y, NULL);
81 LineTo (hdc, pt.x, pt.y - i);
82
83 MoveToEx (hdc, pt.x - i-1, pt.y, NULL);
84 LineTo (hdc, pt.x, pt.y - i-1);
85 }
86
87 SelectObject (hdc, GetSysColorPen (COLOR_3DHIGHLIGHT));
88 for (i = 3; i < 13; i += 4) {
89 MoveToEx (hdc, pt.x - i, pt.y, NULL);
90 LineTo (hdc, pt.x, pt.y - i);
91 }
92
93 SelectObject (hdc, hOldPen);
94}
95
96
97static void
98STATUSBAR_DrawPart (HDC hdc, STATUSWINDOWPART *part)
99{
100 RECT r = part->bound;
101 UINT border = BDR_SUNKENOUTER;
102
103 if (part->style & SBT_POPOUT)
104 border = BDR_RAISEDOUTER;
105 else if (part->style & SBT_NOBORDERS)
106 border = 0;
107
108 DrawEdge(hdc, &r, border, BF_RECT|BF_ADJUST);
109
110 r.bottom -= VERT_SPACE;
111 r.top += VERT_SPACE;
112
113 /* draw the icon */
114 if (part->hIcon) {
115 INT cy = r.bottom - r.top;
116
117 r.left += ICON_SPACE;
118 DrawIconEx (hdc, r.left, r.top, part->hIcon, cy, cy, 0, 0, DI_NORMAL);
119 r.left += cy;
120 }
121
122 /* now draw text */
123 if (part->text) {
124 int oldbkmode = SetBkMode(hdc, TRANSPARENT);
125 LPWSTR p = (LPWSTR)part->text;
126 UINT align = DT_LEFT;
127 if (*p == L'\t') {
128 p++;
129 align = DT_CENTER;
130
131 if (*p == L'\t') {
132 p++;
133 align = DT_RIGHT;
134 }
135 }
136 r.left += TEXT_SPACE;
137 DrawTextW (hdc, p, lstrlenW (p), &r, align|DT_VCENTER|DT_SINGLELINE);
138 if (oldbkmode != TRANSPARENT)
139 SetBkMode(hdc, oldbkmode);
140 }
141}
142
143
144static VOID
145STATUSBAR_RefreshPart (HWND hwnd, STATUSWINDOWPART *part, HDC hdc)
146{
147 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
148 HBRUSH hbrBk;
149 HFONT hOldFont;
150
151 if (!IsWindowVisible (hwnd))
152 return;
153
154 if (self->clrBk != CLR_DEFAULT)
155 hbrBk = CreateSolidBrush (self->clrBk);
156 else
157 hbrBk = GetSysColorBrush (COLOR_3DFACE);
158 FillRect(hdc, &part->bound, hbrBk);
159
160 hOldFont = SelectObject (hdc, self->hFont ? self->hFont : self->hDefaultFont);
161
162 if (part->style & SBT_OWNERDRAW) {
163 DRAWITEMSTRUCT dis;
164
165 dis.CtlID = GetWindowLongA (hwnd, GWL_ID);
166 dis.itemID = -1;
167 dis.hwndItem = hwnd;
168 dis.hDC = hdc;
169 dis.rcItem = part->bound;
170 dis.itemData = (INT)part->text;
171 SendMessageA (GetParent (hwnd), WM_DRAWITEM,
172 (WPARAM)dis.CtlID, (LPARAM)&dis);
173 }
174 else
175 STATUSBAR_DrawPart (hdc, part);
176
177 SelectObject (hdc, hOldFont);
178
179 if (self->clrBk != CLR_DEFAULT)
180 DeleteObject (hbrBk);
181
182 if (GetWindowLongA (hwnd, GWL_STYLE) & SBARS_SIZEGRIP) {
183 RECT rect;
184
185 GetClientRect (hwnd, &rect);
186 STATUSBAR_DrawSizeGrip (hdc, &rect);
187 }
188}
189
190
191static BOOL
192STATUSBAR_Refresh (HWND hwnd, HDC hdc)
193{
194 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
195 int i;
196 RECT rect;
197 HBRUSH hbrBk;
198 HFONT hOldFont;
199
200 if (!IsWindowVisible(hwnd))
201 return (TRUE);
202
203 GetClientRect (hwnd, &rect);
204
205 if (infoPtr->clrBk != CLR_DEFAULT)
206 hbrBk = CreateSolidBrush (infoPtr->clrBk);
207 else
208 hbrBk = GetSysColorBrush (COLOR_3DFACE);
209 FillRect(hdc, &rect, hbrBk);
210
211 hOldFont = SelectObject (hdc, infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont);
212
213 if (infoPtr->simple) {
214 STATUSBAR_DrawPart (hdc, &infoPtr->part0);
215 }
216 else {
217 for (i = 0; i < infoPtr->numParts; i++) {
218 if (infoPtr->parts[i].style & SBT_OWNERDRAW) {
219 DRAWITEMSTRUCT dis;
220
221 dis.CtlID = GetWindowLongA (hwnd, GWL_ID);
222 dis.itemID = -1;
223 dis.hwndItem = hwnd;
224 dis.hDC = hdc;
225 dis.rcItem = infoPtr->parts[i].bound;
226 dis.itemData = (INT)infoPtr->parts[i].text;
227 SendMessageA (GetParent (hwnd), WM_DRAWITEM,
228 (WPARAM)dis.CtlID, (LPARAM)&dis);
229 }
230 else
231 STATUSBAR_DrawPart (hdc, &infoPtr->parts[i]);
232 }
233 }
234
235 SelectObject (hdc, hOldFont);
236
237 if (infoPtr->clrBk != CLR_DEFAULT)
238 DeleteObject (hbrBk);
239
240 if (GetWindowLongA(hwnd, GWL_STYLE) & SBARS_SIZEGRIP)
241 STATUSBAR_DrawSizeGrip (hdc, &rect);
242
243 return TRUE;
244}
245
246
247static void
248STATUSBAR_SetPartBounds (HWND hwnd)
249{
250 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
251 STATUSWINDOWPART *part;
252 RECT rect, *r;
253 int i;
254
255 /* get our window size */
256 GetClientRect (hwnd, &rect);
257
258 rect.top += TOP_MARGIN;
259
260 /* set bounds for simple rectangle */
261 self->part0.bound = rect;
262
263 /* set bounds for non-simple rectangles */
264 for (i = 0; i < self->numParts; i++) {
265 part = &self->parts[i];
266 r = &self->parts[i].bound;
267 r->top = rect.top;
268 r->bottom = rect.bottom;
269 if (i == 0)
270 r->left = 0;
271 else
272 r->left = self->parts[i-1].bound.right + HORZ_GAP;
273 if (part->x == -1)
274 r->right = rect.right;
275 else
276 r->right = part->x;
277
278 if (self->hwndToolTip) {
279 TTTOOLINFOA ti;
280
281 ti.cbSize = sizeof(TTTOOLINFOA);
282 ti.hwnd = hwnd;
283 ti.uId = i;
284 ti.rect = *r;
285 SendMessageA (self->hwndToolTip, TTM_NEWTOOLRECTA,
286 0, (LPARAM)&ti);
287 }
288 }
289}
290
291
292static VOID
293STATUSBAR_RelayEvent (HWND hwndTip, HWND hwndMsg, UINT uMsg,
294 WPARAM wParam, LPARAM lParam)
295{
296 MSG msg;
297
298 msg.hwnd = hwndMsg;
299 msg.message = uMsg;
300 msg.wParam = wParam;
301 msg.lParam = lParam;
302 msg.time = GetMessageTime ();
303 msg.pt.x = LOWORD(GetMessagePos ());
304 msg.pt.y = HIWORD(GetMessagePos ());
305
306 SendMessageA (hwndTip, TTM_RELAYEVENT, 0, (LPARAM)&msg);
307}
308
309
310static LRESULT
311STATUSBAR_GetBorders (LPARAM lParam)
312{
313 LPINT out = (LPINT) lParam;
314
315 out[0] = HORZ_BORDER; /* horizontal border width */
316 out[1] = VERT_BORDER; /* vertical border width */
317 out[2] = HORZ_GAP; /* width of border between rectangles */
318
319 return TRUE;
320}
321
322
323static LRESULT
324STATUSBAR_GetIcon (HWND hwnd, WPARAM wParam)
325{
326 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
327 INT nPart;
328
329 nPart = (INT)wParam & 0x00ff;
330 if ((nPart < -1) || (nPart >= self->numParts))
331 return 0;
332
333 if (nPart == -1)
334 return (self->part0.hIcon);
335 else
336 return (self->parts[nPart].hIcon);
337}
338
339
340static LRESULT
341STATUSBAR_GetParts (HWND hwnd, WPARAM wParam, LPARAM lParam)
342{
343 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
344 LPINT parts;
345 INT num_parts;
346 INT i;
347
348 num_parts = (INT) wParam;
349 parts = (LPINT) lParam;
350 if (parts) {
351 return (infoPtr->numParts);
352 for (i = 0; i < num_parts; i++) {
353 parts[i] = infoPtr->parts[i].x;
354 }
355 }
356 return (infoPtr->numParts);
357}
358
359
360static LRESULT
361STATUSBAR_GetRect (HWND hwnd, WPARAM wParam, LPARAM lParam)
362{
363 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
364 int part_num;
365 LPRECT rect;
366
367 part_num = ((INT) wParam) & 0x00ff;
368 rect = (LPRECT) lParam;
369 if (infoPtr->simple)
370 *rect = infoPtr->part0.bound;
371 else
372 *rect = infoPtr->parts[part_num].bound;
373 return TRUE;
374}
375
376
377static LRESULT
378STATUSBAR_GetTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
379{
380 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
381 STATUSWINDOWPART *part;
382 INT nPart;
383 LRESULT result;
384
385 nPart = ((INT) wParam) & 0x00ff;
386 if (self->simple)
387 part = &self->part0;
388 else
389 part = &self->parts[nPart];
390
391 if (part->style & SBT_OWNERDRAW)
392 result = (LRESULT)part->text;
393 else {
394 result = part->text ? lstrlenW (part->text) : 0;
395 result |= (part->style << 16);
396 if (lParam && LOWORD(result))
397 lstrcpyWtoA((LPSTR)lParam, part->text);
398 }
399 return result;
400}
401
402
403static LRESULT
404STATUSBAR_GetTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
405{
406 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
407 STATUSWINDOWPART *part;
408 INT nPart;
409 LRESULT result;
410
411 nPart = ((INT)wParam) & 0x00ff;
412 if (infoPtr->simple)
413 part = &infoPtr->part0;
414 else
415 part = &infoPtr->parts[nPart];
416
417 if (part->style & SBT_OWNERDRAW)
418 result = (LRESULT)part->text;
419 else {
420 result = part->text ? lstrlenW (part->text) : 0;
421 result |= (part->style << 16);
422 if (lParam)
423 lstrcpyW ((LPWSTR)lParam, part->text);
424 }
425 return result;
426}
427
428
429static LRESULT
430STATUSBAR_GetTextLength (HWND hwnd, WPARAM wParam)
431{
432 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
433 STATUSWINDOWPART *part;
434 INT part_num;
435 DWORD result;
436
437 part_num = ((INT) wParam) & 0x00ff;
438
439 if (infoPtr->simple)
440 part = &infoPtr->part0;
441 else
442 part = &infoPtr->parts[part_num];
443
444 if (part->text)
445 result = lstrlenW(part->text);
446 else
447 result = 0;
448
449 result |= (part->style << 16);
450 return result;
451}
452
453
454static LRESULT
455STATUSBAR_GetTipTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
456{
457 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
458
459 if (infoPtr->hwndToolTip) {
460 TTTOOLINFOA ti;
461 ti.cbSize = sizeof(TTTOOLINFOA);
462 ti.hwnd = hwnd;
463 ti.uId = LOWORD(wParam);
464 SendMessageA (infoPtr->hwndToolTip, TTM_GETTEXTA, 0, (LPARAM)&ti);
465
466 if (ti.lpszText)
467 lstrcpynA ((LPSTR)lParam, ti.lpszText, HIWORD(wParam));
468 }
469
470 return 0;
471}
472
473
474static LRESULT
475STATUSBAR_GetTipTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
476{
477 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
478
479 if (infoPtr->hwndToolTip) {
480 TTTOOLINFOW ti;
481 ti.cbSize = sizeof(TTTOOLINFOW);
482 ti.hwnd = hwnd;
483 ti.uId = LOWORD(wParam);
484 SendMessageW (infoPtr->hwndToolTip, TTM_GETTEXTW, 0, (LPARAM)&ti);
485
486 if (ti.lpszText)
487 lstrcpynW ((LPWSTR)lParam, ti.lpszText, HIWORD(wParam));
488 }
489
490 return 0;
491}
492
493
494static LRESULT
495STATUSBAR_GetUnicodeFormat (HWND hwnd)
496{
497 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
498 return infoPtr->bUnicode;
499}
500
501static LRESULT
502STATUSBAR_WMLButtonDown(HWND hwnd,WPARAM wParam,LPARAM lParam)
503{
504 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
505
506 if (dwStyle & SBARS_SIZEGRIP && !(dwStyle & CCS_TOP))
507 {
508 RECT rect = STATUSBAR_GetSizeBox(hwnd);
509 POINT point;
510
511 point.x = (SHORT)LOWORD(lParam);
512 point.y = (SHORT)HIWORD(lParam);
513 if (PtInRect(&rect,point)) TrackWin32Window(GetParent(hwnd),FALSE);
514
515 return 0;
516 }
517
518 return DefWindowProcA(hwnd,WM_LBUTTONDOWN,wParam,lParam);
519}
520
521static LRESULT
522STATUSBAR_IsSimple (HWND hwnd)
523{
524 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
525 return infoPtr->simple;
526}
527
528
529static LRESULT
530STATUSBAR_SetBkColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
531{
532 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
533 COLORREF oldBkColor;
534 HDC hdc;
535
536 oldBkColor = self->clrBk;
537 self->clrBk = (COLORREF)lParam;
538 hdc = GetDC (hwnd);
539 STATUSBAR_Refresh (hwnd, hdc);
540 ReleaseDC (hwnd, hdc);
541
542 return oldBkColor;
543}
544
545
546static LRESULT
547STATUSBAR_SetIcon (HWND hwnd, WPARAM wParam, LPARAM lParam)
548{
549 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
550 INT nPart = (INT)wParam & 0x00ff;
551 HDC hdc;
552
553 if ((nPart < -1) || (nPart >= self->numParts))
554 return FALSE;
555
556 hdc = GetDC (hwnd);
557 if (nPart == -1) {
558 self->part0.hIcon = (HICON)lParam;
559 if (self->simple)
560 STATUSBAR_RefreshPart (hwnd, &self->part0, hdc);
561 }
562 else {
563 self->parts[nPart].hIcon = (HICON)lParam;
564 if (!(self->simple))
565 STATUSBAR_RefreshPart (hwnd, &self->parts[nPart], hdc);
566 }
567 ReleaseDC (hwnd, hdc);
568
569 return TRUE;
570}
571
572
573static LRESULT
574STATUSBAR_SetMinHeight (HWND hwnd, WPARAM wParam, LPARAM lParam)
575{
576 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
577
578 if (IsWindowVisible (hwnd)) {
579 HWND parent = GetParent (hwnd);
580 INT width, x, y;
581 RECT parent_rect;
582
583 GetClientRect (parent, &parent_rect);
584 self->height = (INT)wParam + VERT_BORDER;
585 width = parent_rect.right - parent_rect.left;
586 x = parent_rect.left;
587 y = parent_rect.bottom - self->height;
588 MoveWindow (hwnd, parent_rect.left,
589 parent_rect.bottom - self->height,
590 width, self->height, TRUE);
591 STATUSBAR_SetPartBounds (hwnd);
592 }
593
594 return TRUE;
595}
596
597
598static LRESULT
599STATUSBAR_SetParts (HWND hwnd, WPARAM wParam, LPARAM lParam)
600{
601 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
602 STATUSWINDOWPART *tmp;
603 HDC hdc;
604 LPINT parts;
605 int i;
606 int oldNumParts;
607
608 if (self->simple)
609 self->simple = FALSE;
610
611 oldNumParts = self->numParts;
612 self->numParts = (INT) wParam;
613 parts = (LPINT) lParam;
614 if (oldNumParts > self->numParts) {
615 for (i = self->numParts ; i < oldNumParts; i++) {
616 if (self->parts[i].text && !(self->parts[i].style & SBT_OWNERDRAW))
617 COMCTL32_Free (self->parts[i].text);
618 }
619 }
620 else if (oldNumParts < self->numParts) {
621 tmp = COMCTL32_Alloc (sizeof(STATUSWINDOWPART) * self->numParts);
622 for (i = 0; i < oldNumParts; i++) {
623 tmp[i] = self->parts[i];
624 }
625 if (self->parts)
626 COMCTL32_Free (self->parts);
627 self->parts = tmp;
628 }
629
630 for (i = 0; i < self->numParts; i++) {
631 self->parts[i].x = parts[i];
632 }
633
634 if (self->hwndToolTip) {
635 INT nTipCount =
636 SendMessageA (self->hwndToolTip, TTM_GETTOOLCOUNT, 0, 0);
637
638 if (nTipCount < self->numParts) {
639 /* add tools */
640 TTTOOLINFOA ti;
641 INT i;
642
643 ZeroMemory (&ti, sizeof(TTTOOLINFOA));
644 ti.cbSize = sizeof(TTTOOLINFOA);
645 ti.hwnd = hwnd;
646 for (i = nTipCount; i < self->numParts; i++) {
647// TRACE (statusbar, "add tool %d\n", i);
648 ti.uId = i;
649 SendMessageA (self->hwndToolTip, TTM_ADDTOOLA,
650 0, (LPARAM)&ti);
651 }
652 }
653 else if (nTipCount > self->numParts) {
654 /* delete tools */
655 INT i;
656
657 for (i = nTipCount - 1; i >= self->numParts; i--) {
658
659// FIXME (statusbar, "delete tool %d\n", i);
660
661 }
662 }
663 }
664
665 STATUSBAR_SetPartBounds (hwnd);
666
667 hdc = GetDC (hwnd);
668 STATUSBAR_Refresh (hwnd, hdc);
669 ReleaseDC (hwnd, hdc);
670
671 return TRUE;
672}
673
674
675static LRESULT
676STATUSBAR_SetTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
677{
678 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
679 STATUSWINDOWPART *part;
680 int part_num;
681 int style;
682 LPSTR text;
683 LPWSTR newText;
684 int len;
685 HDC hdc;
686
687 text = (LPSTR) lParam;
688 part_num = ((INT) wParam) & 0x00ff;
689 style = ((INT) wParam) & 0xff00;
690
691 if ((self->simple) || (self->parts==NULL) || (part_num==255))
692 part = &self->part0;
693 else
694 part = &self->parts[part_num];
695 if (!part) return FALSE;
696
697 if (style & SBT_OWNERDRAW)
698 {
699 if (!(part->style & SBT_OWNERDRAW) && part->text) COMCTL32_Free(part->text);
700 part->text = (LPWSTR)text;
701 } else
702 {
703 //compare
704 if (text && (len = lstrlenA(text)))
705 {
706 newText = COMCTL32_Alloc((len+1)*sizeof(WCHAR));
707 lstrcpyAtoW (newText,text);
708 } else newText = NULL;
709 if (lstrcmpW(part->text,newText) == 0)
710 {
711 COMCTL32_Free(newText);
712 if (part->style != style)
713 {
714 hdc = GetDC(hwnd);
715 STATUSBAR_RefreshPart(hwnd,part,hdc);
716 ReleaseDC(hwnd, hdc);
717 }
718 return TRUE;
719 }
720
721 COMCTL32_Free(part->text);
722 part->text = newText;
723 }
724 part->style = style;
725
726 hdc = GetDC (hwnd);
727 STATUSBAR_RefreshPart (hwnd, part, hdc);
728 ReleaseDC (hwnd, hdc);
729
730 return TRUE;
731}
732
733
734static LRESULT
735STATUSBAR_SetTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
736{
737 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
738 STATUSWINDOWPART *part;
739 INT part_num, style, len;
740 LPWSTR text;
741 HDC hdc;
742
743 text = (LPWSTR) lParam;
744 part_num = ((INT) wParam) & 0x00ff;
745 style = ((INT) wParam) & 0xff00;
746
747 if ((self->simple) || (self->parts==NULL) || (part_num==255))
748 part = &self->part0;
749 else
750 part = &self->parts[part_num];
751 if (!part) return FALSE;
752
753 if (style & SBT_OWNERDRAW)
754 {
755 if (!(part->style & SBT_OWNERDRAW) && part->text) COMCTL32_Free(part->text);
756 part->text = text;
757 } else
758 {
759 //compare
760 if (lstrcmpW(part->text,text) == 0)
761 {
762 if (part->style != style)
763 {
764 hdc = GetDC(hwnd);
765 STATUSBAR_RefreshPart(hwnd,part,hdc);
766 ReleaseDC(hwnd, hdc);
767 }
768 return TRUE;
769 }
770
771 /* duplicate string */
772 COMCTL32_Free(part->text);
773 if (text && (len = lstrlenW(text)))
774 {
775 part->text = COMCTL32_Alloc((len+1)*sizeof(WCHAR));
776 lstrcpyW(part->text,text);
777 }
778 }
779 part->style = style;
780
781 hdc = GetDC (hwnd);
782 STATUSBAR_RefreshPart (hwnd, part, hdc);
783 ReleaseDC (hwnd, hdc);
784
785 return TRUE;
786}
787
788
789static LRESULT
790STATUSBAR_SetTipTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
791{
792 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
793
794// TRACE (statusbar, "part %d: \"%s\"\n", (INT)wParam, (LPSTR)lParam);
795 if (infoPtr->hwndToolTip) {
796 TTTOOLINFOA ti;
797 ti.cbSize = sizeof(TTTOOLINFOA);
798 ti.hwnd = hwnd;
799 ti.uId = (INT)wParam;
800 ti.hinst = 0;
801 ti.lpszText = (LPSTR)lParam;
802 SendMessageA (infoPtr->hwndToolTip, TTM_UPDATETIPTEXTA,
803 0, (LPARAM)&ti);
804 }
805
806 return 0;
807}
808
809
810static LRESULT
811STATUSBAR_SetTipTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
812{
813 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
814
815// TRACE (statusbar, "part %d: \"%s\"\n", (INT)wParam, (LPSTR)lParam);
816 if (infoPtr->hwndToolTip) {
817 TTTOOLINFOW ti;
818 ti.cbSize = sizeof(TTTOOLINFOW);
819 ti.hwnd = hwnd;
820 ti.uId = (INT)wParam;
821 ti.hinst = 0;
822 ti.lpszText = (LPWSTR)lParam;
823 SendMessageW (infoPtr->hwndToolTip, TTM_UPDATETIPTEXTW,
824 0, (LPARAM)&ti);
825 }
826
827 return 0;
828}
829
830
831static LRESULT
832STATUSBAR_SetUnicodeFormat (HWND hwnd, WPARAM wParam)
833{
834 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
835 BOOL bTemp = infoPtr->bUnicode;
836
837// TRACE (statusbar, "(0x%x)\n", (BOOL)wParam);
838 infoPtr->bUnicode = (BOOL)wParam;
839
840 return bTemp;
841}
842
843
844static LRESULT
845STATUSBAR_Simple (HWND hwnd, WPARAM wParam, LPARAM lParam)
846{
847 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
848 HDC hdc;
849 NMHDR nmhdr;
850
851 infoPtr->simple = (BOOL)wParam;
852
853 /* send notification */
854 nmhdr.hwndFrom = hwnd;
855 nmhdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
856 nmhdr.code = SBN_SIMPLEMODECHANGE;
857 SendMessageA (GetParent (hwnd), WM_NOTIFY, 0, (LPARAM)&nmhdr);
858
859 hdc = GetDC (hwnd);
860 STATUSBAR_Refresh (hwnd, hdc);
861 ReleaseDC (hwnd, hdc);
862
863 return TRUE;
864}
865
866
867static LRESULT
868STATUSBAR_WMCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
869{
870 LPCREATESTRUCTA lpCreate = (LPCREATESTRUCTA)lParam;
871 NONCLIENTMETRICSA nclm;
872 RECT rect;
873 int width, len;
874 HDC hdc;
875 STATUSWINDOWINFO *self;
876
877 self = (STATUSWINDOWINFO*)COMCTL32_Alloc (sizeof(STATUSWINDOWINFO));
878 SetWindowLongA (hwnd, 0, (DWORD)self);
879
880 self->numParts = 1;
881 self->parts = 0;
882 self->simple = FALSE;
883 self->clrBk = CLR_DEFAULT;
884 self->hFont = 0;
885 GetClientRect (hwnd, &rect);
886
887 nclm.cbSize = sizeof(NONCLIENTMETRICSA);
888 SystemParametersInfoA (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
889 self->hDefaultFont = CreateFontIndirectA (&nclm.lfStatusFont);
890
891 /* initialize simple case */
892 self->part0.bound = rect;
893 self->part0.text = 0;
894 self->part0.x = 0;
895 self->part0.style = 0;
896 self->part0.hIcon = 0;
897
898 /* initialize first part */
899 self->parts = COMCTL32_Alloc (sizeof(STATUSWINDOWPART));
900 self->parts[0].bound = rect;
901 self->parts[0].text = 0;
902 self->parts[0].x = -1;
903 self->parts[0].style = 0;
904 self->parts[0].hIcon = 0;
905
906 if (IsWindowUnicode (hwnd)) {
907 self->bUnicode = TRUE;
908 if (lpCreate->lpszName &&
909 (len = lstrlenW ((LPCWSTR)lpCreate->lpszName))) {
910 self->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));
911 lstrcpyW (self->parts[0].text, (LPCWSTR)lpCreate->lpszName);
912 }
913 }
914 else {
915 if (lpCreate->lpszName &&
916 (len = lstrlenA ((LPCSTR)lpCreate->lpszName))) {
917 self->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));
918 lstrcpyAtoW (self->parts[0].text, (char*)lpCreate->lpszName);
919 }
920 }
921
922 hdc = GetDC(0);
923 if (hdc) {
924 TEXTMETRICA tm;
925 HFONT hOldFont;
926
927 hOldFont = SelectObject (hdc,self->hDefaultFont);
928 GetTextMetricsA(hdc, &tm);
929 self->textHeight = tm.tmHeight;
930 SelectObject (hdc, hOldFont);
931 ReleaseDC(0, hdc);
932 }
933
934 if (GetWindowLongA (hwnd, GWL_STYLE) & SBT_TOOLTIPS) {
935 self->hwndToolTip =
936 CreateWindowExA (0, TOOLTIPS_CLASSA, NULL, 0,
937 CW_USEDEFAULT, CW_USEDEFAULT,
938 CW_USEDEFAULT, CW_USEDEFAULT,
939 hwnd, 0,
940 GetWindowLongA (hwnd, GWL_HINSTANCE), NULL);
941
942 if (self->hwndToolTip) {
943 NMTOOLTIPSCREATED nmttc;
944
945 nmttc.hdr.hwndFrom = hwnd;
946 nmttc.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
947 nmttc.hdr.code = NM_TOOLTIPSCREATED;
948 nmttc.hwndToolTips = self->hwndToolTip;
949
950 SendMessageA (GetParent (hwnd), WM_NOTIFY,
951 (WPARAM)nmttc.hdr.idFrom, (LPARAM)&nmttc);
952 }
953 }
954
955 GetClientRect (GetParent (hwnd), &rect);
956 width = rect.right - rect.left;
957 self->height = self->textHeight + 4 + VERT_BORDER;
958 MoveWindow (hwnd, lpCreate->x, lpCreate->y-1,
959 width, self->height, FALSE);
960 STATUSBAR_SetPartBounds (hwnd);
961
962 return 0;
963}
964
965
966static LRESULT
967STATUSBAR_WMDestroy (HWND hwnd)
968{
969 STATUSWINDOWINFO *self = STATUSBAR_GetInfoPtr (hwnd);
970 int i;
971
972 for (i = 0; i < self->numParts; i++) {
973 if (self->parts[i].text && !(self->parts[i].style & SBT_OWNERDRAW))
974 COMCTL32_Free (self->parts[i].text);
975 }
976 if (self->part0.text && !(self->part0.style & SBT_OWNERDRAW))
977 COMCTL32_Free (self->part0.text);
978 COMCTL32_Free (self->parts);
979
980 /* delete default font */
981 if (self->hDefaultFont)
982 DeleteObject (self->hDefaultFont);
983
984 /* delete tool tip control */
985 if (self->hwndToolTip)
986 DestroyWindow (self->hwndToolTip);
987
988 COMCTL32_Free (self);
989
990 return 0;
991}
992
993
994static LRESULT
995STATUSBAR_WMGetFont (HWND hwnd)
996{
997 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
998 return infoPtr->hFont;
999}
1000
1001
1002static LRESULT
1003STATUSBAR_WMGetText (HWND hwnd, WPARAM wParam, LPARAM lParam)
1004{
1005 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
1006 INT len;
1007
1008 if (!(infoPtr->parts[0].text))
1009 return 0;
1010 len = lstrlenW (infoPtr->parts[0].text);
1011 if (wParam > len) {
1012 if (infoPtr->bUnicode)
1013 lstrcpyW ((LPWSTR)lParam, infoPtr->parts[0].text);
1014 else
1015 lstrcpyWtoA ((LPSTR)lParam, infoPtr->parts[0].text);
1016 return len;
1017 }
1018
1019 return -1;
1020}
1021
1022static LRESULT STATUSBAR_WMSetCursor(HWND hwnd,WPARAM wParam,LPARAM lParam)
1023{
1024 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
1025
1026 if (dwStyle & SBARS_SIZEGRIP)
1027 {
1028 RECT rect = STATUSBAR_GetSizeBox(hwnd);
1029 POINT pt;
1030
1031 GetCursorPos(&pt);
1032 ScreenToClient(hwnd,&pt);
1033
1034 if (PtInRect(&rect,pt))
1035 {
1036 SetCursor(LoadCursorA(0,IDC_SIZENWSEA));
1037 return TRUE;
1038 }
1039 }
1040
1041 return DefWindowProcA(hwnd,WM_SETCURSOR,wParam,lParam);
1042}
1043
1044static LRESULT
1045STATUSBAR_WMMouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
1046{
1047 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr(hwnd);
1048
1049 if (infoPtr->hwndToolTip)
1050 STATUSBAR_RelayEvent (infoPtr->hwndToolTip, hwnd,
1051 WM_MOUSEMOVE, wParam, lParam);
1052 return 0;
1053}
1054
1055
1056static LRESULT
1057STATUSBAR_WMNCHitTest (HWND hwnd, WPARAM wParam, LPARAM lParam)
1058{
1059 if (GetWindowLongA (hwnd, GWL_STYLE) & SBARS_SIZEGRIP) {
1060 RECT rect;
1061 POINT pt;
1062
1063 GetClientRect (hwnd, &rect);
1064
1065 pt.x = (INT)LOWORD(lParam);
1066 pt.y = (INT)HIWORD(lParam);
1067 ScreenToClient (hwnd, &pt);
1068
1069 rect.left = rect.right - 13;
1070 rect.top += 2;
1071
1072 if (PtInRect (&rect, pt))
1073 return HTBOTTOMRIGHT;
1074 }
1075
1076 return DefWindowProcA (hwnd, WM_NCHITTEST, wParam, lParam);
1077}
1078
1079
1080static LRESULT
1081STATUSBAR_WMNCLButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
1082{
1083 PostMessageA (GetParent (hwnd), WM_NCLBUTTONDOWN, wParam, lParam);
1084 return 0;
1085}
1086
1087
1088static LRESULT
1089STATUSBAR_WMNCLButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
1090{
1091 PostMessageA (GetParent (hwnd), WM_NCLBUTTONUP, wParam, lParam);
1092 return 0;
1093}
1094
1095
1096static LRESULT
1097STATUSBAR_WMPaint (HWND hwnd, WPARAM wParam)
1098{
1099 HDC hdc;
1100 PAINTSTRUCT ps;
1101
1102 hdc = wParam==0 ? BeginPaint (hwnd, &ps) : (HDC)wParam;
1103 STATUSBAR_Refresh (hwnd, hdc);
1104 if (!wParam)
1105 EndPaint (hwnd, &ps);
1106
1107 return 0;
1108}
1109
1110
1111static LRESULT
1112STATUSBAR_WMSetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
1113{
1114 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
1115
1116 infoPtr->hFont = (HFONT)wParam;
1117 if (LOWORD(lParam) == TRUE) {
1118 HDC hdc = GetDC (hwnd);
1119 STATUSBAR_Refresh (hwnd, hdc);
1120 ReleaseDC (hwnd, hdc);
1121 }
1122
1123 return 0;
1124}
1125
1126
1127static LRESULT
1128STATUSBAR_WMSetText (HWND hwnd, WPARAM wParam, LPARAM lParam)
1129{
1130 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
1131 STATUSWINDOWPART *part;
1132 int len;
1133 HDC hdc;
1134
1135 if (!infoPtr) return DefWindowProcA(hwnd,WM_SETTEXT,wParam,lParam);
1136
1137 if (infoPtr->numParts == 0)
1138 return FALSE;
1139
1140 part = &infoPtr->parts[0];
1141 /* duplicate string */
1142 if (part->text)
1143 COMCTL32_Free (part->text);
1144 part->text = 0;
1145 if (infoPtr->bUnicode) {
1146 if (lParam && (len = lstrlenW((LPCWSTR)lParam))) {
1147 part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
1148 lstrcpyW (part->text, (LPCWSTR)lParam);
1149 }
1150 }
1151 else {
1152 if (lParam && (len = lstrlenA((LPCSTR)lParam))) {
1153 part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
1154 lstrcpyAtoW (part->text, (char*)lParam);
1155 }
1156 }
1157
1158 hdc = GetDC (hwnd);
1159 STATUSBAR_RefreshPart (hwnd, part, hdc);
1160 ReleaseDC (hwnd, hdc);
1161
1162 return TRUE;
1163}
1164
1165
1166static LRESULT
1167STATUSBAR_WMSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
1168{
1169 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
1170 INT width, x, y, flags;
1171 RECT parent_rect;
1172 HWND parent;
1173
1174 /* Need to resize width to match parent */
1175 flags = (INT) wParam;
1176
1177 /* FIXME for flags =
1178 * SIZE_MAXIMIZED, SIZE_MAXSHOW, SIZE_MINIMIZED, SIZE_RESTORED
1179 */
1180
1181 if (flags == SIZE_RESTORED) {
1182 /* width and height don't apply */
1183 parent = GetParent (hwnd);
1184 GetClientRect (parent, &parent_rect);
1185 width = parent_rect.right - parent_rect.left;
1186 x = parent_rect.left;
1187 y = parent_rect.bottom - infoPtr->height;
1188 MoveWindow (hwnd, parent_rect.left,
1189 parent_rect.bottom - infoPtr->height,
1190 width, infoPtr->height, TRUE);
1191 STATUSBAR_SetPartBounds (hwnd);
1192 }
1193 return 0;
1194}
1195
1196
1197static LRESULT
1198STATUSBAR_SendNotify (HWND hwnd, UINT code)
1199{
1200 NMHDR nmhdr;
1201
1202 nmhdr.hwndFrom = hwnd;
1203 nmhdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
1204 nmhdr.code = code;
1205 SendMessageA (GetParent (hwnd), WM_NOTIFY, 0, (LPARAM)&nmhdr);
1206 return 0;
1207}
1208
1209
1210
1211static LRESULT WINAPI
1212StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
1213{
1214 switch (msg) {
1215 case SB_GETBORDERS:
1216 return STATUSBAR_GetBorders (lParam);
1217
1218 case SB_GETICON:
1219 return STATUSBAR_GetIcon (hwnd, wParam);
1220
1221 case SB_GETPARTS:
1222 return STATUSBAR_GetParts (hwnd, wParam, lParam);
1223
1224 case SB_GETRECT:
1225 return STATUSBAR_GetRect (hwnd, wParam, lParam);
1226
1227 case SB_GETTEXTA:
1228 return STATUSBAR_GetTextA (hwnd, wParam, lParam);
1229
1230 case SB_GETTEXTW:
1231 return STATUSBAR_GetTextW (hwnd, wParam, lParam);
1232
1233 case SB_GETTEXTLENGTHA:
1234 case SB_GETTEXTLENGTHW:
1235 return STATUSBAR_GetTextLength (hwnd, wParam);
1236
1237 case SB_GETTIPTEXTA:
1238 return STATUSBAR_GetTipTextA (hwnd, wParam, lParam);
1239
1240 case SB_GETTIPTEXTW:
1241 return STATUSBAR_GetTipTextW (hwnd, wParam, lParam);
1242
1243 case SB_GETUNICODEFORMAT:
1244 return STATUSBAR_GetUnicodeFormat (hwnd);
1245
1246 case SB_ISSIMPLE:
1247 return STATUSBAR_IsSimple (hwnd);
1248
1249 case SB_SETBKCOLOR:
1250 return STATUSBAR_SetBkColor (hwnd, wParam, lParam);
1251
1252 case SB_SETICON:
1253 return STATUSBAR_SetIcon (hwnd, wParam, lParam);
1254
1255 case SB_SETMINHEIGHT:
1256 return STATUSBAR_SetMinHeight (hwnd, wParam, lParam);
1257
1258 case SB_SETPARTS:
1259 return STATUSBAR_SetParts (hwnd, wParam, lParam);
1260
1261 case SB_SETTEXTA:
1262 return STATUSBAR_SetTextA (hwnd, wParam, lParam);
1263
1264 case SB_SETTEXTW:
1265 return STATUSBAR_SetTextW (hwnd, wParam, lParam);
1266
1267 case SB_SETTIPTEXTA:
1268 return STATUSBAR_SetTipTextA (hwnd, wParam, lParam);
1269
1270 case SB_SETTIPTEXTW:
1271 return STATUSBAR_SetTipTextW (hwnd, wParam, lParam);
1272
1273 case SB_SETUNICODEFORMAT:
1274 return STATUSBAR_SetUnicodeFormat (hwnd, wParam);
1275
1276 case SB_SIMPLE:
1277 return STATUSBAR_Simple (hwnd, wParam, lParam);
1278
1279
1280 case WM_CREATE:
1281 return STATUSBAR_WMCreate (hwnd, wParam, lParam);
1282
1283 case WM_DESTROY:
1284 return STATUSBAR_WMDestroy (hwnd);
1285
1286 case WM_GETFONT:
1287 return STATUSBAR_WMGetFont (hwnd);
1288
1289 case WM_GETTEXT:
1290 return STATUSBAR_WMGetText (hwnd, wParam, lParam);
1291
1292 case WM_GETTEXTLENGTH:
1293 return STATUSBAR_GetTextLength (hwnd, 0);
1294
1295 case WM_LBUTTONDBLCLK:
1296 return STATUSBAR_SendNotify (hwnd, NM_DBLCLK);
1297
1298 case WM_LBUTTONDOWN:
1299 return STATUSBAR_WMLButtonDown(hwnd,wParam,lParam);
1300
1301 case WM_LBUTTONUP:
1302 return STATUSBAR_SendNotify (hwnd, NM_CLICK);
1303
1304 case WM_MOUSEMOVE:
1305 return STATUSBAR_WMMouseMove (hwnd, wParam, lParam);
1306
1307 case WM_NCHITTEST:
1308 return STATUSBAR_WMNCHitTest (hwnd, wParam, lParam);
1309
1310 case WM_NCLBUTTONDOWN:
1311 return STATUSBAR_WMNCLButtonDown (hwnd, wParam, lParam);
1312
1313 case WM_NCLBUTTONUP:
1314 return STATUSBAR_WMNCLButtonUp (hwnd, wParam, lParam);
1315
1316 case WM_PAINT:
1317 return STATUSBAR_WMPaint (hwnd, wParam);
1318
1319 case WM_RBUTTONDBLCLK:
1320 return STATUSBAR_SendNotify (hwnd, NM_RDBLCLK);
1321
1322 case WM_RBUTTONUP:
1323 return STATUSBAR_SendNotify (hwnd, NM_RCLICK);
1324
1325 case WM_SETCURSOR:
1326 return STATUSBAR_WMSetCursor(hwnd,wParam,lParam);
1327
1328 case WM_SETFONT:
1329 return STATUSBAR_WMSetFont (hwnd, wParam, lParam);
1330
1331 case WM_SETTEXT:
1332 return STATUSBAR_WMSetText (hwnd, wParam, lParam);
1333
1334 case WM_SIZE:
1335 return STATUSBAR_WMSize (hwnd, wParam, lParam);
1336
1337 default:
1338// if (msg >= WM_USER)
1339// ERR (statusbar, "unknown msg %04x wp=%04x lp=%08lx\n",
1340// msg, wParam, lParam);
1341 return DefWindowProcA (hwnd, msg, wParam, lParam);
1342 }
1343 return 0;
1344}
1345
1346
1347/***********************************************************************
1348 * STATUS_Register [Internal]
1349 *
1350 * Registers the status window class.
1351 */
1352
1353VOID
1354STATUS_Register (VOID)
1355{
1356 WNDCLASSA wndClass;
1357
1358//SvL: Don't check this now
1359// if (GlobalFindAtomA (STATUSCLASSNAMEA)) return;
1360
1361 ZeroMemory (&wndClass, sizeof(WNDCLASSA));
1362 wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW;
1363 wndClass.lpfnWndProc = (WNDPROC)StatusWindowProc;
1364 wndClass.cbClsExtra = 0;
1365 wndClass.cbWndExtra = sizeof(STATUSWINDOWINFO *);
1366 wndClass.hCursor = LoadCursorA (0, IDC_ARROWA);
1367 wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
1368 wndClass.lpszClassName = STATUSCLASSNAMEA;
1369
1370 RegisterClassA (&wndClass);
1371}
1372
1373
1374/***********************************************************************
1375 * STATUS_Unregister [Internal]
1376 *
1377 * Unregisters the status window class.
1378 */
1379
1380VOID
1381STATUS_Unregister (VOID)
1382{
1383 if (GlobalFindAtomA (STATUSCLASSNAMEA))
1384 UnregisterClassA (STATUSCLASSNAMEA, (HINSTANCE)NULL);
1385}
1386
Note: See TracBrowser for help on using the repository browser.