Large-scale renaming of all Win32 functions and types to use the
[wine.git] / dlls / comctl32 / rebar.c
blob9ce1941af742d4899753e6ad983aa9e91b8a5dfa
1 /*
2 * Rebar control
4 * Copyright 1998 Eric Kohl
6 * NOTES
7 * An author is needed! Any volunteers?
8 * I will only improve this control once in a while.
9 * Eric <ekohl@abo.rhein-zeitung.de>
11 * TODO:
12 * - vertical placement
13 * - ComboBox and ComboBoxEx placement
14 * - center image
15 * - Layout code.
16 * - Display code.
17 * - Some messages.
18 * - All notifications.
21 #include <string.h>
23 #include "commctrl.h"
24 #include "rebar.h"
25 #include "win.h"
26 #include "sysmetrics.h"
27 #include "debug.h"
30 /* fDraw flags */
31 #define DRAW_GRIPPER 1
32 #define DRAW_IMAGE 2
33 #define DRAW_TEXT 4
34 #define DRAW_CHILD 8
36 #define GRIPPER_WIDTH 13
39 #define REBAR_GetInfoPtr(wndPtr) ((REBAR_INFO *)wndPtr->wExtra[0])
42 static VOID
43 REBAR_DrawBand (HDC hdc, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
46 DrawEdge (hdc, &lpBand->rcBand, BDR_RAISEDINNER, BF_MIDDLE);
48 /* draw background */
50 /* draw gripper */
51 if (lpBand->fDraw & DRAW_GRIPPER)
52 DrawEdge (hdc, &lpBand->rcGripper, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE);
54 /* draw caption image */
55 if (lpBand->fDraw & DRAW_IMAGE) {
56 /* FIXME: center image */
57 POINT pt;
59 pt.y = (lpBand->rcCapImage.bottom + lpBand->rcCapImage.top - infoPtr->imageSize.cy)/2;
60 pt.x = (lpBand->rcCapImage.right + lpBand->rcCapImage.left - infoPtr->imageSize.cx)/2;
62 ImageList_Draw (infoPtr->himl, lpBand->iImage, hdc,
63 /* lpBand->rcCapImage.left, lpBand->rcCapImage.top, */
64 pt.x, pt.y,
65 ILD_TRANSPARENT);
68 /* draw caption text */
69 if (lpBand->fDraw & DRAW_TEXT) {
70 HFONT hOldFont = SelectObject (hdc, infoPtr->hFont);
71 INT oldBkMode = SetBkMode (hdc, TRANSPARENT);
72 DrawTextW (hdc, lpBand->lpText, -1, &lpBand->rcCapText,
73 DT_CENTER | DT_VCENTER | DT_SINGLELINE);
74 if (oldBkMode != TRANSPARENT)
75 SetBkMode (hdc, oldBkMode);
76 SelectObject (hdc, hOldFont);
81 static VOID
82 REBAR_Refresh (WND *wndPtr, HDC hdc)
84 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
85 REBAR_BAND *lpBand;
86 UINT i;
88 for (i = 0; i < infoPtr->uNumBands; i++) {
89 lpBand = &infoPtr->bands[i];
91 if ((lpBand->fStyle & RBBS_HIDDEN) ||
92 ((wndPtr->dwStyle & CCS_VERT) && (lpBand->fStyle & RBBS_NOVERT)))
93 continue;
95 REBAR_DrawBand (hdc, infoPtr, lpBand);
101 static VOID
102 REBAR_CalcHorzBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
104 lpBand->fDraw = 0;
106 /* set initial caption image rectangle */
107 SetRect (&lpBand->rcCapImage, 0, 0, 0, 0);
109 /* image is visible */
110 if ((lpBand->iImage > -1) && (infoPtr->himl)) {
111 lpBand->fDraw |= DRAW_IMAGE;
113 lpBand->rcCapImage.right = lpBand->rcCapImage.left + infoPtr->imageSize.cx;
114 lpBand->rcCapImage.bottom = lpBand->rcCapImage.top + infoPtr->imageSize.cy;
116 /* update band height */
117 if (lpBand->uMinHeight < infoPtr->imageSize.cy + 2) {
118 lpBand->uMinHeight = infoPtr->imageSize.cy + 2;
119 lpBand->rcBand.bottom = lpBand->rcBand.top + lpBand->uMinHeight;
123 /* set initial caption text rectangle */
124 lpBand->rcCapText.left = lpBand->rcCapImage.right;
125 lpBand->rcCapText.top = lpBand->rcBand.top + 1;
126 lpBand->rcCapText.right = lpBand->rcCapText.left;
127 lpBand->rcCapText.bottom = lpBand->rcBand.bottom - 1;
129 /* text is visible */
130 if (lpBand->lpText) {
131 HDC hdc = GetDC (0);
132 HFONT hOldFont = SelectObject (hdc, infoPtr->hFont);
133 SIZE size;
135 lpBand->fDraw |= DRAW_TEXT;
136 GetTextExtentPoint32W (hdc, lpBand->lpText,
137 lstrlenW (lpBand->lpText), &size);
138 lpBand->rcCapText.right += size.cx;
140 SelectObject (hdc, hOldFont);
141 ReleaseDC (0, hdc);
144 /* set initial child window rectangle */
145 if (lpBand->fStyle & RBBS_FIXEDSIZE) {
146 lpBand->rcChild.left = lpBand->rcCapText.right;
147 lpBand->rcChild.top = lpBand->rcBand.top;
148 lpBand->rcChild.right = lpBand->rcBand.right;
149 lpBand->rcChild.bottom = lpBand->rcBand.bottom;
151 else {
152 lpBand->rcChild.left = lpBand->rcCapText.right + 4;
153 lpBand->rcChild.top = lpBand->rcBand.top + 2;
154 lpBand->rcChild.right = lpBand->rcBand.right - 4;
155 lpBand->rcChild.bottom = lpBand->rcBand.bottom - 2;
158 /* calculate gripper rectangle */
159 if ((!(lpBand->fStyle & RBBS_NOGRIPPER)) &&
160 (!(lpBand->fStyle & RBBS_FIXEDSIZE)) &&
161 ((lpBand->fStyle & RBBS_GRIPPERALWAYS) ||
162 (infoPtr->uNumBands > 1))) {
163 lpBand->fDraw |= DRAW_GRIPPER;
164 lpBand->rcGripper.left = lpBand->rcBand.left + 3;
165 lpBand->rcGripper.right = lpBand->rcGripper.left + 3;
166 lpBand->rcGripper.top = lpBand->rcBand.top + 3;
167 lpBand->rcGripper.bottom = lpBand->rcBand.bottom - 3;
169 /* move caption rectangles */
170 OffsetRect (&lpBand->rcCapImage, GRIPPER_WIDTH, 0);
171 OffsetRect (&lpBand->rcCapText, GRIPPER_WIDTH, 0);
173 /* adjust child rectangle */
174 lpBand->rcChild.left += GRIPPER_WIDTH;
181 static VOID
182 REBAR_CalcVertBand (WND *wndPtr, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
184 lpBand->fDraw = 0;
186 /* set initial caption image rectangle */
187 SetRect (&lpBand->rcCapImage, 0, 0, 0, 0);
189 /* image is visible */
190 if ((lpBand->iImage > -1) && (infoPtr->himl)) {
191 lpBand->fDraw |= DRAW_IMAGE;
193 lpBand->rcCapImage.right = lpBand->rcCapImage.left + infoPtr->imageSize.cx;
194 lpBand->rcCapImage.bottom = lpBand->rcCapImage.top + infoPtr->imageSize.cy;
196 /* update band width */
197 if (lpBand->uMinHeight < infoPtr->imageSize.cx + 2) {
198 lpBand->uMinHeight = infoPtr->imageSize.cx + 2;
199 lpBand->rcBand.right = lpBand->rcBand.left + lpBand->uMinHeight;
203 /* set initial caption text rectangle */
204 lpBand->rcCapText.left = lpBand->rcBand.left + 1;
205 lpBand->rcCapText.top = lpBand->rcCapImage.bottom;
206 lpBand->rcCapText.right = lpBand->rcBand.right - 1;
207 lpBand->rcCapText.bottom = lpBand->rcCapText.top;
209 /* text is visible */
210 if (lpBand->lpText) {
211 HDC hdc = GetDC (0);
212 HFONT hOldFont = SelectObject (hdc, infoPtr->hFont);
213 SIZE size;
215 lpBand->fDraw |= DRAW_TEXT;
216 GetTextExtentPoint32W (hdc, lpBand->lpText,
217 lstrlenW (lpBand->lpText), &size);
218 /* lpBand->rcCapText.right += size.cx; */
219 lpBand->rcCapText.bottom += size.cy;
221 SelectObject (hdc, hOldFont);
222 ReleaseDC (0, hdc);
225 /* set initial child window rectangle */
226 if (lpBand->fStyle & RBBS_FIXEDSIZE) {
227 lpBand->rcChild.left = lpBand->rcBand.left;
228 lpBand->rcChild.top = lpBand->rcCapText.bottom;
229 lpBand->rcChild.right = lpBand->rcBand.right;
230 lpBand->rcChild.bottom = lpBand->rcBand.bottom;
232 else {
233 lpBand->rcChild.left = lpBand->rcBand.left + 2;
234 lpBand->rcChild.top = lpBand->rcCapText.bottom + 4;
235 lpBand->rcChild.right = lpBand->rcBand.right - 2;
236 lpBand->rcChild.bottom = lpBand->rcBand.bottom - 4;
239 /* calculate gripper rectangle */
240 if ((!(lpBand->fStyle & RBBS_NOGRIPPER)) &&
241 (!(lpBand->fStyle & RBBS_FIXEDSIZE)) &&
242 ((lpBand->fStyle & RBBS_GRIPPERALWAYS) ||
243 (infoPtr->uNumBands > 1))) {
244 lpBand->fDraw |= DRAW_GRIPPER;
246 if (wndPtr->dwStyle & RBS_VERTICALGRIPPER) {
247 /* adjust band width */
248 lpBand->rcBand.right += GRIPPER_WIDTH;
249 lpBand->uMinHeight += GRIPPER_WIDTH;
251 lpBand->rcGripper.left = lpBand->rcBand.left + 3;
252 lpBand->rcGripper.right = lpBand->rcGripper.left + 3;
253 lpBand->rcGripper.top = lpBand->rcBand.top + 3;
254 lpBand->rcGripper.bottom = lpBand->rcBand.bottom - 3;
256 /* move caption rectangles */
257 OffsetRect (&lpBand->rcCapImage, GRIPPER_WIDTH, 0);
258 OffsetRect (&lpBand->rcCapText, GRIPPER_WIDTH, 0);
260 /* adjust child rectangle */
261 lpBand->rcChild.left += GRIPPER_WIDTH;
263 else {
264 lpBand->rcGripper.left = lpBand->rcBand.left + 3;
265 lpBand->rcGripper.right = lpBand->rcBand.right - 3;
266 lpBand->rcGripper.top = lpBand->rcBand.top + 3;
267 lpBand->rcGripper.bottom = lpBand->rcGripper.top + 3;
269 /* move caption rectangles */
270 OffsetRect (&lpBand->rcCapImage, 0, GRIPPER_WIDTH);
271 OffsetRect (&lpBand->rcCapText, 0, GRIPPER_WIDTH);
273 /* adjust child rectangle */
274 lpBand->rcChild.top += GRIPPER_WIDTH;
280 static VOID
281 REBAR_Layout (WND *wndPtr, LPRECT lpRect)
283 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
284 REBAR_BAND *lpBand;
285 RECT rcClient;
286 INT x, y, cx, cy;
287 UINT i;
289 if (lpRect)
290 rcClient = *lpRect;
291 else
292 GetClientRect (wndPtr->hwndSelf, &rcClient);
294 x = 0;
295 y = 0;
297 if (wndPtr->dwStyle & CCS_VERT) {
298 cx = 20; /* FIXME: fixed height */
299 cy = rcClient.bottom - rcClient.top;
301 else {
302 cx = rcClient.right - rcClient.left;
303 cy = 20; /* FIXME: fixed height */
306 for (i = 0; i < infoPtr->uNumBands; i++) {
307 lpBand = &infoPtr->bands[i];
309 if ((lpBand->fStyle & RBBS_HIDDEN) ||
310 ((wndPtr->dwStyle & CCS_VERT) && (lpBand->fStyle & RBBS_NOVERT)))
311 continue;
314 if (wndPtr->dwStyle & CCS_VERT) {
315 if (lpBand->fStyle & RBBS_VARIABLEHEIGHT)
316 cx = lpBand->cyMaxChild;
317 else if (lpBand->fStyle & RBBIM_CHILDSIZE)
318 cx = lpBand->cyMinChild;
319 else
320 cx = 20; /* FIXME */
322 lpBand->rcBand.left = x;
323 lpBand->rcBand.right = x + cx;
324 lpBand->rcBand.top = y;
325 lpBand->rcBand.bottom = y + cy;
326 lpBand->uMinHeight = cx;
328 else {
329 if (lpBand->fStyle & RBBS_VARIABLEHEIGHT)
330 cy = lpBand->cyMaxChild;
331 else if (lpBand->fStyle & RBBIM_CHILDSIZE)
332 cy = lpBand->cyMinChild;
333 else
334 cy = 20; /* FIXME */
336 lpBand->rcBand.left = x;
337 lpBand->rcBand.right = x + cx;
338 lpBand->rcBand.top = y;
339 lpBand->rcBand.bottom = y + cy;
340 lpBand->uMinHeight = cy;
343 if (wndPtr->dwStyle & CCS_VERT) {
344 REBAR_CalcVertBand (wndPtr, infoPtr, lpBand);
345 x += lpBand->uMinHeight;
347 else {
348 REBAR_CalcHorzBand (infoPtr, lpBand);
349 y += lpBand->uMinHeight;
353 if (wndPtr->dwStyle & CCS_VERT) {
354 infoPtr->calcSize.cx = x;
355 infoPtr->calcSize.cy = rcClient.bottom - rcClient.top;
357 else {
358 infoPtr->calcSize.cx = rcClient.right - rcClient.left;
359 infoPtr->calcSize.cy = y;
364 static VOID
365 REBAR_ForceResize (WND *wndPtr)
367 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
368 RECT rc;
370 TRACE (rebar, " to [%d x %d]!\n",
371 infoPtr->calcSize.cx, infoPtr->calcSize.cy);
373 infoPtr->bAutoResize = TRUE;
375 rc.left = 0;
376 rc.top = 0;
377 rc.right = infoPtr->calcSize.cx;
378 rc.bottom = infoPtr->calcSize.cy;
380 if (wndPtr->dwStyle & WS_BORDER) {
381 InflateRect (&rc, sysMetrics[SM_CXEDGE], sysMetrics[SM_CYEDGE]);
384 SetWindowPos (wndPtr->hwndSelf, 0, 0, 0,
385 rc.right - rc.left, rc.bottom - rc.top,
386 SWP_NOMOVE | SWP_NOZORDER | SWP_SHOWWINDOW);
390 static VOID
391 REBAR_MoveChildWindows (WND *wndPtr)
393 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
394 REBAR_BAND *lpBand;
395 UINT i;
397 for (i = 0; i < infoPtr->uNumBands; i++) {
398 lpBand = &infoPtr->bands[i];
400 if (lpBand->fStyle & RBBS_HIDDEN)
401 continue;
402 if (lpBand->hwndChild) {
403 TRACE (rebar, "hwndChild = %x\n", lpBand->hwndChild);
405 if (WIDGETS_IsControl (WIN_FindWndPtr(lpBand->hwndChild), BIC32_COMBO)) {
406 INT nEditHeight, yPos;
407 RECT rc;
409 /* special placement code for combo box */
412 /* get size of edit line */
413 GetWindowRect (lpBand->hwndChild, &rc);
414 nEditHeight = rc.bottom - rc.top;
415 yPos = (lpBand->rcChild.bottom + lpBand->rcChild.top - nEditHeight)/2;
417 /* center combo box inside child area */
418 SetWindowPos (lpBand->hwndChild, HWND_TOP,
419 lpBand->rcChild.left, /*lpBand->rcChild.top*/ yPos,
420 lpBand->rcChild.right - lpBand->rcChild.left,
421 nEditHeight,
422 SWP_SHOWWINDOW);
424 #if 0
425 else if () {
426 /* special placement code for extended combo box */
430 #endif
431 else {
432 SetWindowPos (lpBand->hwndChild, HWND_TOP,
433 lpBand->rcChild.left, lpBand->rcChild.top,
434 lpBand->rcChild.right - lpBand->rcChild.left,
435 lpBand->rcChild.bottom - lpBand->rcChild.top,
436 SWP_SHOWWINDOW);
443 static void
444 REBAR_InternalHitTest (WND *wndPtr, LPPOINT lpPt, UINT *pFlags, INT *pBand)
446 REBAR_INFO *infoPtr = REBAR_GetInfoPtr(wndPtr);
447 REBAR_BAND *lpBand;
448 RECT rect;
449 INT iCount;
451 GetClientRect (wndPtr->hwndSelf, &rect);
453 *pFlags = RBHT_NOWHERE;
454 if (PtInRect (&rect, *lpPt))
456 if (infoPtr->uNumBands == 0) {
457 *pFlags = RBHT_NOWHERE;
458 if (pBand)
459 *pBand = -1;
460 TRACE (rebar, "NOWHERE\n");
461 return;
463 else {
464 /* somewhere inside */
465 for (iCount = 0; iCount < infoPtr->uNumBands; iCount++) {
466 lpBand = &infoPtr->bands[iCount];
467 if (PtInRect (&lpBand->rcBand, *lpPt)) {
468 if (pBand)
469 *pBand = iCount;
470 if (PtInRect (&lpBand->rcGripper, *lpPt)) {
471 *pFlags = RBHT_GRABBER;
472 TRACE (rebar, "ON GRABBER %d\n", iCount);
473 return;
475 else if (PtInRect (&lpBand->rcCapImage, *lpPt)) {
476 *pFlags = RBHT_CAPTION;
477 TRACE (rebar, "ON CAPTION %d\n", iCount);
478 return;
480 else if (PtInRect (&lpBand->rcCapText, *lpPt)) {
481 *pFlags = RBHT_CAPTION;
482 TRACE (rebar, "ON CAPTION %d\n", iCount);
483 return;
485 else if (PtInRect (&lpBand->rcChild, *lpPt)) {
486 *pFlags = RBHT_CLIENT;
487 TRACE (rebar, "ON CLIENT %d\n", iCount);
488 return;
490 else {
491 *pFlags = RBHT_NOWHERE;
492 TRACE (rebar, "NOWHERE %d\n", iCount);
493 return;
498 *pFlags = RBHT_NOWHERE;
499 if (pBand)
500 *pBand = -1;
502 TRACE (rebar, "NOWHERE\n");
503 return;
506 else {
507 *pFlags = RBHT_NOWHERE;
508 if (pBand)
509 *pBand = -1;
510 TRACE (rebar, "NOWHERE\n");
511 return;
514 TRACE (rebar, "flags=0x%X\n", *pFlags);
515 return;
520 /* << REBAR_BeginDrag >> */
523 static LRESULT
524 REBAR_DeleteBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
526 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
527 UINT uBand = (UINT)wParam;
529 if (uBand >= infoPtr->uNumBands)
530 return FALSE;
532 TRACE (rebar, "deleting band %u!\n", uBand);
534 if (infoPtr->uNumBands == 1) {
535 TRACE (rebar, " simple delete!\n");
536 COMCTL32_Free (infoPtr->bands);
537 infoPtr->bands = NULL;
538 infoPtr->uNumBands = 0;
540 else {
541 REBAR_BAND *oldBands = infoPtr->bands;
542 TRACE(rebar, "complex delete! [uBand=%u]\n", uBand);
544 infoPtr->uNumBands--;
545 infoPtr->bands = COMCTL32_Alloc (sizeof (REBAR_BAND) * infoPtr->uNumBands);
546 if (uBand > 0) {
547 memcpy (&infoPtr->bands[0], &oldBands[0],
548 uBand * sizeof(REBAR_BAND));
551 if (uBand < infoPtr->uNumBands) {
552 memcpy (&infoPtr->bands[uBand], &oldBands[uBand+1],
553 (infoPtr->uNumBands - uBand) * sizeof(REBAR_BAND));
556 COMCTL32_Free (oldBands);
559 REBAR_Layout (wndPtr, NULL);
560 REBAR_ForceResize (wndPtr);
561 REBAR_MoveChildWindows (wndPtr);
563 return TRUE;
567 /* << REBAR_DragMove >> */
568 /* << REBAR_EndDrag >> */
571 static LRESULT
572 REBAR_GetBandBorders (WND *wndPtr, WPARAM wParam, LPARAM lParam)
574 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
575 /* LPRECT32 lpRect = (LPRECT32)lParam; */
576 REBAR_BAND *lpBand;
578 if (!lParam)
579 return 0;
580 if ((UINT)wParam >= infoPtr->uNumBands)
581 return 0;
583 lpBand = &infoPtr->bands[(UINT)wParam];
584 if (wndPtr->dwStyle & RBS_BANDBORDERS) {
587 else {
591 return 0;
595 __inline__ static LRESULT
596 REBAR_GetBandCount (WND *wndPtr)
598 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
600 TRACE (rebar, "band count %u!\n", infoPtr->uNumBands);
602 return infoPtr->uNumBands;
606 static LRESULT
607 REBAR_GetBandInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
609 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
610 LPREBARBANDINFOA lprbbi = (LPREBARBANDINFOA)lParam;
611 REBAR_BAND *lpBand;
613 if (lprbbi == NULL)
614 return FALSE;
615 if (lprbbi->cbSize < REBARBANDINFO_V3_SIZEA)
616 return FALSE;
617 if ((UINT)wParam >= infoPtr->uNumBands)
618 return FALSE;
620 TRACE (rebar, "index %u\n", (UINT)wParam);
622 /* copy band information */
623 lpBand = &infoPtr->bands[(UINT)wParam];
625 if (lprbbi->fMask & RBBIM_STYLE)
626 lprbbi->fStyle = lpBand->fStyle;
628 if (lprbbi->fMask & RBBIM_COLORS) {
629 lprbbi->clrFore = lpBand->clrFore;
630 lprbbi->clrBack = lpBand->clrBack;
633 if ((lprbbi->fMask & RBBIM_TEXT) &&
634 (lprbbi->lpText) && (lpBand->lpText)) {
635 lstrcpynWtoA (lprbbi->lpText, lpBand->lpText, lprbbi->cch);
638 if (lprbbi->fMask & RBBIM_IMAGE)
639 lprbbi->iImage = lpBand->iImage;
641 if (lprbbi->fMask & RBBIM_CHILD)
642 lprbbi->hwndChild = lpBand->hwndChild;
644 if (lprbbi->fMask & RBBIM_CHILDSIZE) {
645 lprbbi->cxMinChild = lpBand->cxMinChild;
646 lprbbi->cyMinChild = lpBand->cyMinChild;
647 lprbbi->cyMaxChild = lpBand->cyMaxChild;
648 lprbbi->cyChild = lpBand->cyChild;
649 lprbbi->cyIntegral = lpBand->cyIntegral;
652 if (lprbbi->fMask & RBBIM_SIZE)
653 lprbbi->cx = lpBand->cx;
655 if (lprbbi->fMask & RBBIM_BACKGROUND)
656 lprbbi->hbmBack = lpBand->hbmBack;
658 if (lprbbi->fMask & RBBIM_ID)
659 lprbbi->wID = lpBand->wID;
661 /* check for additional data */
662 if (lprbbi->cbSize >= sizeof (REBARBANDINFOA)) {
663 if (lprbbi->fMask & RBBIM_IDEALSIZE)
664 lprbbi->cxIdeal = lpBand->cxIdeal;
666 if (lprbbi->fMask & RBBIM_LPARAM)
667 lprbbi->lParam = lpBand->lParam;
669 if (lprbbi->fMask & RBBIM_HEADERSIZE)
670 lprbbi->cxHeader = lpBand->cxHeader;
673 return TRUE;
677 static LRESULT
678 REBAR_GetBandInfoW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
680 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
681 LPREBARBANDINFOW lprbbi = (LPREBARBANDINFOW)lParam;
682 REBAR_BAND *lpBand;
684 if (lprbbi == NULL)
685 return FALSE;
686 if (lprbbi->cbSize < REBARBANDINFO_V3_SIZEW)
687 return FALSE;
688 if ((UINT)wParam >= infoPtr->uNumBands)
689 return FALSE;
691 TRACE (rebar, "index %u\n", (UINT)wParam);
693 /* copy band information */
694 lpBand = &infoPtr->bands[(UINT)wParam];
696 if (lprbbi->fMask & RBBIM_STYLE)
697 lprbbi->fStyle = lpBand->fStyle;
699 if (lprbbi->fMask & RBBIM_COLORS) {
700 lprbbi->clrFore = lpBand->clrFore;
701 lprbbi->clrBack = lpBand->clrBack;
704 if ((lprbbi->fMask & RBBIM_TEXT) &&
705 (lprbbi->lpText) && (lpBand->lpText)) {
706 lstrcpynW (lprbbi->lpText, lpBand->lpText, lprbbi->cch);
709 if (lprbbi->fMask & RBBIM_IMAGE)
710 lprbbi->iImage = lpBand->iImage;
712 if (lprbbi->fMask & RBBIM_CHILD)
713 lprbbi->hwndChild = lpBand->hwndChild;
715 if (lprbbi->fMask & RBBIM_CHILDSIZE) {
716 lprbbi->cxMinChild = lpBand->cxMinChild;
717 lprbbi->cyMinChild = lpBand->cyMinChild;
718 lprbbi->cyMaxChild = lpBand->cyMaxChild;
719 lprbbi->cyChild = lpBand->cyChild;
720 lprbbi->cyIntegral = lpBand->cyIntegral;
723 if (lprbbi->fMask & RBBIM_SIZE)
724 lprbbi->cx = lpBand->cx;
726 if (lprbbi->fMask & RBBIM_BACKGROUND)
727 lprbbi->hbmBack = lpBand->hbmBack;
729 if (lprbbi->fMask & RBBIM_ID)
730 lprbbi->wID = lpBand->wID;
732 /* check for additional data */
733 if (lprbbi->cbSize >= sizeof (REBARBANDINFOA)) {
734 if (lprbbi->fMask & RBBIM_IDEALSIZE)
735 lprbbi->cxIdeal = lpBand->cxIdeal;
737 if (lprbbi->fMask & RBBIM_LPARAM)
738 lprbbi->lParam = lpBand->lParam;
740 if (lprbbi->fMask & RBBIM_HEADERSIZE)
741 lprbbi->cxHeader = lpBand->cxHeader;
744 return TRUE;
748 static LRESULT
749 REBAR_GetBarHeight (WND *wndPtr, WPARAM wParam, LPARAM lParam)
751 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
752 INT nHeight;
754 REBAR_Layout (wndPtr, NULL);
755 nHeight = infoPtr->calcSize.cy;
757 if (wndPtr->dwStyle & WS_BORDER)
758 nHeight += (2 * sysMetrics[SM_CYEDGE]);
760 FIXME (rebar, "height = %d\n", nHeight);
762 return nHeight;
766 static LRESULT
767 REBAR_GetBarInfo (WND *wndPtr, WPARAM wParam, LPARAM lParam)
769 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
770 LPREBARINFO lpInfo = (LPREBARINFO)lParam;
772 if (lpInfo == NULL)
773 return FALSE;
775 if (lpInfo->cbSize < sizeof (REBARINFO))
776 return FALSE;
778 TRACE (rebar, "getting bar info!\n");
780 if (infoPtr->himl) {
781 lpInfo->himl = infoPtr->himl;
782 lpInfo->fMask |= RBIM_IMAGELIST;
785 return TRUE;
789 __inline__ static LRESULT
790 REBAR_GetBkColor (WND *wndPtr)
792 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
794 TRACE (rebar, "background color 0x%06lx!\n", infoPtr->clrBk);
796 return infoPtr->clrBk;
800 /* << REBAR_GetColorScheme >> */
801 /* << REBAR_GetDropTarget >> */
804 static LRESULT
805 REBAR_GetPalette (WND *wndPtr, WPARAM wParam, LPARAM lParam)
807 FIXME (rebar, "empty stub!\n");
809 return 0;
813 static LRESULT
814 REBAR_GetRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
816 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
817 INT iBand = (INT)wParam;
818 LPRECT lprc = (LPRECT)lParam;
819 REBAR_BAND *lpBand;
821 if ((iBand < 0) && ((UINT)iBand >= infoPtr->uNumBands))
822 return FALSE;
823 if (!lprc)
824 return FALSE;
826 TRACE (rebar, "band %d\n", iBand);
828 lpBand = &infoPtr->bands[iBand];
829 CopyRect (lprc, &lpBand->rcBand);
831 lprc->left = lpBand->rcBand.left;
832 lprc->top = lpBand->rcBand.top;
833 lprc->right = lpBand->rcBand.right;
834 lprc->bottom = lpBand->rcBand.bottom;
837 return TRUE;
841 __inline__ static LRESULT
842 REBAR_GetRowCount (WND *wndPtr)
844 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
846 FIXME (rebar, "%u : semi stub!\n", infoPtr->uNumBands);
848 return infoPtr->uNumBands;
852 static LRESULT
853 REBAR_GetRowHeight (WND *wndPtr, WPARAM wParam, LPARAM lParam)
855 /* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr); */
857 FIXME (rebar, "-- height = 20: semi stub!\n");
859 return 20;
863 __inline__ static LRESULT
864 REBAR_GetTextColor (WND *wndPtr)
866 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
868 TRACE (rebar, "text color 0x%06lx!\n", infoPtr->clrText);
870 return infoPtr->clrText;
874 __inline__ static LRESULT
875 REBAR_GetToolTips (WND *wndPtr)
877 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
878 return infoPtr->hwndToolTip;
882 __inline__ static LRESULT
883 REBAR_GetUnicodeFormat (WND *wndPtr)
885 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
886 return infoPtr->bUnicode;
890 static LRESULT
891 REBAR_HitTest (WND *wndPtr, WPARAM wParam, LPARAM lParam)
893 /* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr); */
894 LPRBHITTESTINFO lprbht = (LPRBHITTESTINFO)lParam;
896 if (!lprbht)
897 return -1;
899 REBAR_InternalHitTest (wndPtr, &lprbht->pt,
900 &lprbht->flags, &lprbht->iBand);
902 return lprbht->iBand;
906 static LRESULT
907 REBAR_IdToIndex (WND *wndPtr, WPARAM wParam, LPARAM lParam)
909 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
910 UINT i;
912 if (infoPtr == NULL)
913 return -1;
915 if (infoPtr->uNumBands < 1)
916 return -1;
918 TRACE (rebar, "id %u\n", (UINT)wParam);
920 for (i = 0; i < infoPtr->uNumBands; i++) {
921 if (infoPtr->bands[i].wID == (UINT)wParam) {
922 TRACE (rebar, "band %u found!\n", i);
923 return i;
927 TRACE (rebar, "no band found!\n");
928 return -1;
932 static LRESULT
933 REBAR_InsertBandA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
935 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
936 LPREBARBANDINFOA lprbbi = (LPREBARBANDINFOA)lParam;
937 UINT uIndex = (UINT)wParam;
938 REBAR_BAND *lpBand;
940 if (infoPtr == NULL)
941 return FALSE;
942 if (lprbbi == NULL)
943 return FALSE;
944 if (lprbbi->cbSize < REBARBANDINFO_V3_SIZEA)
945 return FALSE;
947 TRACE (rebar, "insert band at %u!\n", uIndex);
949 if (infoPtr->uNumBands == 0) {
950 infoPtr->bands = (REBAR_BAND *)COMCTL32_Alloc (sizeof (REBAR_BAND));
951 uIndex = 0;
953 else {
954 REBAR_BAND *oldBands = infoPtr->bands;
955 infoPtr->bands =
956 (REBAR_BAND *)COMCTL32_Alloc ((infoPtr->uNumBands+1)*sizeof(REBAR_BAND));
957 if (((INT)uIndex == -1) || (uIndex > infoPtr->uNumBands))
958 uIndex = infoPtr->uNumBands;
960 /* pre insert copy */
961 if (uIndex > 0) {
962 memcpy (&infoPtr->bands[0], &oldBands[0],
963 uIndex * sizeof(REBAR_BAND));
966 /* post copy */
967 if (uIndex < infoPtr->uNumBands - 1) {
968 memcpy (&infoPtr->bands[uIndex+1], &oldBands[uIndex],
969 (infoPtr->uNumBands - uIndex - 1) * sizeof(REBAR_BAND));
972 COMCTL32_Free (oldBands);
975 infoPtr->uNumBands++;
977 TRACE (rebar, "index %u!\n", uIndex);
979 /* initialize band (infoPtr->bands[uIndex])*/
980 lpBand = &infoPtr->bands[uIndex];
982 if (lprbbi->fMask & RBBIM_STYLE)
983 lpBand->fStyle = lprbbi->fStyle;
985 if (lprbbi->fMask & RBBIM_COLORS) {
986 lpBand->clrFore = lprbbi->clrFore;
987 lpBand->clrBack = lprbbi->clrBack;
989 else {
990 lpBand->clrFore = CLR_NONE;
991 lpBand->clrBack = CLR_NONE;
994 if ((lprbbi->fMask & RBBIM_TEXT) && (lprbbi->lpText)) {
995 INT len = lstrlenA (lprbbi->lpText);
996 if (len > 0) {
997 lpBand->lpText = (LPWSTR)COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));
998 lstrcpyAtoW (lpBand->lpText, lprbbi->lpText);
1002 if (lprbbi->fMask & RBBIM_IMAGE)
1003 lpBand->iImage = lprbbi->iImage;
1004 else
1005 lpBand->iImage = -1;
1007 if (lprbbi->fMask & RBBIM_CHILD) {
1008 TRACE (rebar, "hwndChild = %x\n", lprbbi->hwndChild);
1009 lpBand->hwndChild = lprbbi->hwndChild;
1010 lpBand->hwndPrevParent =
1011 SetParent (lpBand->hwndChild, wndPtr->hwndSelf);
1014 if (lprbbi->fMask & RBBIM_CHILDSIZE) {
1015 lpBand->cxMinChild = lprbbi->cxMinChild;
1016 lpBand->cyMinChild = lprbbi->cyMinChild;
1017 lpBand->cyMaxChild = lprbbi->cyMaxChild;
1018 lpBand->cyChild = lprbbi->cyChild;
1019 lpBand->cyIntegral = lprbbi->cyIntegral;
1021 else {
1022 lpBand->cxMinChild = -1;
1023 lpBand->cyMinChild = -1;
1024 lpBand->cyMaxChild = -1;
1025 lpBand->cyChild = -1;
1026 lpBand->cyIntegral = -1;
1029 if (lprbbi->fMask & RBBIM_SIZE)
1030 lpBand->cx = lprbbi->cx;
1031 else
1032 lpBand->cx = -1;
1034 if (lprbbi->fMask & RBBIM_BACKGROUND)
1035 lpBand->hbmBack = lprbbi->hbmBack;
1037 if (lprbbi->fMask & RBBIM_ID)
1038 lpBand->wID = lprbbi->wID;
1040 /* check for additional data */
1041 if (lprbbi->cbSize >= sizeof (REBARBANDINFOA)) {
1042 if (lprbbi->fMask & RBBIM_IDEALSIZE)
1043 lpBand->cxIdeal = lprbbi->cxIdeal;
1045 if (lprbbi->fMask & RBBIM_LPARAM)
1046 lpBand->lParam = lprbbi->lParam;
1048 if (lprbbi->fMask & RBBIM_HEADERSIZE)
1049 lpBand->cxHeader = lprbbi->cxHeader;
1053 REBAR_Layout (wndPtr, NULL);
1054 REBAR_ForceResize (wndPtr);
1055 REBAR_MoveChildWindows (wndPtr);
1057 return TRUE;
1061 static LRESULT
1062 REBAR_InsertBandW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1064 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
1065 LPREBARBANDINFOW lprbbi = (LPREBARBANDINFOW)lParam;
1066 UINT uIndex = (UINT)wParam;
1067 REBAR_BAND *lpBand;
1069 if (infoPtr == NULL)
1070 return FALSE;
1071 if (lprbbi == NULL)
1072 return FALSE;
1073 if (lprbbi->cbSize < REBARBANDINFO_V3_SIZEW)
1074 return FALSE;
1076 TRACE (rebar, "insert band at %u!\n", uIndex);
1078 if (infoPtr->uNumBands == 0) {
1079 infoPtr->bands = (REBAR_BAND *)COMCTL32_Alloc (sizeof (REBAR_BAND));
1080 uIndex = 0;
1082 else {
1083 REBAR_BAND *oldBands = infoPtr->bands;
1084 infoPtr->bands =
1085 (REBAR_BAND *)COMCTL32_Alloc ((infoPtr->uNumBands+1)*sizeof(REBAR_BAND));
1086 if (((INT)uIndex == -1) || (uIndex > infoPtr->uNumBands))
1087 uIndex = infoPtr->uNumBands;
1089 /* pre insert copy */
1090 if (uIndex > 0) {
1091 memcpy (&infoPtr->bands[0], &oldBands[0],
1092 uIndex * sizeof(REBAR_BAND));
1095 /* post copy */
1096 if (uIndex < infoPtr->uNumBands - 1) {
1097 memcpy (&infoPtr->bands[uIndex+1], &oldBands[uIndex],
1098 (infoPtr->uNumBands - uIndex - 1) * sizeof(REBAR_BAND));
1101 COMCTL32_Free (oldBands);
1104 infoPtr->uNumBands++;
1106 TRACE (rebar, "index %u!\n", uIndex);
1108 /* initialize band (infoPtr->bands[uIndex])*/
1109 lpBand = &infoPtr->bands[uIndex];
1111 if (lprbbi->fMask & RBBIM_STYLE)
1112 lpBand->fStyle = lprbbi->fStyle;
1114 if (lprbbi->fMask & RBBIM_COLORS) {
1115 lpBand->clrFore = lprbbi->clrFore;
1116 lpBand->clrBack = lprbbi->clrBack;
1118 else {
1119 lpBand->clrFore = CLR_NONE;
1120 lpBand->clrBack = CLR_NONE;
1123 if ((lprbbi->fMask & RBBIM_TEXT) && (lprbbi->lpText)) {
1124 INT len = lstrlenW (lprbbi->lpText);
1125 if (len > 0) {
1126 lpBand->lpText = (LPWSTR)COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));
1127 lstrcpyW (lpBand->lpText, lprbbi->lpText);
1131 if (lprbbi->fMask & RBBIM_IMAGE)
1132 lpBand->iImage = lprbbi->iImage;
1133 else
1134 lpBand->iImage = -1;
1136 if (lprbbi->fMask & RBBIM_CHILD) {
1137 TRACE (rebar, "hwndChild = %x\n", lprbbi->hwndChild);
1138 lpBand->hwndChild = lprbbi->hwndChild;
1139 lpBand->hwndPrevParent =
1140 SetParent (lpBand->hwndChild, wndPtr->hwndSelf);
1143 if (lprbbi->fMask & RBBIM_CHILDSIZE) {
1144 lpBand->cxMinChild = lprbbi->cxMinChild;
1145 lpBand->cyMinChild = lprbbi->cyMinChild;
1146 lpBand->cyMaxChild = lprbbi->cyMaxChild;
1147 lpBand->cyChild = lprbbi->cyChild;
1148 lpBand->cyIntegral = lprbbi->cyIntegral;
1150 else {
1151 lpBand->cxMinChild = -1;
1152 lpBand->cyMinChild = -1;
1153 lpBand->cyMaxChild = -1;
1154 lpBand->cyChild = -1;
1155 lpBand->cyIntegral = -1;
1158 if (lprbbi->fMask & RBBIM_SIZE)
1159 lpBand->cx = lprbbi->cx;
1160 else
1161 lpBand->cx = -1;
1163 if (lprbbi->fMask & RBBIM_BACKGROUND)
1164 lpBand->hbmBack = lprbbi->hbmBack;
1166 if (lprbbi->fMask & RBBIM_ID)
1167 lpBand->wID = lprbbi->wID;
1169 /* check for additional data */
1170 if (lprbbi->cbSize >= sizeof (REBARBANDINFOW)) {
1171 if (lprbbi->fMask & RBBIM_IDEALSIZE)
1172 lpBand->cxIdeal = lprbbi->cxIdeal;
1174 if (lprbbi->fMask & RBBIM_LPARAM)
1175 lpBand->lParam = lprbbi->lParam;
1177 if (lprbbi->fMask & RBBIM_HEADERSIZE)
1178 lpBand->cxHeader = lprbbi->cxHeader;
1182 REBAR_Layout (wndPtr, NULL);
1183 REBAR_ForceResize (wndPtr);
1184 REBAR_MoveChildWindows (wndPtr);
1186 return TRUE;
1190 static LRESULT
1191 REBAR_MaximizeBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1193 /* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr); */
1195 FIXME (rebar, "(uBand = %u fIdeal = %s)\n",
1196 (UINT)wParam, lParam ? "TRUE" : "FALSE");
1199 return 0;
1203 static LRESULT
1204 REBAR_MinimizeBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1206 /* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr); */
1208 FIXME (rebar, "(uBand = %u)\n", (UINT)wParam);
1211 return 0;
1215 static LRESULT
1216 REBAR_MoveBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1218 /* REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr); */
1220 FIXME (rebar, "(iFrom = %u iTof = %u)\n",
1221 (UINT)wParam, (UINT)lParam);
1224 return FALSE;
1228 static LRESULT
1229 REBAR_SetBandInfoA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1231 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
1232 LPREBARBANDINFOA lprbbi = (LPREBARBANDINFOA)lParam;
1233 REBAR_BAND *lpBand;
1235 if (lprbbi == NULL)
1236 return FALSE;
1237 if (lprbbi->cbSize < REBARBANDINFO_V3_SIZEA)
1238 return FALSE;
1239 if ((UINT)wParam >= infoPtr->uNumBands)
1240 return FALSE;
1242 TRACE (rebar, "index %u\n", (UINT)wParam);
1244 /* set band information */
1245 lpBand = &infoPtr->bands[(UINT)wParam];
1247 if (lprbbi->fMask & RBBIM_STYLE)
1248 lpBand->fStyle = lprbbi->fStyle;
1250 if (lprbbi->fMask & RBBIM_COLORS) {
1251 lpBand->clrFore = lprbbi->clrFore;
1252 lpBand->clrBack = lprbbi->clrBack;
1255 if (lprbbi->fMask & RBBIM_TEXT) {
1256 if (lpBand->lpText) {
1257 COMCTL32_Free (lpBand->lpText);
1258 lpBand->lpText = NULL;
1260 if (lprbbi->lpText) {
1261 INT len = lstrlenA (lprbbi->lpText);
1262 lpBand->lpText = (LPWSTR)COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));
1263 lstrcpyAtoW (lpBand->lpText, lprbbi->lpText);
1267 if (lprbbi->fMask & RBBIM_IMAGE)
1268 lpBand->iImage = lprbbi->iImage;
1270 if (lprbbi->fMask & RBBIM_CHILD) {
1271 if (lprbbi->hwndChild) {
1272 lpBand->hwndChild = lprbbi->hwndChild;
1273 lpBand->hwndPrevParent =
1274 SetParent (lpBand->hwndChild, wndPtr->hwndSelf);
1276 else {
1277 TRACE (rebar, "child: 0x%x prev parent: 0x%x\n",
1278 lpBand->hwndChild, lpBand->hwndPrevParent);
1279 lpBand->hwndChild = 0;
1280 lpBand->hwndPrevParent = 0;
1284 if (lprbbi->fMask & RBBIM_CHILDSIZE) {
1285 lpBand->cxMinChild = lprbbi->cxMinChild;
1286 lpBand->cyMinChild = lprbbi->cyMinChild;
1287 lpBand->cyMaxChild = lprbbi->cyMaxChild;
1288 lpBand->cyChild = lprbbi->cyChild;
1289 lpBand->cyIntegral = lprbbi->cyIntegral;
1292 if (lprbbi->fMask & RBBIM_SIZE)
1293 lpBand->cx = lprbbi->cx;
1295 if (lprbbi->fMask & RBBIM_BACKGROUND)
1296 lpBand->hbmBack = lprbbi->hbmBack;
1298 if (lprbbi->fMask & RBBIM_ID)
1299 lpBand->wID = lprbbi->wID;
1301 /* check for additional data */
1302 if (lprbbi->cbSize >= sizeof (REBARBANDINFOA)) {
1303 if (lprbbi->fMask & RBBIM_IDEALSIZE)
1304 lpBand->cxIdeal = lprbbi->cxIdeal;
1306 if (lprbbi->fMask & RBBIM_LPARAM)
1307 lpBand->lParam = lprbbi->lParam;
1309 if (lprbbi->fMask & RBBIM_HEADERSIZE)
1310 lpBand->cxHeader = lprbbi->cxHeader;
1313 REBAR_Layout (wndPtr, NULL);
1314 REBAR_ForceResize (wndPtr);
1315 REBAR_MoveChildWindows (wndPtr);
1317 return TRUE;
1321 static LRESULT
1322 REBAR_SetBandInfoW (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1324 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
1325 LPREBARBANDINFOW lprbbi = (LPREBARBANDINFOW)lParam;
1326 REBAR_BAND *lpBand;
1328 if (lprbbi == NULL)
1329 return FALSE;
1330 if (lprbbi->cbSize < REBARBANDINFO_V3_SIZEW)
1331 return FALSE;
1332 if ((UINT)wParam >= infoPtr->uNumBands)
1333 return FALSE;
1335 TRACE (rebar, "index %u\n", (UINT)wParam);
1337 /* set band information */
1338 lpBand = &infoPtr->bands[(UINT)wParam];
1340 if (lprbbi->fMask & RBBIM_STYLE)
1341 lpBand->fStyle = lprbbi->fStyle;
1343 if (lprbbi->fMask & RBBIM_COLORS) {
1344 lpBand->clrFore = lprbbi->clrFore;
1345 lpBand->clrBack = lprbbi->clrBack;
1348 if (lprbbi->fMask & RBBIM_TEXT) {
1349 if (lpBand->lpText) {
1350 COMCTL32_Free (lpBand->lpText);
1351 lpBand->lpText = NULL;
1353 if (lprbbi->lpText) {
1354 INT len = lstrlenW (lprbbi->lpText);
1355 lpBand->lpText = (LPWSTR)COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));
1356 lstrcpyW (lpBand->lpText, lprbbi->lpText);
1360 if (lprbbi->fMask & RBBIM_IMAGE)
1361 lpBand->iImage = lprbbi->iImage;
1363 if (lprbbi->fMask & RBBIM_CHILD) {
1364 if (lprbbi->hwndChild) {
1365 lpBand->hwndChild = lprbbi->hwndChild;
1366 lpBand->hwndPrevParent =
1367 SetParent (lpBand->hwndChild, wndPtr->hwndSelf);
1369 else {
1370 TRACE (rebar, "child: 0x%x prev parent: 0x%x\n",
1371 lpBand->hwndChild, lpBand->hwndPrevParent);
1372 lpBand->hwndChild = 0;
1373 lpBand->hwndPrevParent = 0;
1377 if (lprbbi->fMask & RBBIM_CHILDSIZE) {
1378 lpBand->cxMinChild = lprbbi->cxMinChild;
1379 lpBand->cyMinChild = lprbbi->cyMinChild;
1380 lpBand->cyMaxChild = lprbbi->cyMaxChild;
1381 lpBand->cyChild = lprbbi->cyChild;
1382 lpBand->cyIntegral = lprbbi->cyIntegral;
1385 if (lprbbi->fMask & RBBIM_SIZE)
1386 lpBand->cx = lprbbi->cx;
1388 if (lprbbi->fMask & RBBIM_BACKGROUND)
1389 lpBand->hbmBack = lprbbi->hbmBack;
1391 if (lprbbi->fMask & RBBIM_ID)
1392 lpBand->wID = lprbbi->wID;
1394 /* check for additional data */
1395 if (lprbbi->cbSize >= sizeof (REBARBANDINFOW)) {
1396 if (lprbbi->fMask & RBBIM_IDEALSIZE)
1397 lpBand->cxIdeal = lprbbi->cxIdeal;
1399 if (lprbbi->fMask & RBBIM_LPARAM)
1400 lpBand->lParam = lprbbi->lParam;
1402 if (lprbbi->fMask & RBBIM_HEADERSIZE)
1403 lpBand->cxHeader = lprbbi->cxHeader;
1406 REBAR_Layout (wndPtr, NULL);
1407 REBAR_ForceResize (wndPtr);
1408 REBAR_MoveChildWindows (wndPtr);
1410 return TRUE;
1414 static LRESULT
1415 REBAR_SetBarInfo (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1417 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
1418 LPREBARINFO lpInfo = (LPREBARINFO)lParam;
1420 if (lpInfo == NULL)
1421 return FALSE;
1423 if (lpInfo->cbSize < sizeof (REBARINFO))
1424 return FALSE;
1426 TRACE (rebar, "setting bar info!\n");
1428 if (lpInfo->fMask & RBIM_IMAGELIST) {
1429 infoPtr->himl = lpInfo->himl;
1430 if (infoPtr->himl) {
1431 ImageList_GetIconSize (infoPtr->himl, &infoPtr->imageSize.cx,
1432 &infoPtr->imageSize.cy);
1434 else {
1435 infoPtr->imageSize.cx = 0;
1436 infoPtr->imageSize.cy = 0;
1440 return TRUE;
1444 static LRESULT
1445 REBAR_SetBkColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1447 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
1448 COLORREF clrTemp;
1450 clrTemp = infoPtr->clrBk;
1451 infoPtr->clrBk = (COLORREF)lParam;
1453 TRACE (rebar, "background color 0x%06lx!\n", infoPtr->clrBk);
1455 return clrTemp;
1459 /* << REBAR_SetColorScheme >> */
1460 /* << REBAR_SetPalette >> */
1463 static LRESULT
1464 REBAR_SetParent (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1466 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
1467 HWND hwndTemp = infoPtr->hwndNotify;
1469 infoPtr->hwndNotify = (HWND)wParam;
1471 return (LRESULT)hwndTemp;
1475 static LRESULT
1476 REBAR_SetTextColor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1478 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
1479 COLORREF clrTemp;
1481 clrTemp = infoPtr->clrText;
1482 infoPtr->clrText = (COLORREF)lParam;
1484 TRACE (rebar, "text color 0x%06lx!\n", infoPtr->clrText);
1486 return clrTemp;
1490 /* << REBAR_SetTooltips >> */
1493 __inline__ static LRESULT
1494 REBAR_SetUnicodeFormat (WND *wndPtr, WPARAM wParam)
1496 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
1497 BOOL bTemp = infoPtr->bUnicode;
1498 infoPtr->bUnicode = (BOOL)wParam;
1499 return bTemp;
1503 static LRESULT
1504 REBAR_ShowBand (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1506 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
1507 REBAR_BAND *lpBand;
1509 if (((INT)wParam < 0) || ((INT)wParam > infoPtr->uNumBands))
1510 return FALSE;
1512 lpBand = &infoPtr->bands[(INT)wParam];
1514 if ((BOOL)lParam) {
1515 TRACE (rebar, "show band %d\n", (INT)wParam);
1516 lpBand->fStyle = lpBand->fStyle & ~RBBS_HIDDEN;
1517 if (IsWindow (lpBand->hwndChild))
1518 ShowWindow (lpBand->hwndChild, SW_SHOW);
1520 else {
1521 TRACE (rebar, "hide band %d\n", (INT)wParam);
1522 lpBand->fStyle = lpBand->fStyle | RBBS_HIDDEN;
1523 if (IsWindow (lpBand->hwndChild))
1524 ShowWindow (lpBand->hwndChild, SW_SHOW);
1527 REBAR_Layout (wndPtr, NULL);
1528 REBAR_ForceResize (wndPtr);
1529 REBAR_MoveChildWindows (wndPtr);
1531 return TRUE;
1535 static LRESULT
1536 REBAR_SizeToRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1538 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (wndPtr);
1539 LPRECT lpRect = (LPRECT)lParam;
1541 if (lpRect == NULL)
1542 return FALSE;
1544 FIXME (rebar, "layout change not implemented!\n");
1545 FIXME (rebar, "[%d %d %d %d]\n",
1546 lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
1548 #if 0
1549 SetWindowPos (wndPtr->hwndSelf, 0, lpRect->left, lpRect->top,
1550 lpRect->right - lpRect->left, lpRect->bottom - lpRect->top,
1551 SWP_NOZORDER);
1552 #endif
1554 infoPtr->calcSize.cx = lpRect->right - lpRect->left;
1555 infoPtr->calcSize.cy = lpRect->bottom - lpRect->top;
1557 REBAR_ForceResize (wndPtr);
1558 return TRUE;
1563 static LRESULT
1564 REBAR_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1566 REBAR_INFO *infoPtr;
1568 /* allocate memory for info structure */
1569 infoPtr = (REBAR_INFO *)COMCTL32_Alloc (sizeof(REBAR_INFO));
1570 wndPtr->wExtra[0] = (DWORD)infoPtr;
1572 if (infoPtr == NULL) {
1573 ERR (rebar, "could not allocate info memory!\n");
1574 return 0;
1577 if ((REBAR_INFO*)wndPtr->wExtra[0] != infoPtr) {
1578 ERR (rebar, "pointer assignment error!\n");
1579 return 0;
1582 /* initialize info structure */
1583 infoPtr->clrBk = CLR_NONE;
1584 infoPtr->clrText = RGB(0, 0, 0);
1586 infoPtr->bAutoResize = FALSE;
1587 infoPtr->hcurArrow = LoadCursorA (0, IDC_ARROWA);
1588 infoPtr->hcurHorz = LoadCursorA (0, IDC_SIZEWEA);
1589 infoPtr->hcurVert = LoadCursorA (0, IDC_SIZENSA);
1590 infoPtr->hcurDrag = LoadCursorA (0, IDC_SIZEA);
1592 infoPtr->bUnicode = IsWindowUnicode (wndPtr->hwndSelf);
1594 if (wndPtr->dwStyle & RBS_AUTOSIZE)
1595 FIXME (rebar, "style RBS_AUTOSIZE set!\n");
1597 #if 0
1598 SendMessageA (wndPtr->parent->hwndSelf, WM_NOTIFYFORMAT,
1599 (WPARAM)wndPtr->hwndSelf, NF_QUERY);
1600 #endif
1602 TRACE (rebar, "created!\n");
1603 return 0;
1607 static LRESULT
1608 REBAR_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1610 REBAR_INFO *infoPtr = REBAR_GetInfoPtr(wndPtr);
1611 REBAR_BAND *lpBand;
1612 INT i;
1615 /* free rebar bands */
1616 if ((infoPtr->uNumBands > 0) && infoPtr->bands) {
1617 /* clean up each band */
1618 for (i = 0; i < infoPtr->uNumBands; i++) {
1619 lpBand = &infoPtr->bands[i];
1621 /* delete text strings */
1622 if (lpBand->lpText) {
1623 COMCTL32_Free (lpBand->lpText);
1624 lpBand->lpText = NULL;
1626 /* destroy child window */
1627 DestroyWindow (lpBand->hwndChild);
1630 /* free band array */
1631 COMCTL32_Free (infoPtr->bands);
1632 infoPtr->bands = NULL;
1638 DeleteObject (infoPtr->hcurArrow);
1639 DeleteObject (infoPtr->hcurHorz);
1640 DeleteObject (infoPtr->hcurVert);
1641 DeleteObject (infoPtr->hcurDrag);
1646 /* free rebar info data */
1647 COMCTL32_Free (infoPtr);
1649 TRACE (rebar, "destroyed!\n");
1650 return 0;
1654 static LRESULT
1655 REBAR_GetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1657 REBAR_INFO *infoPtr = REBAR_GetInfoPtr(wndPtr);
1659 return (LRESULT)infoPtr->hFont;
1663 #if 0
1664 static LRESULT
1665 REBAR_MouseMove (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1667 REBAR_INFO *infoPtr = REBAR_GetInfoPtr(wndPtr);
1669 return 0;
1671 #endif
1674 __inline__ static LRESULT
1675 REBAR_NCCalcSize (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1677 if (wndPtr->dwStyle & WS_BORDER) {
1678 ((LPRECT)lParam)->left += sysMetrics[SM_CXEDGE];
1679 ((LPRECT)lParam)->top += sysMetrics[SM_CYEDGE];
1680 ((LPRECT)lParam)->right -= sysMetrics[SM_CXEDGE];
1681 ((LPRECT)lParam)->bottom -= sysMetrics[SM_CYEDGE];
1684 return 0;
1688 static LRESULT
1689 REBAR_NCPaint (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1691 HWND hwnd = wndPtr->hwndSelf;
1692 HDC hdc;
1694 if ( wndPtr->dwStyle & WS_MINIMIZE ||
1695 !WIN_IsWindowDrawable( wndPtr, 0 )) return 0; /* Nothing to do */
1697 DefWindowProcA (hwnd, WM_NCPAINT, wParam, lParam);
1699 if (!(hdc = GetDCEx( hwnd, 0, DCX_USESTYLE | DCX_WINDOW ))) return 0;
1701 if (ExcludeVisRect16( hdc, wndPtr->rectClient.left-wndPtr->rectWindow.left,
1702 wndPtr->rectClient.top-wndPtr->rectWindow.top,
1703 wndPtr->rectClient.right-wndPtr->rectWindow.left,
1704 wndPtr->rectClient.bottom-wndPtr->rectWindow.top )
1705 == NULLREGION){
1706 ReleaseDC( hwnd, hdc );
1707 return 0;
1710 if (!(wndPtr->flags & WIN_MANAGED) && (wndPtr->dwStyle & WS_BORDER))
1711 DrawEdge (hdc, &wndPtr->rectWindow, EDGE_ETCHED, BF_RECT);
1713 ReleaseDC( hwnd, hdc );
1715 return 0;
1719 static LRESULT
1720 REBAR_Paint (WND *wndPtr, WPARAM wParam)
1722 HDC hdc;
1723 PAINTSTRUCT ps;
1725 hdc = wParam==0 ? BeginPaint (wndPtr->hwndSelf, &ps) : (HDC)wParam;
1726 REBAR_Refresh (wndPtr, hdc);
1727 if (!wParam)
1728 EndPaint (wndPtr->hwndSelf, &ps);
1729 return 0;
1733 static LRESULT
1734 REBAR_SetCursor (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1736 REBAR_INFO *infoPtr = REBAR_GetInfoPtr(wndPtr);
1737 POINT pt;
1738 UINT flags;
1740 TRACE (rebar, "code=0x%X id=0x%X\n", LOWORD(lParam), HIWORD(lParam));
1742 GetCursorPos (&pt);
1743 ScreenToClient (wndPtr->hwndSelf, &pt);
1745 REBAR_InternalHitTest (wndPtr, &pt, &flags, NULL);
1747 if (flags == RBHT_GRABBER) {
1748 if ((wndPtr->dwStyle & CCS_VERT) &&
1749 !(wndPtr->dwStyle & RBS_VERTICALGRIPPER))
1750 SetCursor (infoPtr->hcurVert);
1751 else
1752 SetCursor (infoPtr->hcurHorz);
1754 else if (flags != RBHT_CLIENT)
1755 SetCursor (infoPtr->hcurArrow);
1757 return 0;
1761 static LRESULT
1762 REBAR_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1764 REBAR_INFO *infoPtr = REBAR_GetInfoPtr(wndPtr);
1766 /* TEXTMETRIC32A tm; */
1767 HFONT hFont /*, hOldFont */;
1768 /* HDC32 hdc; */
1770 infoPtr->hFont = (HFONT)wParam;
1772 hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject (SYSTEM_FONT);
1774 hdc = GetDC32 (0);
1775 hOldFont = SelectObject32 (hdc, hFont);
1776 GetTextMetrics32A (hdc, &tm);
1777 infoPtr->nHeight = tm.tmHeight + VERT_BORDER;
1778 SelectObject32 (hdc, hOldFont);
1779 ReleaseDC32 (0, hdc);
1781 if (lParam) {
1783 REBAR_Layout (wndPtr);
1784 hdc = GetDC32 (wndPtr->hwndSelf);
1785 REBAR_Refresh (wndPtr, hdc);
1786 ReleaseDC32 (wndPtr->hwndSelf, hdc);
1790 return 0;
1793 static LRESULT
1794 REBAR_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
1796 REBAR_INFO *infoPtr = REBAR_GetInfoPtr(wndPtr);
1797 RECT rcParent;
1798 /* INT32 x, y, cx, cy; */
1800 /* auto resize deadlock check */
1801 if (infoPtr->bAutoResize) {
1802 infoPtr->bAutoResize = FALSE;
1803 return 0;
1806 TRACE (rebar, "sizing rebar!\n");
1808 /* get parent rectangle */
1809 GetClientRect (GetParent (wndPtr->hwndSelf), &rcParent);
1811 REBAR_Layout (wndPtr, &rcParent);
1813 if (wndPtr->dwStyle & CCS_VERT) {
1814 if (wndPtr->dwStyle & CCS_LEFT == CCS_LEFT) {
1815 x = rcParent.left;
1816 y = rcParent.top;
1817 cx = infoPtr->calcSize.cx;
1818 cy = infoPtr->calcSize.cy;
1820 else {
1821 x = rcParent.right - infoPtr->calcSize.cx;
1822 y = rcParent.top;
1823 cx = infoPtr->calcSize.cx;
1824 cy = infoPtr->calcSize.cy;
1827 else {
1828 if (wndPtr->dwStyle & CCS_TOP) {
1829 x = rcParent.left;
1830 y = rcParent.top;
1831 cx = infoPtr->calcSize.cx;
1832 cy = infoPtr->calcSize.cy;
1834 else {
1835 x = rcParent.left;
1836 y = rcParent.bottom - infoPtr->calcSize.cy;
1837 cx = infoPtr->calcSize.cx;
1838 cy = infoPtr->calcSize.cy;
1842 SetWindowPos32 (wndPtr->hwndSelf, 0, x, y, cx, cy,
1843 SWP_NOZORDER | SWP_SHOWWINDOW);
1845 REBAR_Layout (wndPtr, NULL);
1846 REBAR_ForceResize (wndPtr);
1847 REBAR_MoveChildWindows (wndPtr);
1849 return 0;
1853 LRESULT WINAPI
1854 REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
1856 WND *wndPtr = WIN_FindWndPtr(hwnd);
1858 switch (uMsg)
1860 /* case RB_BEGINDRAG: */
1862 case RB_DELETEBAND:
1863 return REBAR_DeleteBand (wndPtr, wParam, lParam);
1865 /* case RB_DRAGMOVE: */
1866 /* case RB_ENDDRAG: */
1868 case RB_GETBANDBORDERS:
1869 return REBAR_GetBandBorders (wndPtr, wParam, lParam);
1871 case RB_GETBANDCOUNT:
1872 return REBAR_GetBandCount (wndPtr);
1874 /* case RB_GETBANDINFO32: */ /* outdated, just for compatibility */
1876 case RB_GETBANDINFOA:
1877 return REBAR_GetBandInfoA (wndPtr, wParam, lParam);
1879 case RB_GETBANDINFOW:
1880 return REBAR_GetBandInfoW (wndPtr, wParam, lParam);
1882 case RB_GETBARHEIGHT:
1883 return REBAR_GetBarHeight (wndPtr, wParam, lParam);
1885 case RB_GETBARINFO:
1886 return REBAR_GetBarInfo (wndPtr, wParam, lParam);
1888 case RB_GETBKCOLOR:
1889 return REBAR_GetBkColor (wndPtr);
1891 /* case RB_GETCOLORSCHEME: */
1892 /* case RB_GETDROPTARGET: */
1894 case RB_GETPALETTE:
1895 return REBAR_GetPalette (wndPtr, wParam, lParam);
1897 case RB_GETRECT:
1898 return REBAR_GetRect (wndPtr, wParam, lParam);
1900 case RB_GETROWCOUNT:
1901 return REBAR_GetRowCount (wndPtr);
1903 case RB_GETROWHEIGHT:
1904 return REBAR_GetRowHeight (wndPtr, wParam, lParam);
1906 case RB_GETTEXTCOLOR:
1907 return REBAR_GetTextColor (wndPtr);
1909 case RB_GETTOOLTIPS:
1910 return REBAR_GetToolTips (wndPtr);
1912 case RB_GETUNICODEFORMAT:
1913 return REBAR_GetUnicodeFormat (wndPtr);
1915 case RB_HITTEST:
1916 return REBAR_HitTest (wndPtr, wParam, lParam);
1918 case RB_IDTOINDEX:
1919 return REBAR_IdToIndex (wndPtr, wParam, lParam);
1921 case RB_INSERTBANDA:
1922 return REBAR_InsertBandA (wndPtr, wParam, lParam);
1924 case RB_INSERTBANDW:
1925 return REBAR_InsertBandW (wndPtr, wParam, lParam);
1927 case RB_MAXIMIZEBAND:
1928 return REBAR_MaximizeBand (wndPtr, wParam, lParam);
1930 case RB_MINIMIZEBAND:
1931 return REBAR_MinimizeBand (wndPtr, wParam, lParam);
1933 case RB_MOVEBAND:
1934 return REBAR_MoveBand (wndPtr, wParam, lParam);
1936 case RB_SETBANDINFOA:
1937 return REBAR_SetBandInfoA (wndPtr, wParam, lParam);
1939 case RB_SETBANDINFOW:
1940 return REBAR_SetBandInfoW (wndPtr, wParam, lParam);
1942 case RB_SETBARINFO:
1943 return REBAR_SetBarInfo (wndPtr, wParam, lParam);
1945 case RB_SETBKCOLOR:
1946 return REBAR_SetBkColor (wndPtr, wParam, lParam);
1948 /* case RB_SETCOLORSCHEME: */
1949 /* case RB_SETPALETTE: */
1950 /* return REBAR_GetPalette (wndPtr, wParam, lParam); */
1952 case RB_SETPARENT:
1953 return REBAR_SetParent (wndPtr, wParam, lParam);
1955 case RB_SETTEXTCOLOR:
1956 return REBAR_SetTextColor (wndPtr, wParam, lParam);
1958 /* case RB_SETTOOLTIPS: */
1960 case RB_SETUNICODEFORMAT:
1961 return REBAR_SetUnicodeFormat (wndPtr, wParam);
1963 case RB_SHOWBAND:
1964 return REBAR_ShowBand (wndPtr, wParam, lParam);
1966 case RB_SIZETORECT:
1967 return REBAR_SizeToRect (wndPtr, wParam, lParam);
1970 case WM_COMMAND:
1971 return SendMessageA (wndPtr->parent->hwndSelf, uMsg, wParam, lParam);
1973 case WM_CREATE:
1974 return REBAR_Create (wndPtr, wParam, lParam);
1976 case WM_DESTROY:
1977 return REBAR_Destroy (wndPtr, wParam, lParam);
1979 case WM_GETFONT:
1980 return REBAR_GetFont (wndPtr, wParam, lParam);
1982 /* case WM_MOUSEMOVE: */
1983 /* return REBAR_MouseMove (wndPtr, wParam, lParam); */
1985 case WM_NCCALCSIZE:
1986 return REBAR_NCCalcSize (wndPtr, wParam, lParam);
1988 case WM_NCPAINT:
1989 return REBAR_NCPaint (wndPtr, wParam, lParam);
1991 case WM_NOTIFY:
1992 return SendMessageA (wndPtr->parent->hwndSelf, uMsg, wParam, lParam);
1994 case WM_PAINT:
1995 return REBAR_Paint (wndPtr, wParam);
1997 case WM_SETCURSOR:
1998 return REBAR_SetCursor (wndPtr, wParam, lParam);
2000 case WM_SETFONT:
2001 return REBAR_SetFont (wndPtr, wParam, lParam);
2003 case WM_SIZE:
2004 return REBAR_Size (wndPtr, wParam, lParam);
2006 /* case WM_TIMER: */
2008 /* case WM_WININICHANGE: */
2010 default:
2011 if (uMsg >= WM_USER)
2012 ERR (rebar, "unknown msg %04x wp=%08x lp=%08lx\n",
2013 uMsg, wParam, lParam);
2014 return DefWindowProcA (hwnd, uMsg, wParam, lParam);
2016 return 0;
2020 VOID
2021 REBAR_Register (VOID)
2023 WNDCLASSA wndClass;
2025 if (GlobalFindAtomA (REBARCLASSNAMEA)) return;
2027 ZeroMemory (&wndClass, sizeof(WNDCLASSA));
2028 wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS;
2029 wndClass.lpfnWndProc = (WNDPROC)REBAR_WindowProc;
2030 wndClass.cbClsExtra = 0;
2031 wndClass.cbWndExtra = sizeof(REBAR_INFO *);
2032 wndClass.hCursor = 0;
2033 wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
2034 wndClass.lpszClassName = REBARCLASSNAMEA;
2036 RegisterClassA (&wndClass);
2040 VOID
2041 REBAR_Unregister (VOID)
2043 if (GlobalFindAtomA (REBARCLASSNAMEA))
2044 UnregisterClassA (REBARCLASSNAMEA, (HINSTANCE)NULL);