ReactOS  0.4.13-dev-99-g7e18b6d
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 
51 static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, DWORD style );
52 static void STATIC_PaintRectfn( HWND hwnd, HDC hdc, DWORD style );
53 static void STATIC_PaintIconfn( HWND hwnd, HDC hdc, DWORD style );
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 
63 typedef void (*pfPaint)( HWND hwnd, HDC hdc, DWORD style );
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 {
90  ICONINFO info;
91  BITMAP bmp;
92  int ret;
93 
94  if (!GetIconInfo(handle, &info))
95  return FALSE;
96 
97  ret = GetObjectW(info.hbmColor, sizeof(bmp), &bmp);
98  if (ret)
99  {
100  size->cx = bmp.bmWidth;
101  size->cy = bmp.bmHeight;
102  }
103 
104  DeleteObject(info.hbmMask);
105  DeleteObject(info.hbmColor);
106 
107  return !!ret;
108 }
109 
110 /***********************************************************************
111  * STATIC_SetIcon
112  *
113  * Set the icon for an SS_ICON control.
114  */
116 {
117  HICON prevIcon;
118  SIZE size;
119 
120  if ((style & SS_TYPEMASK) != SS_ICON) return 0;
121  if (hicon && !get_icon_size( hicon, &size ))
122  {
123  WARN("hicon != 0, but invalid\n");
124  return 0;
125  }
126  prevIcon = (HICON)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hicon );
127  if (hicon && !(style & SS_CENTERIMAGE) && !(style & SS_REALSIZECONTROL))
128  {
129  /* Windows currently doesn't implement SS_RIGHTJUST */
130  /*
131  if ((style & SS_RIGHTJUST) != 0)
132  {
133  RECT wr;
134  GetWindowRect(hwnd, &wr);
135  SetWindowPos( hwnd, 0, wr.right - info->nWidth, wr.bottom - info->nHeight,
136  info->nWidth, info->nHeight, SWP_NOACTIVATE | SWP_NOZORDER );
137  }
138  else */
139  {
141  }
142  }
143  return prevIcon;
144 }
145 
146 /***********************************************************************
147  * STATIC_SetBitmap
148  *
149  * Set the bitmap for an SS_BITMAP control.
150  */
152 {
153  HBITMAP hOldBitmap;
154 
155  if ((style & SS_TYPEMASK) != SS_BITMAP) return 0;
157  {
158  WARN("hBitmap != 0, but it's not a bitmap\n");
159  return 0;
160  }
163  {
164  BITMAP bm;
165  GetObjectW(hBitmap, sizeof(bm), &bm);
166  /* Windows currently doesn't implement SS_RIGHTJUST */
167  /*
168  if ((style & SS_RIGHTJUST) != 0)
169  {
170  RECT wr;
171  GetWindowRect(hwnd, &wr);
172  SetWindowPos( hwnd, 0, wr.right - bm.bmWidth, wr.bottom - bm.bmHeight,
173  bm.bmWidth, bm.bmHeight, SWP_NOACTIVATE | SWP_NOZORDER );
174  }
175  else */
176  {
177  SetWindowPos( hwnd, 0, 0, 0, bm.bmWidth, bm.bmHeight,
179  }
180  }
181  return hOldBitmap;
182 }
183 
184 /***********************************************************************
185  * STATIC_SetEnhMetaFile
186  *
187  * Set the enhanced metafile for an SS_ENHMETAFILE control.
188  */
189 static HENHMETAFILE STATIC_SetEnhMetaFile( HWND hwnd, HENHMETAFILE hEnhMetaFile, DWORD style )
190 {
191  if ((style & SS_TYPEMASK) != SS_ENHMETAFILE) return 0;
192  if (hEnhMetaFile && GetObjectType(hEnhMetaFile) != OBJ_ENHMETAFILE)
193  {
194  WARN("hEnhMetaFile != 0, but it's not an enhanced metafile\n");
195  return 0;
196  }
197  return (HENHMETAFILE)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hEnhMetaFile );
198 }
199 
200 /***********************************************************************
201  * STATIC_GetImage
202  *
203  * Gets the bitmap for an SS_BITMAP control, the icon/cursor for an
204  * SS_ICON control or the enhanced metafile for an SS_ENHMETAFILE control.
205  */
207 {
208  switch (style & SS_TYPEMASK)
209  {
210  case SS_ICON:
211  if ((wParam != IMAGE_ICON) &&
212  (wParam != IMAGE_CURSOR)) return NULL;
213  break;
214  case SS_BITMAP:
215  if (wParam != IMAGE_BITMAP) return NULL;
216  break;
217  case SS_ENHMETAFILE:
218  if (wParam != IMAGE_ENHMETAFILE) return NULL;
219  break;
220  default:
221  return NULL;
222  }
224 }
225 
226 /***********************************************************************
227  * STATIC_LoadIconW
228  *
229  * Load the icon for an SS_ICON control.
230  */
232 {
233  HICON hicon = 0;
234 
235  if (hInstance && ((ULONG_PTR)hInstance >> 16))
236  {
237  if ((style & SS_REALSIZEIMAGE) != 0)
238  hicon = LoadImageW(hInstance, name, IMAGE_ICON, 0, 0, LR_SHARED);
239  else
240  {
241  hicon = LoadIconW( hInstance, name );
242  if (!hicon) hicon = LoadCursorW( hInstance, name );
243  }
244  }
245  if (!hicon) hicon = LoadIconW( 0, name );
246  /* Windows doesn't try to load a standard cursor,
247  probably because most IDs for standard cursors conflict
248  with the IDs for standard icons anyway */
249  return hicon;
250 }
251 
252 /***********************************************************************
253  * STATIC_TryPaintFcn
254  *
255  * Try to immediately paint the control.
256  */
257 static VOID STATIC_TryPaintFcn(HWND hwnd, LONG full_style)
258 {
259  LONG style = full_style & SS_TYPEMASK;
260  RECT rc;
261 
262  GetClientRect( hwnd, &rc );
264  {
265  HDC hdc;
266  HRGN hrgn;
267 
268  hdc = GetDC( hwnd );
269  hrgn = set_control_clipping( hdc, &rc );
270  (staticPaintFunc[style])( hwnd, hdc, full_style );
271  SelectClipRgn( hdc, hrgn );
272  if (hrgn) DeleteObject( hrgn );
273  ReleaseDC( hwnd, hdc );
274  }
275 }
276 
278 {
279  HBRUSH hBrush;
281 
282  if (!parent) parent = hwnd;
283  hBrush = (HBRUSH) SendMessageW( parent, WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd );
284  if (!hBrush) /* did the app forget to call DefWindowProc ? */
285  {
286  /* FIXME: DefWindowProc should return different colors if a
287  manifest is present */
288  hBrush = (HBRUSH)DefWindowProcW( parent, WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd);
289  }
290  return hBrush;
291 }
292 
293 /***********************************************************************
294  * hasTextStyle
295  *
296  * Tests if the control displays text.
297  */
299 {
300  switch (style & SS_TYPEMASK)
301  {
302  case SS_SIMPLE:
303  case SS_LEFT:
304  case SS_LEFTNOWORDWRAP:
305  case SS_CENTER:
306  case SS_RIGHT:
307  case SS_OWNERDRAW:
308  return TRUE;
309  }
310 
311  return FALSE;
312 }
313 
315 {
316  LRESULT lResult = 0;
317  LONG full_style = GetWindowLongW( hwnd, GWL_STYLE );
318  LONG style = full_style & SS_TYPEMASK;
319 
320  if (!IsWindow( hwnd )) return 0;
321 
322  switch (uMsg)
323  {
324  case WM_CREATE:
325  if (style < 0L || style > SS_TYPEMASK)
326  {
327  ERR("Unknown style 0x%02x\n", style );
328  return -1;
329  }
330  break;
331 
332  case WM_NCDESTROY:
333  if (style == SS_ICON)
334  {
335 /*
336  * FIXME
337  * DestroyIcon32( STATIC_SetIcon( wndPtr, 0 ) );
338  *
339  * We don't want to do this yet because DestroyIcon32 is broken. If the icon
340  * had already been loaded by the application the last thing we want to do is
341  * GlobalFree16 the handle.
342  */
343  break;
344  }
345  else
346  return DefWindowProcW(hwnd, uMsg, wParam, lParam);
347 
348  case WM_ERASEBKGND:
349  /* do all painting in WM_PAINT like Windows does */
350  return 1;
351 
352  case WM_PRINTCLIENT:
353  case WM_PAINT:
354  {
355  PAINTSTRUCT ps;
356  RECT rect;
357  HDC hdc = wParam ? (HDC)wParam : BeginPaint(hwnd, &ps);
358  GetClientRect( hwnd, &rect );
359  if (staticPaintFunc[style])
360  {
361  HRGN hrgn = set_control_clipping( hdc, &rect );
362  (staticPaintFunc[style])( hwnd, hdc, full_style );
363  SelectClipRgn( hdc, hrgn );
364  if (hrgn) DeleteObject( hrgn );
365  }
366  if (!wParam) EndPaint(hwnd, &ps);
367  }
368  break;
369 
370  case WM_ENABLE:
371  STATIC_TryPaintFcn( hwnd, full_style );
372  if (full_style & SS_NOTIFY)
373  {
374  if (wParam)
377  else
380  }
381  break;
382 
383  case WM_SYSCOLORCHANGE:
385  STATIC_TryPaintFcn( hwnd, full_style );
386  break;
387 
388  case WM_NCCREATE:
389  {
391 
392  if (full_style & SS_SUNKEN)
395 
396  switch (style)
397  {
398  case SS_ICON:
399  {
400  HICON hIcon;
401 
402  hIcon = STATIC_LoadIconW(cs->hInstance, cs->lpszName, full_style);
403  STATIC_SetIcon(hwnd, hIcon, full_style);
404  }
405  break;
406  case SS_BITMAP:
407  if ((ULONG_PTR)cs->hInstance >> 16)
408  {
410  hBitmap = LoadBitmapW(cs->hInstance, cs->lpszName);
411  STATIC_SetBitmap(hwnd, hBitmap, full_style);
412  }
413  break;
414  }
415  /* SS_ENHMETAFILE: Despite what MSDN says, Windows does not load
416  the enhanced metafile that was specified as the window text. */
417  }
418  return DefWindowProcW(hwnd, uMsg, wParam, lParam);
419 
420  case WM_SETTEXT:
421  if (hasTextStyle( full_style ))
422  {
423  lResult = DefWindowProcW( hwnd, uMsg, wParam, lParam );
424  STATIC_TryPaintFcn( hwnd, full_style );
425  }
426  break;
427 
428  case WM_SETFONT:
429  if (hasTextStyle( full_style ))
430  {
432  if (LOWORD(lParam))
434  }
435  break;
436 
437  case WM_GETFONT:
439 
440  case WM_NCHITTEST:
441  if (full_style & SS_NOTIFY)
442  return HTCLIENT;
443  else
444  return HTTRANSPARENT;
445 
446  case WM_GETDLGCODE:
447  return DLGC_STATIC;
448 
449  case WM_LBUTTONDOWN:
450  case WM_NCLBUTTONDOWN:
451  if (full_style & SS_NOTIFY)
454  return 0;
455 
456  case WM_LBUTTONDBLCLK:
457  case WM_NCLBUTTONDBLCLK:
458  if (full_style & SS_NOTIFY)
461  return 0;
462 
463  case STM_GETIMAGE:
464  return (LRESULT)STATIC_GetImage( hwnd, wParam, full_style );
465 
466  case STM_GETICON:
467  return (LRESULT)STATIC_GetImage( hwnd, IMAGE_ICON, full_style );
468 
469  case STM_SETIMAGE:
470  switch (wParam)
471  {
472  case IMAGE_BITMAP:
473  lResult = (LRESULT)STATIC_SetBitmap( hwnd, (HBITMAP)lParam, full_style );
474  break;
475  case IMAGE_ENHMETAFILE:
476  lResult = (LRESULT)STATIC_SetEnhMetaFile( hwnd, (HENHMETAFILE)lParam, full_style );
477  break;
478  case IMAGE_ICON:
479  case IMAGE_CURSOR:
480  lResult = (LRESULT)STATIC_SetIcon( hwnd, (HICON)lParam, full_style );
481  break;
482  default:
483  FIXME("STM_SETIMAGE: Unhandled type %lx\n", wParam);
484  break;
485  }
486  STATIC_TryPaintFcn( hwnd, full_style );
487  break;
488 
489  case STM_SETICON:
490  lResult = (LRESULT)STATIC_SetIcon( hwnd, (HICON)wParam, full_style );
491  STATIC_TryPaintFcn( hwnd, full_style );
492  break;
493 
494  default:
495  return DefWindowProcW(hwnd, uMsg, wParam, lParam);
496  }
497  return lResult;
498 }
499 
501 {
502  DRAWITEMSTRUCT dis;
503  HFONT font, oldFont = NULL;
505 
506  dis.CtlType = ODT_STATIC;
507  dis.CtlID = id;
508  dis.itemID = 0;
511  dis.hwndItem = hwnd;
512  dis.hDC = hdc;
513  dis.itemData = 0;
514  GetClientRect( hwnd, &dis.rcItem );
515 
517  if (font) oldFont = SelectObject( hdc, font );
519  SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis );
520  if (font) SelectObject( hdc, oldFont );
521 }
522 
524 {
525  RECT rc;
526  HBRUSH hBrush;
527  HFONT hFont, hOldFont = NULL;
528  UINT format;
529  INT len, buf_size;
530  WCHAR *text;
531 
532  GetClientRect( hwnd, &rc);
533 
534  switch (style & SS_TYPEMASK)
535  {
536  case SS_LEFT:
538  break;
539 
540  case SS_CENTER:
542  break;
543 
544  case SS_RIGHT:
546  break;
547 
548  case SS_SIMPLE:
550  break;
551 
552  case SS_LEFTNOWORDWRAP:
554  break;
555 
556  default:
557  return;
558  }
559 
561  format = DT_RIGHT | (format & ~(DT_LEFT | DT_CENTER));
562 
563  if (style & SS_NOPREFIX)
564  format |= DT_NOPREFIX;
565 
566  if ((style & SS_TYPEMASK) != SS_SIMPLE)
567  {
568  if (style & SS_CENTERIMAGE)
570  if (style & SS_EDITCONTROL)
572  if (style & SS_ENDELLIPSIS)
574  if (style & SS_PATHELLIPSIS)
576  if (style & SS_WORDELLIPSIS)
578  }
579 
581  hOldFont = SelectObject( hdc, hFont );
582 
583  /* SS_SIMPLE controls: WM_CTLCOLORSTATIC is sent, but the returned
584  brush is not used */
586 
587  if ((style & SS_TYPEMASK) != SS_SIMPLE)
588  {
589  FillRect( hdc, &rc, hBrush );
591  }
592 
593  buf_size = 256;
594  if (!(text = HeapAlloc( GetProcessHeap(), 0, buf_size * sizeof(WCHAR) )))
595  goto no_TextOut;
596 
597  while ((len = InternalGetWindowText( hwnd, text, buf_size )) == buf_size - 1)
598  {
599  buf_size *= 2;
600  if (!(text = HeapReAlloc( GetProcessHeap(), 0, text, buf_size * sizeof(WCHAR) )))
601  goto no_TextOut;
602  }
603 
604  if (!len) goto no_TextOut;
605 
606  if (((style & SS_TYPEMASK) == SS_SIMPLE) && (style & SS_NOPREFIX))
607  {
608  /* Windows uses the faster ExtTextOut() to draw the text and
609  to paint the whole client rectangle with the text background
610  color. Reference: "Static Controls" by Kyle Marsh, 1992 */
612  &rc, text, len, NULL );
613  }
614  else
615  {
616  DrawTextW( hdc, text, -1, &rc, format );
617  }
618 
619 no_TextOut:
620  HeapFree( GetProcessHeap(), 0, text );
621 
622  if (hFont)
623  SelectObject( hdc, hOldFont );
624 }
625 
627 {
628  RECT rc;
629  HBRUSH hBrush;
630 
631  GetClientRect( hwnd, &rc);
632 
633  /* FIXME: send WM_CTLCOLORSTATIC */
634  switch (style & SS_TYPEMASK)
635  {
636  case SS_BLACKRECT:
638  FillRect( hdc, &rc, hBrush );
639  break;
640  case SS_GRAYRECT:
642  FillRect( hdc, &rc, hBrush );
643  break;
644  case SS_WHITERECT:
646  FillRect( hdc, &rc, hBrush );
647  break;
648  case SS_BLACKFRAME:
650  FrameRect( hdc, &rc, hBrush );
651  break;
652  case SS_GRAYFRAME:
654  FrameRect( hdc, &rc, hBrush );
655  break;
656  case SS_WHITEFRAME:
658  FrameRect( hdc, &rc, hBrush );
659  break;
660  default:
661  return;
662  }
663  DeleteObject( hBrush );
664 }
665 
666 
668 {
669  RECT rc, iconRect;
670  HBRUSH hbrush;
671  HICON hIcon;
672  SIZE size;
673 
674  GetClientRect( hwnd, &rc );
677  if (!hIcon || !get_icon_size( hIcon, &size ))
678  {
679  FillRect(hdc, &rc, hbrush);
680  }
681  else
682  {
683  if (style & SS_CENTERIMAGE)
684  {
685  iconRect.left = (rc.right - rc.left) / 2 - size.cx / 2;
686  iconRect.top = (rc.bottom - rc.top) / 2 - size.cy / 2;
687  iconRect.right = iconRect.left + size.cx;
688  iconRect.bottom = iconRect.top + size.cy;
689  }
690  else
691  iconRect = rc;
692  FillRect( hdc, &rc, hbrush );
693  DrawIconEx( hdc, iconRect.left, iconRect.top, hIcon, iconRect.right - iconRect.left,
694  iconRect.bottom - iconRect.top, 0, NULL, DI_NORMAL );
695  }
696 }
697 
699 {
700  HDC hMemDC;
701  HBITMAP hBitmap, oldbitmap;
702  HBRUSH hbrush;
703 
704  /* message is still sent, even if the returned brush is not used */
706 
709  && (hMemDC = CreateCompatibleDC( hdc )))
710  {
711  BITMAP bm;
712  RECT rcClient;
713  LOGBRUSH brush;
714 
715  GetObjectW(hBitmap, sizeof(bm), &bm);
716  oldbitmap = SelectObject(hMemDC, hBitmap);
717 
718  /* Set the background color for monochrome bitmaps
719  to the color of the background brush */
720  if (GetObjectW( hbrush, sizeof(brush), &brush ))
721  {
722  if (brush.lbStyle == BS_SOLID)
723  SetBkColor(hdc, brush.lbColor);
724  }
725  GetClientRect(hwnd, &rcClient);
726  if (style & SS_CENTERIMAGE)
727  {
728  FillRect( hdc, &rcClient, hbrush );
729  rcClient.left = (rcClient.right - rcClient.left)/2 - bm.bmWidth/2;
730  rcClient.top = (rcClient.bottom - rcClient.top)/2 - bm.bmHeight/2;
731  rcClient.right = rcClient.left + bm.bmWidth;
732  rcClient.bottom = rcClient.top + bm.bmHeight;
733  }
734  StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left,
735  rcClient.bottom - rcClient.top, hMemDC,
736  0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
737  SelectObject(hMemDC, oldbitmap);
738  DeleteDC(hMemDC);
739  }
740 }
741 
743 {
744  HENHMETAFILE hEnhMetaFile;
745  RECT rc;
746  HBRUSH hbrush;
747 
748  GetClientRect(hwnd, &rc);
750  FillRect(hdc, &rc, hbrush);
751  if ((hEnhMetaFile = (HENHMETAFILE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET )))
752  {
753  /* The control's current font is not selected into the
754  device context! */
755  if (GetObjectType(hEnhMetaFile) == OBJ_ENHMETAFILE)
756  PlayEnhMetaFile(hdc, hEnhMetaFile, &rc);
757  }
758 }
759 
761 {
762  RECT rc;
763 
764  /* FIXME: sometimes (not always) sends WM_CTLCOLORSTATIC */
765  GetClientRect( hwnd, &rc );
766  switch (style & SS_TYPEMASK)
767  {
768  case SS_ETCHEDHORZ:
770  break;
771  case SS_ETCHEDVERT:
773  break;
774  case SS_ETCHEDFRAME:
776  break;
777  }
778 }
779 
780 void STATIC_Register(void)
781 {
782  WNDCLASSW wndClass;
783 
784  memset(&wndClass, 0, sizeof(wndClass));
786  wndClass.lpfnWndProc = STATIC_WindowProc;
787  wndClass.cbClsExtra = 0;
788  wndClass.cbWndExtra = STATIC_EXTRA_BYTES;
789  wndClass.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
790  wndClass.hbrBackground = NULL;
791  wndClass.lpszClassName = WC_STATICW;
792  RegisterClassW(&wndClass);
793 }
794 
795 #ifdef __REACTOS__
796 void STATIC_Unregister(void)
797 {
799 }
800 #endif
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1674
static HBITMAP STATIC_SetBitmap(HWND hwnd, HBITMAP hBitmap, DWORD style)
Definition: static.c:151
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 DT_EXPANDTABS
Definition: winuser.h:532
#define SS_ENHMETAFILE
Definition: winuser.h:341
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define STM_SETICON
Definition: winuser.h:2053
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
static HICON
Definition: imagelist.c:84
#define HTTRANSPARENT
Definition: winuser.h:2427
#define TRUE
Definition: types.h:120
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
#define LR_SHARED
Definition: winuser.h:1090
static HANDLE STATIC_GetImage(HWND hwnd, WPARAM wParam, DWORD style)
Definition: static.c:206
#define IMAGE_ICON
Definition: winuser.h:212
static HBRUSH hbrush
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
UINT style
Definition: winuser.h:3129
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
static void STATIC_PaintEnhMetafn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:742
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
BOOL WINAPI IsWindow(_In_opt_ HWND)
UINT lbStyle
Definition: wingdi.h:1725
COLORREF clr3dShadow
Definition: comctl32.h:165
HDC WINAPI GetDC(_In_opt_ HWND)
Definition: mk_font.cpp:20
#define STN_ENABLE
Definition: winuser.h:2058
#define SS_BLACKRECT
Definition: pedump.c:696
const WCHAR * text
Definition: package.c:1827
#define SS_OWNERDRAW
Definition: winuser.h:352
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1748
#define IMAGE_CURSOR
Definition: winuser.h:213
#define DT_WORDBREAK
Definition: winuser.h:544
#define WARN(fmt,...)
Definition: debug.h:111
#define SS_TYPEMASK
Definition: winuser.h:362
#define HICON_GWL_OFFSET
Definition: static.c:60
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:27
#define SS_ETCHEDFRAME
Definition: winuser.h:342
#define BF_BOTTOM
Definition: winuser.h:457
#define SS_ENDELLIPSIS
Definition: statst2.c:8
LONG top
Definition: windef.h:292
ULONG_PTR itemData
Definition: winuser.h:3046
static const pfPaint staticPaintFunc[SS_TYPEMASK+1]
Definition: static.c:65
void STATIC_Register(void)
Definition: static.c:780
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
static void STATIC_PaintEtchedfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:760
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define GWL_EXSTYLE
Definition: winuser.h:845
int cbClsExtra
Definition: winuser.h:3131
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define WM_NCHITTEST
Definition: winuser.h:1668
COLORREF clr3dHilight
Definition: comctl32.h:164
UINT_PTR WPARAM
Definition: windef.h:207
#define DT_RIGHT
Definition: winuser.h:538
#define GetWindowLongPtrW
Definition: winuser.h:4698
LONG left
Definition: windef.h:291
#define SWP_NOZORDER
Definition: winuser.h:1232
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
LONG right
Definition: windef.h:293
#define DT_NOPREFIX
Definition: winuser.h:537
#define WS_EX_RIGHT
Definition: winuser.h:400
#define WM_NCCREATE
Definition: winuser.h:1665
static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:698
HRGN set_control_clipping(HDC hdc, const RECT *rect)
Definition: button.c:239
int32_t INT
Definition: typedefs.h:56
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
Definition: cursoricon.c:2014
DWORD WINAPI GetSysColor(_In_ int)
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 HFONT_GWL_OFFSET
Definition: static.c:59
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
#define SS_RIGHT
Definition: pedump.c:694
HFONT hFont
Definition: main.c:53
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define WM_ENABLE
Definition: winuser.h:1597
#define WM_PRINTCLIENT
Definition: richedit.h:70
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static VOID STATIC_TryPaintFcn(HWND hwnd, LONG full_style)
Definition: static.c:257
struct _test_info info[]
Definition: SetCursorPos.c:19
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define STN_DBLCLK
Definition: winuser.h:2056
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:975
#define DT_PATH_ELLIPSIS
Definition: winuser.h:530
#define SS_BITMAP
Definition: pedump.c:704
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define BF_RECT
Definition: winuser.h:462
#define SS_WORDELLIPSIS
Definition: winuser.h:365
uint32_t cs
Definition: isohybrid.c:75
HINSTANCE hInstance
Definition: charmap.c:20
#define OBJ_ENHMETAFILE
Definition: objidl.idl:1421
#define ETO_OPAQUE
Definition: wingdi.h:646
#define DT_LEFT
Definition: winuser.h:534
unsigned int BOOL
Definition: ntddk_ex.h:94
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
long LONG
Definition: pedump.c:60
COLORREF clr3dDkShadow
Definition: comctl32.h:166
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define IMAGE_ENHMETAFILE
Definition: winuser.h:214
static void STATIC_PaintTextfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:523
WNDPROC lpfnWndProc
Definition: winuser.h:3130
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define FIXME(fmt,...)
Definition: debug.h:110
#define SS_LEFT
Definition: pedump.c:692
#define SS_GRAYRECT
Definition: pedump.c:697
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define DT_END_ELLIPSIS
Definition: winuser.h:529
smooth NULL
Definition: ftsmooth.c:416
static HENHMETAFILE STATIC_SetEnhMetaFile(HWND hwnd, HENHMETAFILE hEnhMetaFile, DWORD style)
Definition: static.c:189
#define WM_GETFONT
Definition: winuser.h:1633
LPCWSTR lpszClassName
Definition: winuser.h:3138
LONG_PTR LPARAM
Definition: windef.h:208
#define SS_REALSIZECONTROL
Definition: winuser.h:353
BOOL WINAPI IsWindowEnabled(_In_ HWND)
#define ETO_CLIPPED
Definition: wingdi.h:647
static void STATIC_PaintRectfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:626
#define DT_VCENTER
Definition: winuser.h:543
#define WM_SETTEXT
Definition: winuser.h:1599
#define SS_GRAYFRAME
Definition: pedump.c:700
static LRESULT CALLBACK STATIC_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: static.c:314
static HBRUSH STATIC_SendWmCtlColorStatic(HWND hwnd, HDC hdc)
Definition: static.c:277
#define DT_WORD_ELLIPSIS
Definition: winuser.h:531
#define ODA_DRAWENTIRE
Definition: winuser.h:2496
#define SS_PATHELLIPSIS
Definition: winuser.h:364
static BOOL get_icon_size(HICON handle, SIZE *size)
Definition: static.c:88
#define SS_ETCHEDHORZ
Definition: winuser.h:343
#define SS_EDITCONTROL
Definition: winuser.h:340
#define SS_CENTER
Definition: pedump.c:693
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
#define SS_NOTIFY
Definition: winuser.h:351
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define STN_CLICKED
Definition: winuser.h:2055
r parent
Definition: btrfs.c:2659
int cbWndExtra
Definition: winuser.h:3132
__wchar_t WCHAR
Definition: xmlstorage.h:180
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:1997
#define ODS_DISABLED
Definition: winuser.h:2501
#define BF_RIGHT
Definition: winuser.h:456
#define SWP_NOACTIVATE
Definition: winuser.h:1227
#define RDW_ERASE
Definition: winuser.h:1197
BOOL WINAPI PlayEnhMetaFile(_In_ HDC, _In_ HENHMETAFILE, _In_ LPCRECT)
#define CS_GLOBALCLASS
Definition: winuser.h:647
#define WM_NCDESTROY
Definition: winuser.h:1666
#define ODT_STATIC
Definition: winuser.h:2495
COLORREF lbColor
Definition: wingdi.h:1726
unsigned long DWORD
Definition: ntddk_ex.h:95
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
static void STATIC_PaintIconfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:667
#define STN_DISABLE
Definition: winuser.h:2057
#define STM_GETICON
Definition: winuser.h:2051
#define EDGE_ETCHED
Definition: winuser.h:452
COMCTL32_SysColor comctl32_color
Definition: commctrl.c:82
BITMAP bmp
Definition: alphablend.c:62
#define WM_PAINT
Definition: winuser.h:1602
static BOOL hasTextStyle(DWORD style)
Definition: static.c:298
#define SS_REALSIZEIMAGE
Definition: winuser.h:354
int ret
#define COLOR_GRAYTEXT
Definition: winuser.h:922
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
WINE_DEFAULT_DEBUG_CHANNEL(static)
#define DI_NORMAL
Definition: wingdi.h:72
GLenum GLsizei len
Definition: glext.h:6722
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1754
#define SS_NOPREFIX
Definition: winuser.h:350
#define LRESULT
Definition: ole.h:14
#define CS_DBLCLKS
Definition: winuser.h:646
#define WM_COMMAND
Definition: winuser.h:1716
#define SS_BLACKFRAME
Definition: pedump.c:699
#define SS_CENTERIMAGE
Definition: winuser.h:339
HCURSOR hCursor
Definition: winuser.h:3135
#define ERR(fmt,...)
Definition: debug.h:109
#define GWL_STYLE
Definition: winuser.h:846
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:884
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define DT_SINGLELINE
Definition: winuser.h:540
HWND WINAPI GetParent(_In_ HWND)
#define SS_SIMPLE
Definition: pedump.c:702
BOOL WINAPI DeleteDC(_In_ HDC)
INT WINAPI InternalGetWindowText(_In_ HWND hWnd, _Out_writes_to_(cchMaxCount, return+1) LPWSTR pString, _In_ int cchMaxCount)
HICON hIcon
Definition: msconfig.c:44
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2132
#define RDW_ALLCHILDREN
Definition: winuser.h:1207
#define STATIC_EXTRA_BYTES
Definition: static.c:61
HBRUSH hbrBackground
Definition: winuser.h:3136
#define BF_TOP
Definition: winuser.h:455
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
Definition: bl.h:1331
#define HeapReAlloc
Definition: compat.h:393
#define STM_GETIMAGE
Definition: winuser.h:2052
#define SS_SUNKEN
Definition: winuser.h:358
#define SS_ETCHEDVERT
Definition: winuser.h:344
static HICON STATIC_LoadIconW(HINSTANCE hInstance, LPCWSTR name, DWORD style)
Definition: static.c:231
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
void(* pfPaint)(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:63
#define IMAGE_BITMAP
Definition: winuser.h:211
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
Definition: ObTypes.c:15
#define STM_SETIMAGE
Definition: winuser.h:2054
#define WM_SETFONT
Definition: winuser.h:1632
#define WC_STATICW
Definition: commctrl.h:4651
#define WM_DRAWITEM
Definition: winuser.h:1627
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define RDW_UPDATENOW
Definition: winuser.h:1206
#define IDC_ARROW
Definition: winuser.h:682
Definition: name.c:36
#define WM_CREATE
Definition: winuser.h:1590
GLenum GLuint id
Definition: glext.h:5579
static HICON STATIC_SetIcon(HWND hwnd, HICON hicon, DWORD style)
Definition: static.c:115
BOOL WINAPI IsWindowVisible(_In_ HWND)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
LONG bottom
Definition: windef.h:294
#define DT_CENTER
Definition: winuser.h:527
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SetWindowLongPtrW
Definition: winuser.h:5215
#define BS_SOLID
Definition: wingdi.h:1068
static HBITMAP
Definition: button.c:44
#define SS_WHITEFRAME
Definition: pedump.c:701
#define WM_ERASEBKGND
Definition: winuser.h:1607
#define HTCLIENT
Definition: winuser.h:2429
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LONG_PTR LRESULT
Definition: windef.h:209
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
Arabic default style
Definition: afstyles.h:93
#define memset(x, y, z)
Definition: compat.h:39
#define SS_ICON
Definition: pedump.c:695
#define SS_WHITERECT
Definition: pedump.c:698
#define WS_EX_STATICEDGE
Definition: winuser.h:403
static HBITMAP hBitmap
Definition: timezone.c:35
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN
Definition: commctrl.c:1586
#define OBJ_BITMAP
Definition: objidl.idl:1415
#define HeapFree(x, y, z)
Definition: compat.h:394
#define GWLP_ID
Definition: winuser.h:854
#define SRCCOPY
Definition: wingdi.h:332
#define DLGC_STATIC
Definition: winuser.h:2573
#define SS_LEFTNOWORDWRAP
Definition: pedump.c:703
#define CS_PARENTDC
Definition: winuser.h:651
#define DT_EDITCONTROL
Definition: winuser.h:528
#define RDW_INVALIDATE
Definition: winuser.h:1200
int WINAPI FrameRect(_In_ HDC, _In_ LPCRECT, _In_ HBRUSH)
#define WM_NCLBUTTONDBLCLK
Definition: winuser.h:1676
#define BF_LEFT
Definition: winuser.h:454
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:17
static void STATIC_PaintOwnerDrawfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:500