ReactOS  0.4.15-dev-1201-gb2cf5a4
static.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "commctrl.h"
#include "wine/debug.h"
#include "comctl32.h"
Include dependency graph for static.c:

Go to the source code of this file.

Macros

#define HFONT_GWL_OFFSET   0
 
#define HICON_GWL_OFFSET   (sizeof(HFONT))
 
#define STATIC_EXTRA_BYTES   (HICON_GWL_OFFSET + sizeof(HICON))
 

Typedefs

typedef void(* pfPaint) (HWND hwnd, HDC hdc, DWORD style)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (static)
 
static void STATIC_PaintOwnerDrawfn (HWND hwnd, HDC hdc, DWORD style)
 
static void STATIC_PaintTextfn (HWND hwnd, HDC hdc, DWORD style)
 
static void STATIC_PaintRectfn (HWND hwnd, HDC hdc, DWORD style)
 
static void STATIC_PaintIconfn (HWND hwnd, HDC hdc, DWORD style)
 
static void STATIC_PaintBitmapfn (HWND hwnd, HDC hdc, DWORD style)
 
static void STATIC_PaintEnhMetafn (HWND hwnd, HDC hdc, DWORD style)
 
static void STATIC_PaintEtchedfn (HWND hwnd, HDC hdc, DWORD style)
 
static BOOL get_icon_size (HICON handle, SIZE *size)
 
static HICON STATIC_SetIcon (HWND hwnd, HICON hicon, DWORD style)
 
static HBITMAP STATIC_SetBitmap (HWND hwnd, HBITMAP hBitmap, DWORD style)
 
static HENHMETAFILE STATIC_SetEnhMetaFile (HWND hwnd, HENHMETAFILE hEnhMetaFile, DWORD style)
 
static HANDLE STATIC_GetImage (HWND hwnd, WPARAM wParam, DWORD style)
 
static HICON STATIC_LoadIconW (HINSTANCE hInstance, LPCWSTR name, DWORD style)
 
static VOID STATIC_TryPaintFcn (HWND hwnd, LONG full_style)
 
static HBRUSH STATIC_SendWmCtlColorStatic (HWND hwnd, HDC hdc)
 
static BOOL hasTextStyle (DWORD style)
 
static LRESULT CALLBACK STATIC_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void STATIC_Register (void)
 

Variables

static const pfPaint staticPaintFunc [SS_TYPEMASK+1]
 

Macro Definition Documentation

◆ HFONT_GWL_OFFSET

#define HFONT_GWL_OFFSET   0

Definition at line 59 of file static.c.

◆ HICON_GWL_OFFSET

#define HICON_GWL_OFFSET   (sizeof(HFONT))

Definition at line 60 of file static.c.

◆ STATIC_EXTRA_BYTES

#define STATIC_EXTRA_BYTES   (HICON_GWL_OFFSET + sizeof(HICON))

Definition at line 61 of file static.c.

Typedef Documentation

◆ pfPaint

typedef void(* pfPaint) (HWND hwnd, HDC hdc, DWORD style)

Definition at line 63 of file static.c.

Function Documentation

◆ get_icon_size()

static BOOL get_icon_size ( HICON  handle,
SIZE size 
)
static

Definition at line 88 of file static.c.

89 {
90  ICONINFO info;
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 }
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
Definition: cursoricon.c:2014
struct _test_info info[]
Definition: SetCursorPos.c:19
#define FALSE
Definition: types.h:117
GLsizeiptr size
Definition: glext.h:5919
BITMAP bmp
Definition: alphablend.c:62
int ret
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
Definition: bl.h:1331

Referenced by IntDrawState(), STATIC_PaintIconfn(), and STATIC_SetIcon().

◆ hasTextStyle()

static BOOL hasTextStyle ( DWORD  style)
static

Definition at line 311 of file static.c.

312 {
313  switch (style & SS_TYPEMASK)
314  {
315  case SS_SIMPLE:
316  case SS_LEFT:
317  case SS_LEFTNOWORDWRAP:
318  case SS_CENTER:
319  case SS_RIGHT:
320  case SS_OWNERDRAW:
321  return TRUE;
322  }
323 
324  return FALSE;
325 }
#define TRUE
Definition: types.h:120
#define SS_OWNERDRAW
Definition: winuser.h:352
#define SS_TYPEMASK
Definition: winuser.h:362
#define SS_RIGHT
Definition: pedump.c:694
#define FALSE
Definition: types.h:117
#define SS_LEFT
Definition: pedump.c:692
#define SS_CENTER
Definition: pedump.c:693
#define SS_SIMPLE
Definition: pedump.c:702
Arabic default style
Definition: afstyles.h:93
#define SS_LEFTNOWORDWRAP
Definition: pedump.c:703

Referenced by STATIC_WindowProc().

◆ STATIC_GetImage()

static HANDLE STATIC_GetImage ( HWND  hwnd,
WPARAM  wParam,
DWORD  style 
)
static

Definition at line 219 of file static.c.

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 }
#define SS_ENHMETAFILE
Definition: winuser.h:341
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IMAGE_ICON
Definition: winuser.h:212
#define IMAGE_CURSOR
Definition: winuser.h:213
#define SS_TYPEMASK
Definition: winuser.h:362
#define HICON_GWL_OFFSET
Definition: static.c:60
#define GetWindowLongPtrW
Definition: winuser.h:4804
WPARAM wParam
Definition: combotst.c:138
#define SS_BITMAP
Definition: pedump.c:704
#define IMAGE_ENHMETAFILE
Definition: winuser.h:214
smooth NULL
Definition: ftsmooth.c:416
#define IMAGE_BITMAP
Definition: winuser.h:211
Arabic default style
Definition: afstyles.h:93
#define SS_ICON
Definition: pedump.c:695

Referenced by STATIC_WindowProc().

◆ STATIC_LoadIconW()

static HICON STATIC_LoadIconW ( HINSTANCE  hInstance,
LPCWSTR  name,
DWORD  style 
)
static

Definition at line 244 of file static.c.

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 }
static HICON
Definition: imagelist.c:84
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
uint32_t ULONG_PTR
Definition: typedefs.h:65
HINSTANCE hInstance
Definition: charmap.c:20
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define SS_REALSIZEIMAGE
Definition: winuser.h:354
Definition: name.c:38
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
Arabic default style
Definition: afstyles.h:93

Referenced by STATIC_WindowProc().

◆ STATIC_PaintBitmapfn()

static void STATIC_PaintBitmapfn ( HWND  hwnd,
HDC  hdc,
DWORD  style 
)
static

Definition at line 711 of file static.c.

712 {
713  HDC hMemDC;
714  HBITMAP hBitmap, oldbitmap;
715  HBRUSH hbrush;
716 
717  /* message is still sent, even if the returned brush is not used */
719 
722  && (hMemDC = CreateCompatibleDC( hdc )))
723  {
724  BITMAP bm;
725  RECT rcClient;
726  LOGBRUSH brush;
727 
728  GetObjectW(hBitmap, sizeof(bm), &bm);
729  oldbitmap = SelectObject(hMemDC, hBitmap);
730 
731  /* Set the background color for monochrome bitmaps
732  to the color of the background brush */
733  if (GetObjectW( hbrush, sizeof(brush), &brush ))
734  {
735  if (brush.lbStyle == BS_SOLID)
736  SetBkColor(hdc, brush.lbColor);
737  }
738  GetClientRect(hwnd, &rcClient);
739  if (style & SS_CENTERIMAGE)
740  {
741  FillRect( hdc, &rcClient, hbrush );
742  rcClient.left = (rcClient.right - rcClient.left)/2 - bm.bmWidth/2;
743  rcClient.top = (rcClient.bottom - rcClient.top)/2 - bm.bmHeight/2;
744  rcClient.right = rcClient.left + bm.bmWidth;
745  rcClient.bottom = rcClient.top + bm.bmHeight;
746  }
747  StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left,
748  rcClient.bottom - rcClient.top, hMemDC,
749  0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
750  SelectObject(hMemDC, oldbitmap);
751  DeleteDC(hMemDC);
752  }
753 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HBRUSH hbrush
UINT lbStyle
Definition: wingdi.h:1746
#define HICON_GWL_OFFSET
Definition: static.c:60
static HDC
Definition: imagelist.c:92
LONG top
Definition: windef.h:307
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define GetWindowLongPtrW
Definition: winuser.h:4804
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
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)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:977
static HBRUSH STATIC_SendWmCtlColorStatic(HWND hwnd, HDC hdc)
Definition: static.c:290
COLORREF lbColor
Definition: wingdi.h:1747
HDC hdc
Definition: main.c:9
#define SS_CENTERIMAGE
Definition: winuser.h:339
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI DeleteDC(_In_ HDC)
Definition: bl.h:1331
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
Definition: ObTypes.c:15
LONG bottom
Definition: windef.h:309
#define BS_SOLID
Definition: wingdi.h:1085
static HBITMAP
Definition: button.c:44
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
Arabic default style
Definition: afstyles.h:93
static HBITMAP hBitmap
Definition: timezone.c:26
#define OBJ_BITMAP
Definition: objidl.idl:1415
#define SRCCOPY
Definition: wingdi.h:332

◆ STATIC_PaintEnhMetafn()

static void STATIC_PaintEnhMetafn ( HWND  hwnd,
HDC  hdc,
DWORD  style 
)
static

Definition at line 755 of file static.c.

756 {
757  HENHMETAFILE hEnhMetaFile;
758  RECT rc;
759  HBRUSH hbrush;
760 
761  GetClientRect(hwnd, &rc);
763  FillRect(hdc, &rc, hbrush);
764  if ((hEnhMetaFile = (HENHMETAFILE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET )))
765  {
766  /* The control's current font is not selected into the
767  device context! */
768  if (GetObjectType(hEnhMetaFile) == OBJ_ENHMETAFILE)
769  PlayEnhMetaFile(hdc, hEnhMetaFile, &rc);
770  }
771 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HBRUSH hbrush
#define HICON_GWL_OFFSET
Definition: static.c:60
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define OBJ_ENHMETAFILE
Definition: objidl.idl:1421
static HBRUSH STATIC_SendWmCtlColorStatic(HWND hwnd, HDC hdc)
Definition: static.c:290
BOOL WINAPI PlayEnhMetaFile(_In_ HDC, _In_ HENHMETAFILE, _In_ LPCRECT)
HDC hdc
Definition: main.c:9
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
Definition: ObTypes.c:15
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)

◆ STATIC_PaintEtchedfn()

static void STATIC_PaintEtchedfn ( HWND  hwnd,
HDC  hdc,
DWORD  style 
)
static

Definition at line 773 of file static.c.

774 {
775  RECT rc;
776 
777  /* FIXME: sometimes (not always) sends WM_CTLCOLORSTATIC */
778  GetClientRect( hwnd, &rc );
779  switch (style & SS_TYPEMASK)
780  {
781  case SS_ETCHEDHORZ:
783  break;
784  case SS_ETCHEDVERT:
786  break;
787  case SS_ETCHEDFRAME:
789  break;
790  }
791 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define SS_TYPEMASK
Definition: winuser.h:362
#define SS_ETCHEDFRAME
Definition: winuser.h:342
#define BF_BOTTOM
Definition: winuser.h:457
#define BF_RECT
Definition: winuser.h:462
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define SS_ETCHEDHORZ
Definition: winuser.h:343
#define BF_RIGHT
Definition: winuser.h:456
#define EDGE_ETCHED
Definition: winuser.h:452
HDC hdc
Definition: main.c:9
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define BF_TOP
Definition: winuser.h:455
#define SS_ETCHEDVERT
Definition: winuser.h:344
Arabic default style
Definition: afstyles.h:93
#define BF_LEFT
Definition: winuser.h:454

◆ STATIC_PaintIconfn()

static void STATIC_PaintIconfn ( HWND  hwnd,
HDC  hdc,
DWORD  style 
)
static

Definition at line 680 of file static.c.

681 {
682  RECT rc, iconRect;
683  HBRUSH hbrush;
684  HICON hIcon;
685  SIZE size;
686 
687  GetClientRect( hwnd, &rc );
690  if (!hIcon || !get_icon_size( hIcon, &size ))
691  {
692  FillRect(hdc, &rc, hbrush);
693  }
694  else
695  {
696  if (style & SS_CENTERIMAGE)
697  {
698  iconRect.left = (rc.right - rc.left) / 2 - size.cx / 2;
699  iconRect.top = (rc.bottom - rc.top) / 2 - size.cy / 2;
700  iconRect.right = iconRect.left + size.cx;
701  iconRect.bottom = iconRect.top + size.cy;
702  }
703  else
704  iconRect = rc;
705  FillRect( hdc, &rc, hbrush );
706  DrawIconEx( hdc, iconRect.left, iconRect.top, hIcon, iconRect.right - iconRect.left,
707  iconRect.bottom - iconRect.top, 0, NULL, DI_NORMAL );
708  }
709 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HICON
Definition: imagelist.c:84
static HBRUSH hbrush
#define HICON_GWL_OFFSET
Definition: static.c:60
LONG top
Definition: windef.h:307
#define GetWindowLongPtrW
Definition: winuser.h:4804
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
smooth NULL
Definition: ftsmooth.c:416
static HBRUSH STATIC_SendWmCtlColorStatic(HWND hwnd, HDC hdc)
Definition: static.c:290
static BOOL get_icon_size(HICON handle, SIZE *size)
Definition: static.c:88
GLsizeiptr size
Definition: glext.h:5919
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
HDC hdc
Definition: main.c:9
#define DI_NORMAL
Definition: wingdi.h:72
#define SS_CENTERIMAGE
Definition: winuser.h:339
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HICON hIcon
Definition: msconfig.c:44
LONG bottom
Definition: windef.h:309
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
Arabic default style
Definition: afstyles.h:93

◆ STATIC_PaintOwnerDrawfn()

static void STATIC_PaintOwnerDrawfn ( HWND  hwnd,
HDC  hdc,
DWORD  style 
)
static

Definition at line 513 of file static.c.

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 );
532  SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis );
533  if (font) SelectObject( hdc, oldFont );
534 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: mk_font.cpp:20
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1754
ULONG_PTR itemData
Definition: winuser.h:3068
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define HFONT_GWL_OFFSET
Definition: static.c:59
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI IsWindowEnabled(_In_ HWND)
#define ODA_DRAWENTIRE
Definition: winuser.h:2517
#define ODS_DISABLED
Definition: winuser.h:2522
#define ODT_STATIC
Definition: winuser.h:2516
HDC hdc
Definition: main.c:9
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned int UINT
Definition: ndis.h:50
#define WM_DRAWITEM
Definition: winuser.h:1627
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
GLenum GLuint id
Definition: glext.h:5579
#define GWLP_ID
Definition: winuser.h:854

◆ STATIC_PaintRectfn()

static void STATIC_PaintRectfn ( HWND  hwnd,
HDC  hdc,
DWORD  style 
)
static

Definition at line 639 of file static.c.

640 {
641  RECT rc;
642  HBRUSH hBrush;
643 
644  GetClientRect( hwnd, &rc);
645 
646  /* FIXME: send WM_CTLCOLORSTATIC */
647  switch (style & SS_TYPEMASK)
648  {
649  case SS_BLACKRECT:
651  FillRect( hdc, &rc, hBrush );
652  break;
653  case SS_GRAYRECT:
655  FillRect( hdc, &rc, hBrush );
656  break;
657  case SS_WHITERECT:
659  FillRect( hdc, &rc, hBrush );
660  break;
661  case SS_BLACKFRAME:
663  FrameRect( hdc, &rc, hBrush );
664  break;
665  case SS_GRAYFRAME:
667  FrameRect( hdc, &rc, hBrush );
668  break;
669  case SS_WHITEFRAME:
671  FrameRect( hdc, &rc, hBrush );
672  break;
673  default:
674  return;
675  }
676  DeleteObject( hBrush );
677 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
COLORREF clr3dShadow
Definition: comctl32.h:166
#define SS_BLACKRECT
Definition: pedump.c:696
#define SS_TYPEMASK
Definition: winuser.h:362
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
COLORREF clr3dHilight
Definition: comctl32.h:165
COLORREF clr3dDkShadow
Definition: comctl32.h:167
#define SS_GRAYRECT
Definition: pedump.c:697
#define SS_GRAYFRAME
Definition: pedump.c:700
COMCTL32_SysColor comctl32_color
Definition: commctrl.c:82
HDC hdc
Definition: main.c:9
#define SS_BLACKFRAME
Definition: pedump.c:699
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define SS_WHITEFRAME
Definition: pedump.c:701
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
Arabic default style
Definition: afstyles.h:93
#define SS_WHITERECT
Definition: pedump.c:698
int WINAPI FrameRect(_In_ HDC, _In_ LPCRECT, _In_ HBRUSH)

◆ STATIC_PaintTextfn()

static void STATIC_PaintTextfn ( HWND  hwnd,
HDC  hdc,
DWORD  style 
)
static

Definition at line 536 of file static.c.

537 {
538  RECT rc;
539  HBRUSH hBrush;
540  HFONT hFont, hOldFont = NULL;
541  UINT format;
542  INT len, buf_size;
543  WCHAR *text;
544 
545  GetClientRect( hwnd, &rc);
546 
547  switch (style & SS_TYPEMASK)
548  {
549  case SS_LEFT:
551  break;
552 
553  case SS_CENTER:
555  break;
556 
557  case SS_RIGHT:
559  break;
560 
561  case SS_SIMPLE:
563  break;
564 
565  case SS_LEFTNOWORDWRAP:
567  break;
568 
569  default:
570  return;
571  }
572 
574  format = DT_RIGHT | (format & ~(DT_LEFT | DT_CENTER));
575 
576  if (style & SS_NOPREFIX)
577  format |= DT_NOPREFIX;
578 
579  if ((style & SS_TYPEMASK) != SS_SIMPLE)
580  {
581  if (style & SS_CENTERIMAGE)
583  if (style & SS_EDITCONTROL)
585  if (style & SS_ENDELLIPSIS)
587  if (style & SS_PATHELLIPSIS)
589  if (style & SS_WORDELLIPSIS)
591  }
592 
594  hOldFont = SelectObject( hdc, hFont );
595 
596  /* SS_SIMPLE controls: WM_CTLCOLORSTATIC is sent, but the returned
597  brush is not used */
599 
600  if ((style & SS_TYPEMASK) != SS_SIMPLE)
601  {
602  FillRect( hdc, &rc, hBrush );
604  }
605 
606  buf_size = 256;
607  if (!(text = HeapAlloc( GetProcessHeap(), 0, buf_size * sizeof(WCHAR) )))
608  goto no_TextOut;
609 
610  while ((len = InternalGetWindowText( hwnd, text, buf_size )) == buf_size - 1)
611  {
612  buf_size *= 2;
613  if (!(text = HeapReAlloc( GetProcessHeap(), 0, text, buf_size * sizeof(WCHAR) )))
614  goto no_TextOut;
615  }
616 
617  if (!len) goto no_TextOut;
618 
619  if (((style & SS_TYPEMASK) == SS_SIMPLE) && (style & SS_NOPREFIX))
620  {
621  /* Windows uses the faster ExtTextOut() to draw the text and
622  to paint the whole client rectangle with the text background
623  color. Reference: "Static Controls" by Kyle Marsh, 1992 */
625  &rc, text, len, NULL );
626  }
627  else
628  {
629  DrawTextW( hdc, text, -1, &rc, format );
630  }
631 
632 no_TextOut:
633  HeapFree( GetProcessHeap(), 0, text );
634 
635  if (hFont)
636  SelectObject( hdc, hOldFont );
637 }
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
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
const WCHAR * text
Definition: package.c:1827
#define DT_WORDBREAK
Definition: winuser.h:544
#define SS_TYPEMASK
Definition: winuser.h:362
#define SS_ENDELLIPSIS
Definition: statst2.c:8
LONG top
Definition: windef.h:307
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
#define GWL_EXSTYLE
Definition: winuser.h:845
#define DT_RIGHT
Definition: winuser.h:538
#define GetWindowLongPtrW
Definition: winuser.h:4804
LONG left
Definition: windef.h:306
#define DT_NOPREFIX
Definition: winuser.h:537
#define WS_EX_RIGHT
Definition: winuser.h:400
int32_t INT
Definition: typedefs.h:58
DWORD WINAPI GetSysColor(_In_ int)
#define HFONT_GWL_OFFSET
Definition: static.c:59
#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 DT_PATH_ELLIPSIS
Definition: winuser.h:530
#define SS_WORDELLIPSIS
Definition: winuser.h:365
#define ETO_OPAQUE
Definition: wingdi.h:646
#define DT_LEFT
Definition: winuser.h:534
#define SS_LEFT
Definition: pedump.c:692
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define DT_END_ELLIPSIS
Definition: winuser.h:529
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI IsWindowEnabled(_In_ HWND)
#define ETO_CLIPPED
Definition: wingdi.h:647
#define DT_VCENTER
Definition: winuser.h:543
static HBRUSH STATIC_SendWmCtlColorStatic(HWND hwnd, HDC hdc)
Definition: static.c:290
#define DT_WORD_ELLIPSIS
Definition: winuser.h:531
#define SS_PATHELLIPSIS
Definition: winuser.h:364
#define SS_EDITCONTROL
Definition: winuser.h:340
#define SS_CENTER
Definition: pedump.c:693
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define COLOR_GRAYTEXT
Definition: winuser.h:922
HDC hdc
Definition: main.c:9
GLenum GLsizei len
Definition: glext.h:6722
#define SS_NOPREFIX
Definition: winuser.h:350
#define SS_CENTERIMAGE
Definition: winuser.h:339
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:888
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define DT_SINGLELINE
Definition: winuser.h:540
#define SS_SIMPLE
Definition: pedump.c:702
INT WINAPI InternalGetWindowText(_In_ HWND hWnd, _Out_writes_to_(cchMaxCount, return+1) LPWSTR pString, _In_ int cchMaxCount)
#define HeapReAlloc
Definition: compat.h:593
unsigned int UINT
Definition: ndis.h:50
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define DT_CENTER
Definition: winuser.h:527
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
Arabic default style
Definition: afstyles.h:93
#define HeapFree(x, y, z)
Definition: compat.h:594
#define SS_LEFTNOWORDWRAP
Definition: pedump.c:703
#define DT_EDITCONTROL
Definition: winuser.h:528
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:17

◆ STATIC_Register()

void STATIC_Register ( void  )

Definition at line 793 of file static.c.

794 {
795  WNDCLASSW wndClass;
796 
797  memset(&wndClass, 0, sizeof(wndClass));
799  wndClass.lpfnWndProc = STATIC_WindowProc;
800  wndClass.cbClsExtra = 0;
801  wndClass.cbWndExtra = STATIC_EXTRA_BYTES;
802  wndClass.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
803  wndClass.hbrBackground = NULL;
804  wndClass.lpszClassName = WC_STATICW;
805  RegisterClassW(&wndClass);
806 }
UINT style
Definition: winuser.h:3151
int cbClsExtra
Definition: winuser.h:3153
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
WNDPROC lpfnWndProc
Definition: winuser.h:3152
smooth NULL
Definition: ftsmooth.c:416
LPCWSTR lpszClassName
Definition: winuser.h:3160
static LRESULT CALLBACK STATIC_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: static.c:327
int cbWndExtra
Definition: winuser.h:3154
#define CS_GLOBALCLASS
Definition: winuser.h:647
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define CS_DBLCLKS
Definition: winuser.h:646
HCURSOR hCursor
Definition: winuser.h:3157
#define STATIC_EXTRA_BYTES
Definition: static.c:61
HBRUSH hbrBackground
Definition: winuser.h:3158
#define WC_STATICW
Definition: commctrl.h:4676
#define IDC_ARROW
Definition: winuser.h:682
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define memset(x, y, z)
Definition: compat.h:39
#define CS_PARENTDC
Definition: winuser.h:651

Referenced by DllMain().

◆ STATIC_SendWmCtlColorStatic()

static HBRUSH STATIC_SendWmCtlColorStatic ( HWND  hwnd,
HDC  hdc 
)
static

Definition at line 290 of file static.c.

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 */
301  hBrush = (HBRUSH)DefWindowProcW( parent, WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd);
302  }
303  return hBrush;
304 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1754
UINT_PTR WPARAM
Definition: windef.h:207
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG_PTR LPARAM
Definition: windef.h:208
r parent
Definition: btrfs.c:2944
HDC hdc
Definition: main.c:9
HWND WINAPI GetParent(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by STATIC_PaintBitmapfn(), STATIC_PaintEnhMetafn(), STATIC_PaintIconfn(), and STATIC_PaintTextfn().

◆ STATIC_SetBitmap()

static HBITMAP STATIC_SetBitmap ( HWND  hwnd,
HBITMAP  hBitmap,
DWORD  style 
)
static

Definition at line 164 of file static.c.

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 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WARN(fmt,...)
Definition: debug.h:112
#define SS_TYPEMASK
Definition: winuser.h:362
#define HICON_GWL_OFFSET
Definition: static.c:60
#define SWP_NOZORDER
Definition: winuser.h:1232
#define SS_BITMAP
Definition: pedump.c:704
#define SS_REALSIZECONTROL
Definition: winuser.h:353
#define SWP_NOACTIVATE
Definition: winuser.h:1227
#define SS_CENTERIMAGE
Definition: winuser.h:339
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
Definition: bl.h:1331
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
Definition: ObTypes.c:15
#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:5321
static HBITMAP
Definition: button.c:44
Arabic default style
Definition: afstyles.h:93
static HBITMAP hBitmap
Definition: timezone.c:26
#define OBJ_BITMAP
Definition: objidl.idl:1415

Referenced by STATIC_WindowProc().

◆ STATIC_SetEnhMetaFile()

static HENHMETAFILE STATIC_SetEnhMetaFile ( HWND  hwnd,
HENHMETAFILE  hEnhMetaFile,
DWORD  style 
)
static

Definition at line 202 of file static.c.

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 }
#define SS_ENHMETAFILE
Definition: winuser.h:341
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WARN(fmt,...)
Definition: debug.h:112
#define SS_TYPEMASK
Definition: winuser.h:362
#define HICON_GWL_OFFSET
Definition: static.c:60
#define OBJ_ENHMETAFILE
Definition: objidl.idl:1421
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
Definition: ObTypes.c:15
#define SetWindowLongPtrW
Definition: winuser.h:5321
Arabic default style
Definition: afstyles.h:93

Referenced by STATIC_WindowProc().

◆ STATIC_SetIcon()

static HICON STATIC_SetIcon ( HWND  hwnd,
HICON  hicon,
DWORD  style 
)
static

Definition at line 128 of file static.c.

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 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HICON
Definition: imagelist.c:84
#define WARN(fmt,...)
Definition: debug.h:112
#define SS_TYPEMASK
Definition: winuser.h:362
#define HICON_GWL_OFFSET
Definition: static.c:60
#define SWP_NOZORDER
Definition: winuser.h:1232
#define SS_REALSIZECONTROL
Definition: winuser.h:353
static BOOL get_icon_size(HICON handle, SIZE *size)
Definition: static.c:88
GLsizeiptr size
Definition: glext.h:5919
#define SWP_NOACTIVATE
Definition: winuser.h:1227
#define SS_CENTERIMAGE
Definition: winuser.h:339
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#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:5321
Arabic default style
Definition: afstyles.h:93
#define SS_ICON
Definition: pedump.c:695

Referenced by STATIC_WindowProc().

◆ STATIC_TryPaintFcn()

static VOID STATIC_TryPaintFcn ( HWND  hwnd,
LONG  full_style 
)
static

Definition at line 270 of file static.c.

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 );
284  SelectClipRgn( hdc, hrgn );
285  if (hrgn) DeleteObject( hrgn );
286  ReleaseDC( hwnd, hdc );
287  }
288 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
HDC WINAPI GetDC(_In_opt_ HWND)
#define SS_TYPEMASK
Definition: winuser.h:362
static HDC
Definition: imagelist.c:92
static const pfPaint staticPaintFunc[SS_TYPEMASK+1]
Definition: static.c:65
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HRGN set_control_clipping(HDC hdc, const RECT *rect)
Definition: button.c:239
long LONG
Definition: pedump.c:60
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI IsWindowVisible(_In_ HWND)
Arabic default style
Definition: afstyles.h:93

Referenced by STATIC_WindowProc().

◆ STATIC_WindowProc()

static LRESULT CALLBACK STATIC_WindowProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 327 of file static.c.

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);
371  GetClientRect( hwnd, &rect );
372  if (staticPaintFunc[style])
373  {
374  HRGN hrgn = set_control_clipping( hdc, &rect );
375  (staticPaintFunc[style])( hwnd, hdc, full_style );
376  SelectClipRgn( hdc, hrgn );
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 
396  case WM_SYSCOLORCHANGE:
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:
470  case WM_NCLBUTTONDBLCLK:
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;
488  case IMAGE_ENHMETAFILE:
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 }
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1674
static HBITMAP STATIC_SetBitmap(HWND hwnd, HBITMAP hBitmap, DWORD style)
Definition: static.c:164
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define STM_SETICON
Definition: winuser.h:2074
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:2448
#define MAKEWPARAM(l, h)
Definition: winuser.h:3984
static HANDLE STATIC_GetImage(HWND hwnd, WPARAM wParam, DWORD style)
Definition: static.c:219
#define IMAGE_ICON
Definition: winuser.h:212
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define STN_ENABLE
Definition: winuser.h:2079
#define IMAGE_CURSOR
Definition: winuser.h:213
#define SS_TYPEMASK
Definition: winuser.h:362
static HDC
Definition: imagelist.c:92
static const pfPaint staticPaintFunc[SS_TYPEMASK+1]
Definition: static.c:65
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define GWL_EXSTYLE
Definition: winuser.h:845
#define WM_NCHITTEST
Definition: winuser.h:1668
#define GetWindowLongPtrW
Definition: winuser.h:4804
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define WM_NCCREATE
Definition: winuser.h:1665
HRGN set_control_clipping(HDC hdc, const RECT *rect)
Definition: button.c:239
#define HFONT_GWL_OFFSET
Definition: static.c:59
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
#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:270
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define STN_DBLCLK
Definition: winuser.h:2077
#define SS_BITMAP
Definition: pedump.c:704
uint32_t cs
Definition: isohybrid.c:75
long LONG
Definition: pedump.c:60
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define IMAGE_ENHMETAFILE
Definition: winuser.h:214
#define FIXME(fmt,...)
Definition: debug.h:111
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
smooth NULL
Definition: ftsmooth.c:416
static HENHMETAFILE STATIC_SetEnhMetaFile(HWND hwnd, HENHMETAFILE hEnhMetaFile, DWORD style)
Definition: static.c:202
#define WM_GETFONT
Definition: winuser.h:1633
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_SETTEXT
Definition: winuser.h:1599
#define SS_NOTIFY
Definition: winuser.h:351
#define STN_CLICKED
Definition: winuser.h:2076
#define RDW_ERASE
Definition: winuser.h:1197
#define WM_NCDESTROY
Definition: winuser.h:1666
#define STN_DISABLE
Definition: winuser.h:2078
#define STM_GETICON
Definition: winuser.h:2072
#define WM_PAINT
Definition: winuser.h:1602
static BOOL hasTextStyle(DWORD style)
Definition: static.c:311
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1760
#define LRESULT
Definition: ole.h:14
#define WM_COMMAND
Definition: winuser.h:1722
#define ERR(fmt,...)
Definition: debug.h:110
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
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
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define STM_GETIMAGE
Definition: winuser.h:2073
#define SS_SUNKEN
Definition: winuser.h:358
static HICON STATIC_LoadIconW(HINSTANCE hInstance, LPCWSTR name, DWORD style)
Definition: static.c:244
#define IMAGE_BITMAP
Definition: winuser.h:211
#define STM_SETIMAGE
Definition: winuser.h:2075
#define WM_SETFONT
Definition: winuser.h:1632
#define RDW_UPDATENOW
Definition: winuser.h:1206
#define WM_CREATE
Definition: winuser.h:1590
static HICON STATIC_SetIcon(HWND hwnd, HICON hicon, DWORD style)
Definition: static.c:128
#define SetWindowLongPtrW
Definition: winuser.h:5321
static HBITMAP
Definition: button.c:44
#define WM_ERASEBKGND
Definition: winuser.h:1607
#define HTCLIENT
Definition: winuser.h:2450
LONG_PTR LRESULT
Definition: windef.h:209
Arabic default style
Definition: afstyles.h:93
#define SS_ICON
Definition: pedump.c:695
#define WS_EX_STATICEDGE
Definition: winuser.h:403
static HBITMAP hBitmap
Definition: timezone.c:26
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN
Definition: commctrl.c:1586
#define GWLP_ID
Definition: winuser.h:854
#define DLGC_STATIC
Definition: winuser.h:2594
#define RDW_INVALIDATE
Definition: winuser.h:1200
#define WM_NCLBUTTONDBLCLK
Definition: winuser.h:1676

Referenced by STATIC_Register().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( static  )

Variable Documentation

◆ staticPaintFunc

const pfPaint staticPaintFunc[SS_TYPEMASK+1]
static
Initial value:
=
{
NULL,
}
static void STATIC_PaintEnhMetafn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:755
static void STATIC_PaintEtchedfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:773
static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:711
static void STATIC_PaintTextfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:536
smooth NULL
Definition: ftsmooth.c:416
static void STATIC_PaintRectfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:639
static void STATIC_PaintIconfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:680
static void STATIC_PaintOwnerDrawfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:513

Definition at line 65 of file static.c.

Referenced by STATIC_TryPaintFcn(), and STATIC_WindowProc().