ReactOS 0.4.15-dev-8434-g155a7c7
static.c
Go to the documentation of this file.
1/*
2 * Static control
3 *
4 * Copyright David W. Metcalfe, 1993
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 *
20 * Notes:
21 * - Windows XP introduced new behavior: The background of centered
22 * icons and bitmaps is painted differently. This is only done if
23 * a manifest is present.
24 * Because it has not yet been decided how to implement the two
25 * different modes in Wine, only the Windows XP mode is implemented.
26 * - Controls with SS_SIMPLE but without SS_NOPREFIX:
27 * The text should not be changed. Windows doesn't clear the
28 * client rectangle, so the new text must be larger than the old one.
29 * - The SS_RIGHTJUST style is currently not implemented by Windows
30 * (or it does something different than documented).
31 *
32 * TODO:
33 * - Animated cursors
34 */
35
36#include <stdarg.h>
37
38#include "windef.h"
39#include "winbase.h"
40#include "wingdi.h"
41#include "winuser.h"
42#include "commctrl.h"
43
44#include "wine/debug.h"
45
46#include "comctl32.h"
47
49
57
58/* offsets for GetWindowLong for static private information */
59#define HFONT_GWL_OFFSET 0
60#define HICON_GWL_OFFSET (sizeof(HFONT))
61#define STATIC_EXTRA_BYTES (HICON_GWL_OFFSET + sizeof(HICON))
62
64
66{
67 STATIC_PaintTextfn, /* SS_LEFT */
68 STATIC_PaintTextfn, /* SS_CENTER */
69 STATIC_PaintTextfn, /* SS_RIGHT */
70 STATIC_PaintIconfn, /* SS_ICON */
71 STATIC_PaintRectfn, /* SS_BLACKRECT */
72 STATIC_PaintRectfn, /* SS_GRAYRECT */
73 STATIC_PaintRectfn, /* SS_WHITERECT */
74 STATIC_PaintRectfn, /* SS_BLACKFRAME */
75 STATIC_PaintRectfn, /* SS_GRAYFRAME */
76 STATIC_PaintRectfn, /* SS_WHITEFRAME */
77 NULL, /* SS_USERITEM */
78 STATIC_PaintTextfn, /* SS_SIMPLE */
79 STATIC_PaintTextfn, /* SS_LEFTNOWORDWRAP */
80 STATIC_PaintOwnerDrawfn, /* SS_OWNERDRAW */
81 STATIC_PaintBitmapfn, /* SS_BITMAP */
82 STATIC_PaintEnhMetafn, /* SS_ENHMETAFILE */
83 STATIC_PaintEtchedfn, /* SS_ETCHEDHORZ */
84 STATIC_PaintEtchedfn, /* SS_ETCHEDVERT */
85 STATIC_PaintEtchedfn, /* SS_ETCHEDFRAME */
86};
87
89{
91 BITMAP bmp;
92 int ret;
93
94 if (!GetIconInfo(handle, &info))
95 return FALSE;
96
97#ifdef __REACTOS__
98 ret = GetObjectW(info.hbmMask, sizeof(bmp), &bmp);
99#else
100 ret = GetObjectW(info.hbmColor, sizeof(bmp), &bmp);
101#endif
102 if (ret)
103 {
104 size->cx = bmp.bmWidth;
105 size->cy = bmp.bmHeight;
106#ifdef __REACTOS__
107 /*
108 If this structure defines a black and white icon, this bitmask is formatted
109 so that the upper half is the icon AND bitmask and the lower half is
110 the icon XOR bitmask.
111 */
112 if (!info.hbmColor)
113 size->cy /= 2;
114#endif
115 }
116
117 DeleteObject(info.hbmMask);
118 DeleteObject(info.hbmColor);
119
120 return !!ret;
121}
122
123/***********************************************************************
124 * STATIC_SetIcon
125 *
126 * Set the icon for an SS_ICON control.
127 */
129{
130 HICON prevIcon;
131 SIZE size;
132
133 if ((style & SS_TYPEMASK) != SS_ICON) return 0;
134 if (hicon && !get_icon_size( hicon, &size ))
135 {
136 WARN("hicon != 0, but invalid\n");
137 return 0;
138 }
139 prevIcon = (HICON)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hicon );
140 if (hicon && !(style & SS_CENTERIMAGE) && !(style & SS_REALSIZECONTROL))
141 {
142 /* Windows currently doesn't implement SS_RIGHTJUST */
143 /*
144 if ((style & SS_RIGHTJUST) != 0)
145 {
146 RECT wr;
147 GetWindowRect(hwnd, &wr);
148 SetWindowPos( hwnd, 0, wr.right - info->nWidth, wr.bottom - info->nHeight,
149 info->nWidth, info->nHeight, SWP_NOACTIVATE | SWP_NOZORDER );
150 }
151 else */
152 {
154 }
155 }
156 return prevIcon;
157}
158
159/***********************************************************************
160 * STATIC_SetBitmap
161 *
162 * Set the bitmap for an SS_BITMAP control.
163 */
165{
166 HBITMAP hOldBitmap;
167
168 if ((style & SS_TYPEMASK) != SS_BITMAP) return 0;
170 {
171 WARN("hBitmap != 0, but it's not a bitmap\n");
172 return 0;
173 }
176 {
177 BITMAP bm;
178 GetObjectW(hBitmap, sizeof(bm), &bm);
179 /* Windows currently doesn't implement SS_RIGHTJUST */
180 /*
181 if ((style & SS_RIGHTJUST) != 0)
182 {
183 RECT wr;
184 GetWindowRect(hwnd, &wr);
185 SetWindowPos( hwnd, 0, wr.right - bm.bmWidth, wr.bottom - bm.bmHeight,
186 bm.bmWidth, bm.bmHeight, SWP_NOACTIVATE | SWP_NOZORDER );
187 }
188 else */
189 {
190 SetWindowPos( hwnd, 0, 0, 0, bm.bmWidth, bm.bmHeight,
192 }
193 }
194 return hOldBitmap;
195}
196
197/***********************************************************************
198 * STATIC_SetEnhMetaFile
199 *
200 * Set the enhanced metafile for an SS_ENHMETAFILE control.
201 */
202static HENHMETAFILE STATIC_SetEnhMetaFile( HWND hwnd, HENHMETAFILE hEnhMetaFile, DWORD style )
203{
204 if ((style & SS_TYPEMASK) != SS_ENHMETAFILE) return 0;
205 if (hEnhMetaFile && GetObjectType(hEnhMetaFile) != OBJ_ENHMETAFILE)
206 {
207 WARN("hEnhMetaFile != 0, but it's not an enhanced metafile\n");
208 return 0;
209 }
210 return (HENHMETAFILE)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hEnhMetaFile );
211}
212
213/***********************************************************************
214 * STATIC_GetImage
215 *
216 * Gets the bitmap for an SS_BITMAP control, the icon/cursor for an
217 * SS_ICON control or the enhanced metafile for an SS_ENHMETAFILE control.
218 */
220{
221 switch (style & SS_TYPEMASK)
222 {
223 case SS_ICON:
224 if ((wParam != IMAGE_ICON) &&
225 (wParam != IMAGE_CURSOR)) return NULL;
226 break;
227 case SS_BITMAP:
228 if (wParam != IMAGE_BITMAP) return NULL;
229 break;
230 case SS_ENHMETAFILE:
231 if (wParam != IMAGE_ENHMETAFILE) return NULL;
232 break;
233 default:
234 return NULL;
235 }
237}
238
239/***********************************************************************
240 * STATIC_LoadIconW
241 *
242 * Load the icon for an SS_ICON control.
243 */
245{
246 HICON hicon = 0;
247
248 if (hInstance && ((ULONG_PTR)hInstance >> 16))
249 {
250 if ((style & SS_REALSIZEIMAGE) != 0)
251 hicon = LoadImageW(hInstance, name, IMAGE_ICON, 0, 0, LR_SHARED);
252 else
253 {
254 hicon = LoadIconW( hInstance, name );
255 if (!hicon) hicon = LoadCursorW( hInstance, name );
256 }
257 }
258 if (!hicon) hicon = LoadIconW( 0, name );
259 /* Windows doesn't try to load a standard cursor,
260 probably because most IDs for standard cursors conflict
261 with the IDs for standard icons anyway */
262 return hicon;
263}
264
265/***********************************************************************
266 * STATIC_TryPaintFcn
267 *
268 * Try to immediately paint the control.
269 */
271{
272 LONG style = full_style & SS_TYPEMASK;
273 RECT rc;
274
275 GetClientRect( hwnd, &rc );
277 {
278 HDC hdc;
279 HRGN hrgn;
280
281 hdc = GetDC( hwnd );
282 hrgn = set_control_clipping( hdc, &rc );
283 (staticPaintFunc[style])( hwnd, hdc, full_style );
285 if (hrgn) DeleteObject( hrgn );
286 ReleaseDC( hwnd, hdc );
287 }
288}
289
291{
292 HBRUSH hBrush;
294
295 if (!parent) parent = hwnd;
296 hBrush = (HBRUSH) SendMessageW( parent, WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd );
297 if (!hBrush) /* did the app forget to call DefWindowProc ? */
298 {
299 /* FIXME: DefWindowProc should return different colors if a
300 manifest is present */
302 }
303 return hBrush;
304}
305
306/***********************************************************************
307 * hasTextStyle
308 *
309 * Tests if the control displays text.
310 */
312{
313 switch (style & SS_TYPEMASK)
314 {
315 case SS_SIMPLE:
316 case SS_LEFT:
318 case SS_CENTER:
319 case SS_RIGHT:
320 case SS_OWNERDRAW:
321 return TRUE;
322 }
323
324 return FALSE;
325}
326
328{
329 LRESULT lResult = 0;
330 LONG full_style = GetWindowLongW( hwnd, GWL_STYLE );
331 LONG style = full_style & SS_TYPEMASK;
332
333 if (!IsWindow( hwnd )) return 0;
334
335 switch (uMsg)
336 {
337 case WM_CREATE:
338 if (style < 0L || style > SS_TYPEMASK)
339 {
340 ERR("Unknown style 0x%02x\n", style );
341 return -1;
342 }
343 break;
344
345 case WM_NCDESTROY:
346 if (style == SS_ICON)
347 {
348/*
349 * FIXME
350 * DestroyIcon32( STATIC_SetIcon( wndPtr, 0 ) );
351 *
352 * We don't want to do this yet because DestroyIcon32 is broken. If the icon
353 * had already been loaded by the application the last thing we want to do is
354 * GlobalFree16 the handle.
355 */
356 break;
357 }
358 else
359 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
360
361 case WM_ERASEBKGND:
362 /* do all painting in WM_PAINT like Windows does */
363 return 1;
364
365 case WM_PRINTCLIENT:
366 case WM_PAINT:
367 {
368 PAINTSTRUCT ps;
369 RECT rect;
370 HDC hdc = wParam ? (HDC)wParam : BeginPaint(hwnd, &ps);
373 {
374 HRGN hrgn = set_control_clipping( hdc, &rect );
375 (staticPaintFunc[style])( hwnd, hdc, full_style );
377 if (hrgn) DeleteObject( hrgn );
378 }
379 if (!wParam) EndPaint(hwnd, &ps);
380 }
381 break;
382
383 case WM_ENABLE:
384 STATIC_TryPaintFcn( hwnd, full_style );
385 if (full_style & SS_NOTIFY)
386 {
387 if (wParam)
390 else
393 }
394 break;
395
398 STATIC_TryPaintFcn( hwnd, full_style );
399 break;
400
401 case WM_NCCREATE:
402 {
404
405 if (full_style & SS_SUNKEN)
408
409 switch (style)
410 {
411 case SS_ICON:
412 {
413 HICON hIcon;
414
415 hIcon = STATIC_LoadIconW(cs->hInstance, cs->lpszName, full_style);
416 STATIC_SetIcon(hwnd, hIcon, full_style);
417 }
418 break;
419 case SS_BITMAP:
420 if ((ULONG_PTR)cs->hInstance >> 16)
421 {
423 hBitmap = LoadBitmapW(cs->hInstance, cs->lpszName);
424 STATIC_SetBitmap(hwnd, hBitmap, full_style);
425 }
426 break;
427 }
428 /* SS_ENHMETAFILE: Despite what MSDN says, Windows does not load
429 the enhanced metafile that was specified as the window text. */
430 }
431 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
432
433 case WM_SETTEXT:
434 if (hasTextStyle( full_style ))
435 {
436 lResult = DefWindowProcW( hwnd, uMsg, wParam, lParam );
437 STATIC_TryPaintFcn( hwnd, full_style );
438 }
439 break;
440
441 case WM_SETFONT:
442 if (hasTextStyle( full_style ))
443 {
445 if (LOWORD(lParam))
447 }
448 break;
449
450 case WM_GETFONT:
452
453 case WM_NCHITTEST:
454 if (full_style & SS_NOTIFY)
455 return HTCLIENT;
456 else
457 return HTTRANSPARENT;
458
459 case WM_GETDLGCODE:
460 return DLGC_STATIC;
461
462 case WM_LBUTTONDOWN:
463 case WM_NCLBUTTONDOWN:
464 if (full_style & SS_NOTIFY)
467 return 0;
468
469 case WM_LBUTTONDBLCLK:
471 if (full_style & SS_NOTIFY)
474 return 0;
475
476 case STM_GETIMAGE:
477 return (LRESULT)STATIC_GetImage( hwnd, wParam, full_style );
478
479 case STM_GETICON:
480 return (LRESULT)STATIC_GetImage( hwnd, IMAGE_ICON, full_style );
481
482 case STM_SETIMAGE:
483 switch (wParam)
484 {
485 case IMAGE_BITMAP:
486 lResult = (LRESULT)STATIC_SetBitmap( hwnd, (HBITMAP)lParam, full_style );
487 break;
489 lResult = (LRESULT)STATIC_SetEnhMetaFile( hwnd, (HENHMETAFILE)lParam, full_style );
490 break;
491 case IMAGE_ICON:
492 case IMAGE_CURSOR:
493 lResult = (LRESULT)STATIC_SetIcon( hwnd, (HICON)lParam, full_style );
494 break;
495 default:
496 FIXME("STM_SETIMAGE: Unhandled type %lx\n", wParam);
497 break;
498 }
499 STATIC_TryPaintFcn( hwnd, full_style );
500 break;
501
502 case STM_SETICON:
503 lResult = (LRESULT)STATIC_SetIcon( hwnd, (HICON)wParam, full_style );
504 STATIC_TryPaintFcn( hwnd, full_style );
505 break;
506
507 default:
508 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
509 }
510 return lResult;
511}
512
514{
515 DRAWITEMSTRUCT dis;
516 HFONT font, oldFont = NULL;
518
519 dis.CtlType = ODT_STATIC;
520 dis.CtlID = id;
521 dis.itemID = 0;
524 dis.hwndItem = hwnd;
525 dis.hDC = hdc;
526 dis.itemData = 0;
527 GetClientRect( hwnd, &dis.rcItem );
528
530 if (font) oldFont = SelectObject( hdc, font );
533 if (font) SelectObject( hdc, oldFont );
534}
535
537{
538 RECT rc;
539
540 SetRect(&rc, 0, 0, cx, cy);
541 DrawTextW(hdc, (LPCWSTR)lp, -1, &rc, (UINT)wp);
542 return TRUE;
543}
544
546{
547 RECT rc;
548 HBRUSH hBrush;
549 HFONT hFont, hOldFont = NULL;
550 UINT format;
551 INT len, buf_size;
552 WCHAR *text;
553
554 GetClientRect( hwnd, &rc);
555
556 switch (style & SS_TYPEMASK)
557 {
558 case SS_LEFT:
560 break;
561
562 case SS_CENTER:
564 break;
565
566 case SS_RIGHT:
568 break;
569
570 case SS_SIMPLE:
572 break;
573
576 break;
577
578 default:
579 return;
580 }
581
584
585 if (style & SS_NOPREFIX)
587
588 if ((style & SS_TYPEMASK) != SS_SIMPLE)
589 {
590 if (style & SS_CENTERIMAGE)
592 if (style & SS_EDITCONTROL)
594 if (style & SS_ENDELLIPSIS)
600 }
601
603 hOldFont = SelectObject( hdc, hFont );
604
605 /* SS_SIMPLE controls: WM_CTLCOLORSTATIC is sent, but the returned
606 brush is not used */
608
609 if ((style & SS_TYPEMASK) != SS_SIMPLE)
610 {
611 FillRect( hdc, &rc, hBrush );
613 }
614
615 buf_size = 256;
616 if (!(text = HeapAlloc( GetProcessHeap(), 0, buf_size * sizeof(WCHAR) )))
617 goto no_TextOut;
618
619 while ((len = InternalGetWindowText( hwnd, text, buf_size )) == buf_size - 1)
620 {
621 buf_size *= 2;
622 if (!(text = HeapReAlloc( GetProcessHeap(), 0, text, buf_size * sizeof(WCHAR) )))
623 goto no_TextOut;
624 }
625
626 if (!len) goto no_TextOut;
627
628 if (((style & SS_TYPEMASK) == SS_SIMPLE) && (style & SS_NOPREFIX))
629 {
630 /* Windows uses the faster ExtTextOut() to draw the text and
631 to paint the whole client rectangle with the text background
632 color. Reference: "Static Controls" by Kyle Marsh, 1992 */
634 &rc, text, len, NULL );
635 }
636 else
637 {
639 if (style & WS_DISABLED)
643 rc.left, rc.top,
644 rc.right - rc.left, rc.bottom - rc.top,
645 flags);
646 }
647
648no_TextOut:
650
651 if (hFont)
652 SelectObject( hdc, hOldFont );
653}
654
656{
657 RECT rc;
658 HBRUSH hBrush;
659
660 GetClientRect( hwnd, &rc);
661
662 /* FIXME: send WM_CTLCOLORSTATIC */
663 switch (style & SS_TYPEMASK)
664 {
665 case SS_BLACKRECT:
667 FillRect( hdc, &rc, hBrush );
668 break;
669 case SS_GRAYRECT:
671 FillRect( hdc, &rc, hBrush );
672 break;
673 case SS_WHITERECT:
675 FillRect( hdc, &rc, hBrush );
676 break;
677 case SS_BLACKFRAME:
679 FrameRect( hdc, &rc, hBrush );
680 break;
681 case SS_GRAYFRAME:
683 FrameRect( hdc, &rc, hBrush );
684 break;
685 case SS_WHITEFRAME:
687 FrameRect( hdc, &rc, hBrush );
688 break;
689 default:
690 return;
691 }
692 DeleteObject( hBrush );
693}
694
695
697{
698 RECT rc, iconRect;
699 HBRUSH hbrush;
700 HICON hIcon;
701 SIZE size;
702
703 GetClientRect( hwnd, &rc );
706 if (!hIcon || !get_icon_size( hIcon, &size ))
707 {
708 FillRect(hdc, &rc, hbrush);
709 }
710 else
711 {
712 if (style & SS_CENTERIMAGE)
713 {
714 iconRect.left = (rc.right - rc.left) / 2 - size.cx / 2;
715 iconRect.top = (rc.bottom - rc.top) / 2 - size.cy / 2;
716 iconRect.right = iconRect.left + size.cx;
717 iconRect.bottom = iconRect.top + size.cy;
718 }
719 else
720 iconRect = rc;
721 FillRect( hdc, &rc, hbrush );
722 DrawIconEx( hdc, iconRect.left, iconRect.top, hIcon, iconRect.right - iconRect.left,
723 iconRect.bottom - iconRect.top, 0, NULL, DI_NORMAL );
724 }
725}
726
728{
729 HDC hMemDC;
730 HBITMAP hBitmap, oldbitmap;
731 HBRUSH hbrush;
732
733 /* message is still sent, even if the returned brush is not used */
735
738 && (hMemDC = CreateCompatibleDC( hdc )))
739 {
740 BITMAP bm;
741 RECT rcClient;
742 LOGBRUSH brush;
743
744 GetObjectW(hBitmap, sizeof(bm), &bm);
745 oldbitmap = SelectObject(hMemDC, hBitmap);
746
747 /* Set the background color for monochrome bitmaps
748 to the color of the background brush */
749 if (GetObjectW( hbrush, sizeof(brush), &brush ))
750 {
751 if (brush.lbStyle == BS_SOLID)
752 SetBkColor(hdc, brush.lbColor);
753 }
754 GetClientRect(hwnd, &rcClient);
755 if (style & SS_CENTERIMAGE)
756 {
757 FillRect( hdc, &rcClient, hbrush );
758 rcClient.left = (rcClient.right - rcClient.left)/2 - bm.bmWidth/2;
759 rcClient.top = (rcClient.bottom - rcClient.top)/2 - bm.bmHeight/2;
760 rcClient.right = rcClient.left + bm.bmWidth;
761 rcClient.bottom = rcClient.top + bm.bmHeight;
762 }
763 StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left,
764 rcClient.bottom - rcClient.top, hMemDC,
765 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
766 SelectObject(hMemDC, oldbitmap);
767 DeleteDC(hMemDC);
768 }
769}
770
772{
773 HENHMETAFILE hEnhMetaFile;
774 RECT rc;
775 HBRUSH hbrush;
776
777 GetClientRect(hwnd, &rc);
779 FillRect(hdc, &rc, hbrush);
780 if ((hEnhMetaFile = (HENHMETAFILE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET )))
781 {
782 /* The control's current font is not selected into the
783 device context! */
784 if (GetObjectType(hEnhMetaFile) == OBJ_ENHMETAFILE)
785 PlayEnhMetaFile(hdc, hEnhMetaFile, &rc);
786 }
787}
788
790{
791 RECT rc;
792
793 /* FIXME: sometimes (not always) sends WM_CTLCOLORSTATIC */
794 GetClientRect( hwnd, &rc );
795 switch (style & SS_TYPEMASK)
796 {
797 case SS_ETCHEDHORZ:
799 break;
800 case SS_ETCHEDVERT:
802 break;
803 case SS_ETCHEDFRAME:
805 break;
806 }
807}
808
810{
811 WNDCLASSW wndClass;
812
813 memset(&wndClass, 0, sizeof(wndClass));
816 wndClass.cbClsExtra = 0;
818 wndClass.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
819 wndClass.hbrBackground = NULL;
820 wndClass.lpszClassName = WC_STATICW;
821 RegisterClassW(&wndClass);
822}
823
824#ifdef __REACTOS__
825void STATIC_Unregister(void)
826{
828}
829#endif
static HRGN hrgn
static HBRUSH hbrush
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
Definition: ObTypes.c:15
Arabic default style
Definition: afstyles.h:94
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
HFONT hFont
Definition: main.c:53
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
HINSTANCE hInstance
Definition: charmap.c:19
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN
Definition: commctrl.c:1586
COMCTL32_SysColor comctl32_color
Definition: commctrl.c:82
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static HBITMAP hBitmap
Definition: timezone.c:26
HRGN set_control_clipping(HDC hdc, const RECT *rect)
Definition: button.c:239
static void STATIC_PaintEnhMetafn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:771
static LRESULT CALLBACK STATIC_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: static.c:327
static HBRUSH STATIC_SendWmCtlColorStatic(HWND hwnd, HDC hdc)
Definition: static.c:290
void(* pfPaint)(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:63
static BOOL CALLBACK STATIC_DrawTextCallback(HDC hdc, LPARAM lp, WPARAM wp, int cx, int cy)
Definition: static.c:536
#define HICON_GWL_OFFSET
Definition: static.c:60
static HBITMAP STATIC_SetBitmap(HWND hwnd, HBITMAP hBitmap, DWORD style)
Definition: static.c:164
static HICON STATIC_LoadIconW(HINSTANCE hInstance, LPCWSTR name, DWORD style)
Definition: static.c:244
static void STATIC_PaintOwnerDrawfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:513
static HICON STATIC_SetIcon(HWND hwnd, HICON hicon, DWORD style)
Definition: static.c:128
static void STATIC_PaintTextfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:545
static BOOL get_icon_size(HICON handle, SIZE *size)
Definition: static.c:88
void STATIC_Register(void)
Definition: static.c:809
static BOOL hasTextStyle(DWORD style)
Definition: static.c:311
static void STATIC_PaintRectfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:655
static HANDLE STATIC_GetImage(HWND hwnd, WPARAM wParam, DWORD style)
Definition: static.c:219
#define HFONT_GWL_OFFSET
Definition: static.c:59
static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:727
static void STATIC_PaintIconfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:696
static VOID STATIC_TryPaintFcn(HWND hwnd, LONG full_style)
Definition: static.c:270
#define STATIC_EXTRA_BYTES
Definition: static.c:61
static void STATIC_PaintEtchedfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:789
static const pfPaint staticPaintFunc[SS_TYPEMASK+1]
Definition: static.c:65
static HENHMETAFILE STATIC_SetEnhMetaFile(HWND hwnd, HENHMETAFILE hEnhMetaFile, DWORD style)
Definition: static.c:202
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapReAlloc
Definition: compat.h:734
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
const WCHAR * text
Definition: package.c:1799
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
GLuint id
Definition: glext.h:5910
#define cs
Definition: i386-dis.c:442
BITMAP bmp
Definition: alphablend.c:62
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
static HICON
Definition: imagelist.c:84
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HICON hIcon
Definition: msconfig.c:44
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
Definition: mk_font.cpp:20
unsigned int UINT
Definition: ndis.h:50
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define OBJ_BITMAP
Definition: objidl.idl:1415
#define OBJ_ENHMETAFILE
Definition: objidl.idl:1421
#define LRESULT
Definition: ole.h:14
#define LOWORD(l)
Definition: pedump.c:82
#define SS_WHITERECT
Definition: pedump.c:698
#define SS_WHITEFRAME
Definition: pedump.c:701
#define SS_BLACKRECT
Definition: pedump.c:696
#define SS_RIGHT
Definition: pedump.c:694
#define SS_SIMPLE
Definition: pedump.c:702
long LONG
Definition: pedump.c:60
#define SS_BITMAP
Definition: pedump.c:704
#define SS_GRAYFRAME
Definition: pedump.c:700
#define WS_DISABLED
Definition: pedump.c:621
#define SS_LEFTNOWORDWRAP
Definition: pedump.c:703
#define SS_CENTER
Definition: pedump.c:693
#define SS_LEFT
Definition: pedump.c:692
#define SS_GRAYRECT
Definition: pedump.c:697
#define SS_BLACKFRAME
Definition: pedump.c:699
#define SS_ICON
Definition: pedump.c:695
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define WC_STATICW
Definition: commctrl.h:4680
#define WM_PRINTCLIENT
Definition: richedit.h:70
#define memset(x, y, z)
Definition: compat.h:39
& rect
Definition: startmenu.cpp:1413
#define SS_ENDELLIPSIS
Definition: statst2.c:8
COLORREF clr3dShadow
Definition: comctl32.h:173
COLORREF clr3dDkShadow
Definition: comctl32.h:174
COLORREF clr3dHilight
Definition: comctl32.h:172
Definition: bl.h:1331
LPCWSTR lpszClassName
Definition: winuser.h:3185
HBRUSH hbrBackground
Definition: winuser.h:3183
int cbClsExtra
Definition: winuser.h:3178
UINT style
Definition: winuser.h:3176
WNDPROC lpfnWndProc
Definition: winuser.h:3177
int cbWndExtra
Definition: winuser.h:3179
HCURSOR hCursor
Definition: winuser.h:3182
Definition: name.c:39
ULONG_PTR itemData
Definition: winuser.h:3093
UINT lbStyle
Definition: wingdi.h:1747
COLORREF lbColor
Definition: wingdi.h:1748
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
int ret
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define DI_NORMAL
Definition: wingdi.h:72
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
#define SRCCOPY
Definition: wingdi.h:333
#define ETO_CLIPPED
Definition: wingdi.h:648
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCWSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
#define ETO_OPAQUE
Definition: wingdi.h:647
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
#define BS_SOLID
Definition: wingdi.h:1086
BOOL WINAPI PlayEnhMetaFile(_In_ HDC, _In_ HENHMETAFILE, _In_ LPCRECT)
#define WM_PAINT
Definition: winuser.h:1620
#define ODS_DISABLED
Definition: winuser.h:2547
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1625
DWORD WINAPI GetSysColor(_In_ int)
#define MAKEWPARAM(l, h)
Definition: winuser.h:4009
#define WS_EX_STATICEDGE
Definition: winuser.h:403
BOOL WINAPI IsWindow(_In_opt_ HWND)
int WINAPI FrameRect(_In_ HDC, _In_ LPCRECT, _In_ HBRUSH)
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1772
#define SWP_NOACTIVATE
Definition: winuser.h:1242
#define DT_NOPREFIX
Definition: winuser.h:537
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define IMAGE_BITMAP
Definition: winuser.h:211
#define GetWindowLongPtrW
Definition: winuser.h:4829
#define WM_ENABLE
Definition: winuser.h:1615
#define COLOR_GRAYTEXT
Definition: winuser.h:932
#define SS_PATHELLIPSIS
Definition: winuser.h:364
#define DT_CENTER
Definition: winuser.h:527
#define ODA_DRAWENTIRE
Definition: winuser.h:2542
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define STM_SETICON
Definition: winuser.h:2092
#define DT_END_ELLIPSIS
Definition: winuser.h:529
#define IMAGE_ICON
Definition: winuser.h:212
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
Definition: cursoricon.c:2089
#define DSS_DISABLED
Definition: winuser.h:519
#define WM_CREATE
Definition: winuser.h:1608
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define SS_OWNERDRAW
Definition: winuser.h:352
#define DT_SINGLELINE
Definition: winuser.h:540
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1778
#define SWP_NOMOVE
Definition: winuser.h:1244
#define WM_COMMAND
Definition: winuser.h:1740
#define SS_NOTIFY
Definition: winuser.h:351
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define BF_LEFT
Definition: winuser.h:454
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2247
#define IDC_ARROW
Definition: winuser.h:687
#define WM_NCHITTEST
Definition: winuser.h:1686
#define SS_ETCHEDFRAME
Definition: winuser.h:342
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
#define EDGE_ETCHED
Definition: winuser.h:452
#define SS_EDITCONTROL
Definition: winuser.h:340
#define SS_NOPREFIX
Definition: winuser.h:350
#define RDW_UPDATENOW
Definition: winuser.h:1220
#define SS_ETCHEDHORZ
Definition: winuser.h:343
#define RDW_ERASE
Definition: winuser.h:1211
#define BF_BOTTOM
Definition: winuser.h:457
#define CS_DBLCLKS
Definition: winuser.h:651
#define WM_LBUTTONDOWN
Definition: winuser.h:1776
#define SS_ENHMETAFILE
Definition: winuser.h:341
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1626
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2149
#define SS_CENTERIMAGE
Definition: winuser.h:339
#define WM_GETFONT
Definition: winuser.h:1651
#define SS_ETCHEDVERT
Definition: winuser.h:344
#define STM_SETIMAGE
Definition: winuser.h:2093
#define WM_NCLBUTTONDBLCLK
Definition: winuser.h:1694
#define WM_DRAWITEM
Definition: winuser.h:1645
#define WM_NCCREATE
Definition: winuser.h:1683
#define STM_GETICON
Definition: winuser.h:2090
#define STN_DISABLE
Definition: winuser.h:2096
#define WM_SETTEXT
Definition: winuser.h:1617
#define SS_WORDELLIPSIS
Definition: winuser.h:365
#define SS_TYPEMASK
Definition: winuser.h:362
#define DT_LEFT
Definition: winuser.h:534
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define IMAGE_ENHMETAFILE
Definition: winuser.h:214
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define SS_REALSIZEIMAGE
Definition: winuser.h:354
#define DST_COMPLEX
Definition: winuser.h:512
#define BF_TOP
Definition: winuser.h:455
#define RDW_ALLCHILDREN
Definition: winuser.h:1221
#define WM_SETFONT
Definition: winuser.h:1650
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define BF_RIGHT
Definition: winuser.h:456
#define DT_WORDBREAK
Definition: winuser.h:544
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:2072
#define HTCLIENT
Definition: winuser.h:2475
HDC WINAPI GetDC(_In_opt_ HWND)
#define DLGC_STATIC
Definition: winuser.h:2619
#define LR_SHARED
Definition: winuser.h:1100
#define SS_REALSIZECONTROL
Definition: winuser.h:353
BOOL WINAPI IsWindowEnabled(_In_ HWND)
#define DT_VCENTER
Definition: winuser.h:543
HWND WINAPI GetParent(_In_ HWND)
#define IMAGE_CURSOR
Definition: winuser.h:213
#define CS_GLOBALCLASS
Definition: winuser.h:652
#define WM_NCDESTROY
Definition: winuser.h:1684
#define HTTRANSPARENT
Definition: winuser.h:2473
#define GWLP_ID
Definition: winuser.h:860
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
#define DT_WORD_ELLIPSIS
Definition: winuser.h:531
#define DT_RIGHT
Definition: winuser.h:538
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2207
#define SWP_NOZORDER
Definition: winuser.h:1247
#define DT_EXPANDTABS
Definition: winuser.h:532
#define ODT_STATIC
Definition: winuser.h:2541
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
INT WINAPI InternalGetWindowText(_In_ HWND hWnd, _Out_writes_to_(cchMaxCount, return+1) LPWSTR pString, _In_ int cchMaxCount)
#define SetWindowLongPtrW
Definition: winuser.h:5355
#define DT_EDITCONTROL
Definition: winuser.h:528
#define BF_RECT
Definition: winuser.h:462
BOOL WINAPI DrawStateW(_In_ HDC, _In_opt_ HBRUSH, _In_opt_ DRAWSTATEPROC, _In_ LPARAM, _In_ WPARAM, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define GWL_STYLE
Definition: winuser.h:852
#define STN_DBLCLK
Definition: winuser.h:2095
#define CS_PARENTDC
Definition: winuser.h:656
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define STM_GETIMAGE
Definition: winuser.h:2091
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2119
#define SS_SUNKEN
Definition: winuser.h:358
#define STN_ENABLE
Definition: winuser.h:2097
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1692
#define STN_CLICKED
Definition: winuser.h:2094
#define RDW_INVALIDATE
Definition: winuser.h:1214
#define DT_PATH_ELLIPSIS
Definition: winuser.h:530
#define WM_GETDLGCODE
Definition: winuser.h:1689
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define WS_EX_RIGHT
Definition: winuser.h:400
#define GWL_EXSTYLE
Definition: winuser.h:851
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185