ReactOS  0.4.15-dev-499-g1f31905
static.c File Reference
#include <user32.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 UISTATE_GWL_OFFSET   (HICON_GWL_OFFSET+sizeof(HICON))
 
#define STATIC_EXTRA_BYTES   (UISTATE_GWL_OFFSET + sizeof(LONG))
 

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 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_LoadIconA (HINSTANCE hInstance, LPCSTR name, 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 VOID STATIC_InitColours (void)
 
static BOOL hasTextStyle (DWORD style)
 
LRESULT WINAPI StaticWndProc_common (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
 
LRESULT WINAPI StaticWndProcA (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI StaticWndProcW (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

static COLORREF color_3dshadow
 
static COLORREF color_3ddkshadow
 
static COLORREF color_3dhighlight
 
static const pfPaint staticPaintFunc [SS_TYPEMASK+1]
 
static const WCHAR staticW [] = {'S','t','a','t','i','c',0}
 
const struct builtin_class_descr STATIC_builtin_class
 

Macro Definition Documentation

◆ HFONT_GWL_OFFSET

#define HFONT_GWL_OFFSET   0

Definition at line 46 of file static.c.

◆ HICON_GWL_OFFSET

#define HICON_GWL_OFFSET   (sizeof(HFONT))

Definition at line 47 of file static.c.

◆ STATIC_EXTRA_BYTES

#define STATIC_EXTRA_BYTES   (UISTATE_GWL_OFFSET + sizeof(LONG))

Definition at line 49 of file static.c.

◆ UISTATE_GWL_OFFSET

#define UISTATE_GWL_OFFSET   (HICON_GWL_OFFSET+sizeof(HICON))

Definition at line 48 of file static.c.

Typedef Documentation

◆ pfPaint

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

Definition at line 51 of file static.c.

Function Documentation

◆ hasTextStyle()

static BOOL hasTextStyle ( DWORD  style)
static

Definition at line 318 of file static.c.

319 {
320  switch(style & SS_TYPEMASK)
321  {
322  case SS_SIMPLE:
323  case SS_LEFT:
324  case SS_LEFTNOWORDWRAP:
325  case SS_CENTER:
326  case SS_RIGHT:
327  case SS_OWNERDRAW:
328  return TRUE;
329  }
330 
331  return FALSE;
332 }
#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 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 StaticWndProc_common().

◆ STATIC_GetImage()

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

Definition at line 187 of file static.c.

188 {
189  switch(style & SS_TYPEMASK)
190  {
191  case SS_ICON:
192  if ((wParam != IMAGE_ICON) &&
193  (wParam != IMAGE_CURSOR)) return NULL;
194  break;
195  case SS_BITMAP:
196  if (wParam != IMAGE_BITMAP) return NULL;
197  break;
198  case SS_ENHMETAFILE:
199  if (wParam != IMAGE_ENHMETAFILE) return NULL;
200  break;
201  default:
202  return NULL;
203  }
205 }
#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 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
#define HICON_GWL_OFFSET
Definition: static.c:47

Referenced by StaticWndProc_common().

◆ STATIC_InitColours()

static VOID STATIC_InitColours ( void  )
static

Definition at line 306 of file static.c.

307 {
311 }
#define COLOR_3DHIGHLIGHT
Definition: winuser.h:926
DWORD WINAPI GetSysColor(_In_ int)
#define COLOR_3DSHADOW
Definition: winuser.h:921
static COLORREF color_3dhighlight
Definition: static.c:43
static COLORREF color_3ddkshadow
Definition: static.c:43
static COLORREF color_3dshadow
Definition: static.c:43
#define COLOR_3DDKSHADOW
Definition: winuser.h:929

Referenced by StaticWndProc_common().

◆ STATIC_LoadIconA()

static HICON STATIC_LoadIconA ( HINSTANCE  hInstance,
LPCSTR  name,
DWORD  style 
)
static

Definition at line 212 of file static.c.

213 {
214  HICON hicon = 0;
215 
216  if (hInstance && ((ULONG_PTR)hInstance >> 16))
217  {
218  if ((style & SS_REALSIZEIMAGE) != 0)
219  hicon = LoadImageA(hInstance, name, IMAGE_ICON, 0, 0, LR_SHARED);
220  else
221  {
222  hicon = LoadIconA( hInstance, name );
223  if (!hicon) hicon = LoadCursorA( hInstance, name );
224  }
225  }
226  if (!hicon) hicon = LoadIconA( 0, name );
227  /* Windows doesn't try to load a standard cursor,
228  probably because most IDs for standard cursors conflict
229  with the IDs for standard icons anyway */
230  return hicon;
231 }
static HICON
Definition: imagelist.c:84
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
HICON WINAPI LoadIconA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2029
uint32_t ULONG_PTR
Definition: typedefs.h:64
HINSTANCE hInstance
Definition: charmap.c:20
#define SS_REALSIZEIMAGE
Definition: winuser.h:354
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
HANDLE WINAPI LoadImageA(_In_opt_ HINSTANCE, _In_ LPCSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2147
Definition: name.c:38
Arabic default style
Definition: afstyles.h:93

Referenced by StaticWndProc_common().

◆ STATIC_LoadIconW()

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

Definition at line 238 of file static.c.

239 {
240  HICON hicon = 0;
241 
242  if (hInstance && ((ULONG_PTR)hInstance >> 16))
243  {
244  if ((style & SS_REALSIZEIMAGE) != 0)
245  hicon = LoadImageW(hInstance, name, IMAGE_ICON, 0, 0, LR_SHARED);
246  else
247  {
248  hicon = LoadIconW( hInstance, name );
249  if (!hicon) hicon = LoadCursorW( hInstance, name );
250  }
251  }
252  if (!hicon) hicon = LoadIconW( 0, name );
253  /* Windows doesn't try to load a standard cursor,
254  probably because most IDs for standard cursors conflict
255  with the IDs for standard icons anyway */
256  return hicon;
257 }
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:64
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 StaticWndProc_common().

◆ STATIC_PaintBitmapfn()

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

Definition at line 794 of file static.c.

795 {
796  HDC hMemDC;
797  HBITMAP hBitmap, oldbitmap;
798 
799  /* message is still sent, even if the returned brush is not used */
801 
804  && (hMemDC = CreateCompatibleDC( hdc )))
805  {
806  BITMAP bm;
807  RECT rcClient;
808 
809  GetObjectW(hBitmap, sizeof(bm), &bm);
810  oldbitmap = SelectObject(hMemDC, hBitmap);
811 
812  GetClientRect(hwnd, &rcClient);
813  if (style & SS_CENTERIMAGE)
814  {
815  HBRUSH hbrush = CreateSolidBrush(GetPixel(hMemDC, 0, 0));
816 
817  FillRect( hdc, &rcClient, hbrush );
818 
819  rcClient.left = (rcClient.right - rcClient.left)/2 - bm.bmWidth/2;
820  rcClient.top = (rcClient.bottom - rcClient.top)/2 - bm.bmHeight/2;
821  rcClient.right = rcClient.left + bm.bmWidth;
822  rcClient.bottom = rcClient.top + bm.bmHeight;
823 
825  }
826  StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left,
827  rcClient.bottom - rcClient.top, hMemDC,
828  0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
829  SelectObject(hMemDC, oldbitmap);
830  DeleteDC(hMemDC);
831  }
832 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HBRUSH hbrush
static HDC
Definition: imagelist.c:92
LONG top
Definition: windef.h:307
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define GetWindowLongPtrW
Definition: winuser.h:4804
LONG left
Definition: windef.h:306
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
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)
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)
static HBRUSH STATIC_SendWmCtlColorStatic(HWND hwnd, HDC hdc)
Definition: static.c:284
Definition: bl.h:1331
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
Definition: ObTypes.c:15
LONG bottom
Definition: windef.h:309
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
#define HICON_GWL_OFFSET
Definition: static.c:47

◆ STATIC_PaintEnhMetafn()

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

Definition at line 835 of file static.c.

836 {
837  HENHMETAFILE hEnhMetaFile;
838  RECT rc;
839  HBRUSH hbrush;
840 
841  GetClientRect(hwnd, &rc);
843  FillRect(hdc, &rc, hbrush);
844  if ((hEnhMetaFile = (HENHMETAFILE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET )))
845  {
846  /* The control's current font is not selected into the
847  device context! */
848  if (GetObjectType(hEnhMetaFile) == OBJ_ENHMETAFILE)
849  PlayEnhMetaFile(hdc, hEnhMetaFile, &rc);
850  }
851 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HBRUSH hbrush
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define OBJ_ENHMETAFILE
Definition: objidl.idl:1421
BOOL WINAPI PlayEnhMetaFile(_In_ HDC, _In_ HENHMETAFILE, _In_ LPCRECT)
HDC hdc
Definition: main.c:9
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
static HBRUSH STATIC_SendWmCtlColorStatic(HWND hwnd, HDC hdc)
Definition: static.c:284
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
Definition: ObTypes.c:15
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define HICON_GWL_OFFSET
Definition: static.c:47

◆ STATIC_PaintEtchedfn()

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

Definition at line 854 of file static.c.

855 {
856  RECT rc;
857 
858  /* FIXME: sometimes (not always) sends WM_CTLCOLORSTATIC */
859  GetClientRect( hwnd, &rc );
860  switch (style & SS_TYPEMASK)
861  {
862  case SS_ETCHEDHORZ:
864  break;
865  case SS_ETCHEDVERT:
867  break;
868  case SS_ETCHEDFRAME:
869  DrawEdge (hdc, &rc, EDGE_ETCHED, BF_RECT);
870  break;
871  }
872 }
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 763 of file static.c.

764 {
765  RECT rc, iconRect;
766  HBRUSH hbrush;
767  HICON hIcon;
768  SIZE size;
769 
770  GetClientRect( hwnd, &rc );
773  if (!hIcon || !get_icon_size( hIcon, &size ))
774  {
775  FillRect(hdc, &rc, hbrush);
776  }
777  else
778  {
779  if (style & SS_CENTERIMAGE)
780  {
781  iconRect.left = (rc.right - rc.left) / 2 - size.cx / 2;
782  iconRect.top = (rc.bottom - rc.top) / 2 - size.cy / 2;
783  iconRect.right = iconRect.left + size.cx;
784  iconRect.bottom = iconRect.top + size.cy;
785  }
786  else
787  iconRect = rc;
788  FillRect( hdc, &rc, hbrush );
789  DrawIconEx( hdc, iconRect.left, iconRect.top, hIcon, iconRect.right - iconRect.left,
790  iconRect.bottom - iconRect.top, 0, NULL, DI_NORMAL );
791  }
792 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HICON
Definition: imagelist.c:84
static HBRUSH hbrush
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 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)
static HBRUSH STATIC_SendWmCtlColorStatic(HWND hwnd, HDC hdc)
Definition: static.c:284
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
#define HICON_GWL_OFFSET
Definition: static.c:47

◆ STATIC_PaintOwnerDrawfn()

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

Definition at line 591 of file static.c.

592 {
593  DRAWITEMSTRUCT dis;
594  HFONT font, oldFont = NULL;
596 
597  dis.CtlType = ODT_STATIC;
598  dis.CtlID = id;
599  dis.itemID = 0;
602  dis.hwndItem = hwnd;
603  dis.hDC = hdc;
604  dis.itemData = 0;
605  GetClientRect( hwnd, &dis.rcItem );
606 
608  if (font) oldFont = SelectObject( hdc, font );
609  /* hBrush = */ STATIC_SendWmCtlColorStatic(hwnd, hdc);
610  SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis );
611  if (font) SelectObject( hdc, oldFont );
612 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: mk_font.cpp:20
ULONG_PTR itemData
Definition: winuser.h:3068
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
#define GetWindowLongPtrW
Definition: winuser.h:4804
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)
static HBRUSH STATIC_SendWmCtlColorStatic(HWND hwnd, HDC hdc)
Definition: static.c:284
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
#define HFONT_GWL_OFFSET
Definition: static.c:46

◆ STATIC_PaintRectfn()

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

Definition at line 719 of file static.c.

720 {
721  RECT rc;
722  HBRUSH hBrush;
723 
724  GetClientRect( hwnd, &rc);
725 
726  /* FIXME: send WM_CTLCOLORSTATIC */
727 #ifdef __REACTOS__
728  hBrush = STATIC_SendWmCtlColorStatic(hwnd, hdc); // Always sent....
729 #endif
730  switch (style & SS_TYPEMASK)
731  {
732  case SS_BLACKRECT:
734  FillRect( hdc, &rc, hBrush );
735  break;
736  case SS_GRAYRECT:
738  FillRect( hdc, &rc, hBrush );
739  break;
740  case SS_WHITERECT:
742  FillRect( hdc, &rc, hBrush );
743  break;
744  case SS_BLACKFRAME:
746  FrameRect( hdc, &rc, hBrush );
747  break;
748  case SS_GRAYFRAME:
750  FrameRect( hdc, &rc, hBrush );
751  break;
752  case SS_WHITEFRAME:
754  FrameRect( hdc, &rc, hBrush );
755  break;
756  default:
757  return;
758  }
759  DeleteObject( hBrush );
760 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define SS_BLACKRECT
Definition: pedump.c:696
#define SS_TYPEMASK
Definition: winuser.h:362
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
static COLORREF color_3dhighlight
Definition: static.c:43
#define SS_GRAYRECT
Definition: pedump.c:697
#define SS_GRAYFRAME
Definition: pedump.c:700
HDC hdc
Definition: main.c:9
#define SS_BLACKFRAME
Definition: pedump.c:699
static COLORREF color_3ddkshadow
Definition: static.c:43
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
static HBRUSH STATIC_SendWmCtlColorStatic(HWND hwnd, HDC hdc)
Definition: static.c:284
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
static COLORREF color_3dshadow
Definition: static.c:43
#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 614 of file static.c.

615 {
616  RECT rc;
617  HBRUSH hBrush;
618  HFONT hFont, hOldFont = NULL;
619  WORD wFormat;
620  INT len, buf_size;
621  WCHAR *text;
622 
623  GetClientRect( hwnd, &rc);
624 
625  switch (style & SS_TYPEMASK)
626  {
627  case SS_LEFT:
628  wFormat = DT_LEFT | DT_EXPANDTABS | DT_WORDBREAK;
629  break;
630 
631  case SS_CENTER:
632  wFormat = DT_CENTER | DT_EXPANDTABS | DT_WORDBREAK;
633  break;
634 
635  case SS_RIGHT:
636  wFormat = DT_RIGHT | DT_EXPANDTABS | DT_WORDBREAK;
637  break;
638 
639  case SS_SIMPLE:
640  wFormat = DT_LEFT | DT_SINGLELINE;
641  break;
642 
643  case SS_LEFTNOWORDWRAP:
644  wFormat = DT_LEFT | DT_EXPANDTABS;
645  break;
646 
647  default:
648  return;
649  }
650 
652  wFormat = DT_RIGHT | (wFormat & ~(DT_LEFT | DT_CENTER));
653 
654  if (style & SS_NOPREFIX)
655  wFormat |= DT_NOPREFIX;
656  else if (GetWindowLongW(hwnd, UISTATE_GWL_OFFSET) & UISF_HIDEACCEL) // ReactOS r30727
657  wFormat |= DT_HIDEPREFIX;
658 
659  if ((style & SS_TYPEMASK) != SS_SIMPLE)
660  {
661  if (style & SS_CENTERIMAGE)
662  wFormat |= DT_SINGLELINE | DT_VCENTER;
663  if (style & SS_EDITCONTROL)
664  wFormat |= DT_EDITCONTROL;
665  if (style & SS_ENDELLIPSIS)
666  wFormat |= DT_SINGLELINE | DT_END_ELLIPSIS;
667  if (style & SS_PATHELLIPSIS)
668  wFormat |= DT_SINGLELINE | DT_PATH_ELLIPSIS;
669  if (style & SS_WORDELLIPSIS)
670  wFormat |= DT_SINGLELINE | DT_WORD_ELLIPSIS;
671  }
672 
674  hOldFont = SelectObject( hdc, hFont );
675 
676  /* SS_SIMPLE controls: WM_CTLCOLORSTATIC is sent, but the returned
677  brush is not used */
679 
680  if ((style & SS_TYPEMASK) != SS_SIMPLE)
681  {
682  FillRect( hdc, &rc, hBrush );
684  }
685 
686  buf_size = 256;
687  if (!(text = HeapAlloc( GetProcessHeap(), 0, buf_size * sizeof(WCHAR) )))
688  goto no_TextOut;
689 
690  while ((len = InternalGetWindowText( hwnd, text, buf_size )) == buf_size - 1)
691  {
692  buf_size *= 2;
693  if (!(text = HeapReAlloc( GetProcessHeap(), 0, text, buf_size * sizeof(WCHAR) )))
694  goto no_TextOut;
695  }
696 
697  if (!len) goto no_TextOut;
698 
699  if (((style & SS_TYPEMASK) == SS_SIMPLE) && (style & SS_NOPREFIX))
700  {
701  /* Windows uses the faster ExtTextOut() to draw the text and
702  to paint the whole client rectangle with the text background
703  color. Reference: "Static Controls" by Kyle Marsh, 1992 */
705  &rc, text, len, NULL );
706  }
707  else
708  {
709  DrawTextW( hdc, text, -1, &rc, wFormat );
710  }
711 
712 no_TextOut:
713  HeapFree( GetProcessHeap(), 0, text );
714 
715  if (hFont)
716  SelectObject( hdc, hOldFont );
717 }
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
#define DT_HIDEPREFIX
Definition: winuser.h:547
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:1497
#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:57
DWORD WINAPI GetSysColor(_In_ int)
#define SS_RIGHT
Definition: pedump.c:694
HFONT hFont
Definition: main.c:53
#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
#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:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned short WORD
Definition: ntddk_ex.h:93
#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)
static HBRUSH STATIC_SendWmCtlColorStatic(HWND hwnd, HDC hdc)
Definition: static.c:284
#define HeapReAlloc
Definition: compat.h:402
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:403
#define SS_LEFTNOWORDWRAP
Definition: pedump.c:703
#define HFONT_GWL_OFFSET
Definition: static.c:46
#define UISTATE_GWL_OFFSET
Definition: static.c:48
#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_SendWmCtlColorStatic()

static HBRUSH STATIC_SendWmCtlColorStatic ( HWND  hwnd,
HDC  hdc 
)
static

Definition at line 284 of file static.c.

285 {
286 #ifdef __REACTOS__
288 #else
289  HBRUSH hBrush;
291 
292  if (!parent) parent = hwnd;
293  hBrush = (HBRUSH) SendMessageW( parent,
295  if (!hBrush) /* did the app forget to call DefWindowProc ? */
296  {
297  /* FIXME: DefWindowProc should return different colors if a
298  manifest is present */
299  hBrush = (HBRUSH)DefWindowProcW( parent, WM_CTLCOLORSTATIC,
300  (WPARAM)hdc, (LPARAM)hwnd);
301  }
302  return hBrush;
303 #endif
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)
HBRUSH FASTCALL GetControlBrush(PWND pwnd, HDC hdc, UINT ctlType)
Definition: misc.c:171

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

◆ STATIC_SetBitmap()

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

Definition at line 133 of file static.c.

134 {
135  HBITMAP hOldBitmap;
136 
137  if ((style & SS_TYPEMASK) != SS_BITMAP) return 0;
139  WARN("hBitmap != 0, but it's not a bitmap\n");
140  return 0;
141  }
144  {
145  BITMAP bm;
146  GetObjectW(hBitmap, sizeof(bm), &bm);
147  /* Windows currently doesn't implement SS_RIGHTJUST */
148  /*
149  if ((style & SS_RIGHTJUST) != 0)
150  {
151  RECT wr;
152  GetWindowRect(hwnd, &wr);
153  SetWindowPos( hwnd, 0, wr.right - bm.bmWidth, wr.bottom - bm.bmHeight,
154  bm.bmWidth, bm.bmHeight, SWP_NOACTIVATE | SWP_NOZORDER );
155  }
156  else */
157  {
158  SetWindowPos( hwnd, 0, 0, 0, bm.bmWidth, bm.bmHeight,
160  }
161 
162  }
163  return hOldBitmap;
164 }
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 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
#define HICON_GWL_OFFSET
Definition: static.c:47

Referenced by StaticWndProc_common().

◆ STATIC_SetEnhMetaFile()

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

Definition at line 171 of file static.c.

172 {
173  if ((style & SS_TYPEMASK) != SS_ENHMETAFILE) return 0;
174  if (hEnhMetaFile && GetObjectType(hEnhMetaFile) != OBJ_ENHMETAFILE) {
175  WARN("hEnhMetaFile != 0, but it's not an enhanced metafile\n");
176  return 0;
177  }
178  return (HENHMETAFILE)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hEnhMetaFile );
179 }
#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 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
#define HICON_GWL_OFFSET
Definition: static.c:47

Referenced by StaticWndProc_common().

◆ STATIC_SetIcon()

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

Definition at line 97 of file static.c.

98 {
99  HICON prevIcon;
100  SIZE size;
101 
102  if ((style & SS_TYPEMASK) != SS_ICON) return 0;
103  if (hicon && !get_icon_size( hicon, &size ))
104  {
105  WARN("hicon != 0, but invalid\n");
106  return 0;
107  }
108  prevIcon = (HICON)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hicon );
109  if (hicon && !(style & SS_CENTERIMAGE) && !(style & SS_REALSIZECONTROL))
110  {
111  /* Windows currently doesn't implement SS_RIGHTJUST */
112  /*
113  if ((style & SS_RIGHTJUST) != 0)
114  {
115  RECT wr;
116  GetWindowRect(hwnd, &wr);
117  SetWindowPos( hwnd, 0, wr.right - info->nWidth, wr.bottom - info->nHeight,
118  info->nWidth, info->nHeight, SWP_NOACTIVATE | SWP_NOZORDER );
119  }
120  else */
121  {
123  }
124  }
125  return prevIcon;
126 }
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 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
#define HICON_GWL_OFFSET
Definition: static.c:47

Referenced by StaticWndProc_common().

◆ STATIC_TryPaintFcn()

static VOID STATIC_TryPaintFcn ( HWND  hwnd,
LONG  full_style 
)
static

Definition at line 264 of file static.c.

265 {
266  LONG style = full_style & SS_TYPEMASK;
267  RECT rc;
268 
269  GetClientRect( hwnd, &rc );
271  {
272  HDC hdc;
273  HRGN hrgn;
274 
275  hdc = GetDC( hwnd );
276  hrgn = set_control_clipping( hdc, &rc );
277  (staticPaintFunc[style])( hwnd, hdc, full_style );
278  SelectClipRgn( hdc, hrgn );
279  if (hrgn) DeleteObject( hrgn );
280  ReleaseDC( hwnd, hdc );
281  }
282 }
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
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)
static const pfPaint staticPaintFunc[SS_TYPEMASK+1]
Definition: static.c:53
Arabic default style
Definition: afstyles.h:93

Referenced by StaticWndProc_common().

◆ StaticWndProc_common()

LRESULT WINAPI StaticWndProc_common ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL  unicode 
)

Definition at line 337 of file static.c.

338 {
339  LRESULT lResult = 0;
340  LONG full_style = GetWindowLongW( hwnd, GWL_STYLE );
341  LONG style = full_style & SS_TYPEMASK;
342 #ifdef __REACTOS__
343  PWND pWnd;
344 
345  pWnd = ValidateHwnd(hwnd);
346  if (pWnd)
347  {
348  if (!pWnd->fnid)
349  {
351  }
352  else
353  {
354  if (pWnd->fnid != FNID_STATIC)
355  {
356  ERR("Wrong window class for Static! fnId 0x%x\n",pWnd->fnid);
357  return 0;
358  }
359  }
360  }
361 #endif
362 
363  if (!IsWindow( hwnd )) return 0;
364 
365  switch (uMsg)
366  {
367  case WM_CREATE:
368  if (style < 0L || style > SS_TYPEMASK)
369  {
370  ERR("Unknown style 0x%02lx\n", style );
371  return -1;
372  }
373  STATIC_update_uistate(hwnd, unicode); // ReactOS r30727
375  break;
376 
377  case WM_NCDESTROY:
378 #ifdef __REACTOS__
380 #endif
381  if (style == SS_ICON) {
382 /*
383  * FIXME
384  * DestroyIcon32( STATIC_SetIcon( wndPtr, 0 ) );
385  *
386  * We don't want to do this yet because DestroyIcon32 is broken. If the icon
387  * had already been loaded by the application the last thing we want to do is
388  * GlobalFree16 the handle.
389  */
390  break;
391  }
392  else return unicode ? DefWindowProcW(hwnd, uMsg, wParam, lParam) :
393  DefWindowProcA(hwnd, uMsg, wParam, lParam);
394 
395  case WM_ERASEBKGND:
396  /* do all painting in WM_PAINT like Windows does */
397  return 1;
398 
399  case WM_PRINTCLIENT:
400  case WM_PAINT:
401  {
402  PAINTSTRUCT ps;
403  RECT rect;
404  HDC hdc = wParam ? (HDC)wParam : BeginPaint(hwnd, &ps);
405  GetClientRect( hwnd, &rect );
406  if (staticPaintFunc[style])
407  {
408  HRGN hrgn = set_control_clipping( hdc, &rect );
409  (staticPaintFunc[style])( hwnd, hdc, full_style );
410  SelectClipRgn( hdc, hrgn );
411  if (hrgn) DeleteObject( hrgn );
412  }
413  if (!wParam) EndPaint(hwnd, &ps);
414  }
415  break;
416 
417  case WM_ENABLE:
418  STATIC_TryPaintFcn( hwnd, full_style );
419  if (full_style & SS_NOTIFY) {
420  if (wParam) {
423  }
424  else {
427  }
428  }
429  break;
430 
431  case WM_SYSCOLORCHANGE:
433  STATIC_TryPaintFcn( hwnd, full_style );
434  break;
435 
436  case WM_NCCREATE:
437  {
439 
440  if (full_style & SS_SUNKEN)
443 
444  switch (style) {
445  case SS_ICON:
446  {
447  HICON hIcon;
448  if (unicode || IS_INTRESOURCE(cs->lpszName))
449  hIcon = STATIC_LoadIconW(cs->hInstance, cs->lpszName, full_style);
450  else
451  hIcon = STATIC_LoadIconA(cs->hInstance, (LPCSTR)cs->lpszName, full_style);
452  STATIC_SetIcon(hwnd, hIcon, full_style);
453  }
454  break;
455  case SS_BITMAP:
456  if ((ULONG_PTR)cs->hInstance >> 16)
457  {
459  if (unicode || IS_INTRESOURCE(cs->lpszName))
460  hBitmap = LoadBitmapW(cs->hInstance, cs->lpszName);
461  else
462  hBitmap = LoadBitmapA(cs->hInstance, (LPCSTR)cs->lpszName);
463  STATIC_SetBitmap(hwnd, hBitmap, full_style);
464  }
465  break;
466  }
467  /* SS_ENHMETAFILE: Despite what MSDN says, Windows does not load
468  the enhanced metafile that was specified as the window text. */
469  }
470  return unicode ? DefWindowProcW(hwnd, uMsg, wParam, lParam) :
471  DefWindowProcA(hwnd, uMsg, wParam, lParam);
472 
473  case WM_SETTEXT:
474  if (hasTextStyle( full_style ))
475  {
476  if (unicode)
477  lResult = DefWindowProcW( hwnd, uMsg, wParam, lParam );
478  else
479  lResult = DefWindowProcA( hwnd, uMsg, wParam, lParam );
480  STATIC_TryPaintFcn( hwnd, full_style );
481  }
482  break;
483 
484  case WM_SETFONT:
485  if (hasTextStyle( full_style ))
486  {
488  if (LOWORD(lParam))
490  }
491  break;
492 
493  case WM_GETFONT:
495 
496  case WM_NCHITTEST:
497  if (full_style & SS_NOTIFY)
498  return HTCLIENT;
499  else
500  return HTTRANSPARENT;
501 
502  case WM_GETDLGCODE:
503  return DLGC_STATIC;
504 
505  case WM_LBUTTONDOWN:
506  case WM_NCLBUTTONDOWN:
507  if (full_style & SS_NOTIFY)
510  return 0;
511 
512  case WM_LBUTTONDBLCLK:
513  case WM_NCLBUTTONDBLCLK:
514  if (full_style & SS_NOTIFY)
517  return 0;
518 
519  case STM_GETIMAGE:
520  return (LRESULT)STATIC_GetImage( hwnd, wParam, full_style );
521 
522  case STM_GETICON:
523  return (LRESULT)STATIC_GetImage( hwnd, IMAGE_ICON, full_style );
524 
525  case STM_SETIMAGE:
526  switch(wParam) {
527  case IMAGE_BITMAP:
528  if (style != SS_BITMAP) return 0; // ReactOS r43158
529  lResult = (LRESULT)STATIC_SetBitmap( hwnd, (HBITMAP)lParam, full_style );
530  break;
531  case IMAGE_ENHMETAFILE:
532  if (style != SS_ENHMETAFILE) return 0; // ReactOS r43158
533  lResult = (LRESULT)STATIC_SetEnhMetaFile( hwnd, (HENHMETAFILE)lParam, full_style );
534  break;
535  case IMAGE_ICON:
536  case IMAGE_CURSOR:
537  if (style != SS_ICON) return 0; // ReactOS r43158
538  lResult = (LRESULT)STATIC_SetIcon( hwnd, (HICON)lParam, full_style );
539  break;
540  default:
541  FIXME("STM_SETIMAGE: Unhandled type %lx\n", wParam);
542  break;
543  }
544  STATIC_TryPaintFcn( hwnd, full_style );
545  break;
546 
547  case STM_SETICON:
548  lResult = (LRESULT)STATIC_SetIcon( hwnd, (HICON)wParam, full_style );
549  STATIC_TryPaintFcn( hwnd, full_style );
550  break;
551 
552 #ifdef __REACTOS__
553  case WM_UPDATEUISTATE:
554  if (unicode)
555  DefWindowProcW(hwnd, uMsg, wParam, lParam);
556  else
557  DefWindowProcA(hwnd, uMsg, wParam, lParam);
558 
559  if (STATIC_update_uistate(hwnd, unicode) && hasTextStyle( full_style ))
560  {
562  }
563  break;
564 #endif
565 
566  default:
567  return unicode ? DefWindowProcW(hwnd, uMsg, wParam, lParam) :
568  DefWindowProcA(hwnd, uMsg, wParam, lParam);
569  }
570  return lResult;
571 }
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1674
#define SS_ENHMETAFILE
Definition: winuser.h:341
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
#define IMAGE_ICON
Definition: winuser.h:212
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
HBITMAP WINAPI LoadBitmapA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2117
#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
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define GWL_EXSTYLE
Definition: winuser.h:845
static VOID STATIC_InitColours(void)
Definition: static.c:306
#define WM_NCHITTEST
Definition: winuser.h:1668
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define FNID_DESTROY
Definition: ntuser.h:859
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
& 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)
uint32_t ULONG_PTR
Definition: typedefs.h:64
#define STN_DBLCLK
Definition: winuser.h:2077
#define SS_BITMAP
Definition: pedump.c:704
uint32_t cs
Definition: isohybrid.c:75
DWORD fnid
Definition: ntuser.h:673
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
static HENHMETAFILE STATIC_SetEnhMetaFile(HWND hwnd, HENHMETAFILE hEnhMetaFile, DWORD style)
Definition: static.c:171
#define FIXME(fmt,...)
Definition: debug.h:111
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
smooth NULL
Definition: ftsmooth.c:416
#define WM_GETFONT
Definition: winuser.h:1633
LONG_PTR LPARAM
Definition: windef.h:208
const char * LPCSTR
Definition: xmlstorage.h:183
#define WM_SETTEXT
Definition: winuser.h:1599
static __inline BOOL STATIC_update_uistate(HWND hwnd, BOOL unicode)
Definition: user_x.h:65
static HBITMAP STATIC_SetBitmap(HWND hwnd, HBITMAP hBitmap, DWORD style)
Definition: static.c:133
static HICON STATIC_LoadIconW(HINSTANCE hInstance, LPCWSTR name, DWORD style)
Definition: static.c:238
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#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
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
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
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static BOOL hasTextStyle(DWORD style)
Definition: static.c:318
static HICON STATIC_SetIcon(HWND hwnd, HICON hicon, DWORD style)
Definition: static.c:97
#define ERR(fmt,...)
Definition: debug.h:110
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:657
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
static HICON STATIC_LoadIconA(HINSTANCE hInstance, LPCSTR name, DWORD style)
Definition: static.c:212
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
#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
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
Definition: window.c:4054
static const pfPaint staticPaintFunc[SS_TYPEMASK+1]
Definition: static.c:53
#define SetWindowLongPtrW
Definition: winuser.h:5321
static HBITMAP
Definition: button.c:44
static HANDLE STATIC_GetImage(HWND hwnd, WPARAM wParam, DWORD style)
Definition: static.c:187
#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
static VOID STATIC_TryPaintFcn(HWND hwnd, LONG full_style)
Definition: static.c:264
#define WS_EX_STATICEDGE
Definition: winuser.h:403
static HBITMAP hBitmap
Definition: timezone.c:26
LPARAM lParam
Definition: combotst.c:139
#define FNID_STATIC
Definition: ntuser.h:835
#define LOWORD(l)
Definition: pedump.c:82
#define GWLP_ID
Definition: winuser.h:854
#define DLGC_STATIC
Definition: winuser.h:2594
#define HFONT_GWL_OFFSET
Definition: static.c:46
#define RDW_INVALIDATE
Definition: winuser.h:1200
#define WM_NCLBUTTONDBLCLK
Definition: winuser.h:1676

Referenced by RegisterClientPFN(), StaticWndProcA(), and StaticWndProcW().

◆ StaticWndProcA()

LRESULT WINAPI StaticWndProcA ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 576 of file static.c.

577 {
578  if (!IsWindow( hWnd )) return 0;
579  return StaticWndProc_common(hWnd, uMsg, wParam, lParam, FALSE);
580 }
BOOL WINAPI IsWindow(_In_opt_ HWND)
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI StaticWndProc_common(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: static.c:337
LPARAM lParam
Definition: combotst.c:139

Referenced by RegisterClientPFN().

◆ StaticWndProcW()

LRESULT WINAPI StaticWndProcW ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 585 of file static.c.

586 {
587  if (!IsWindow( hWnd )) return 0;
588  return StaticWndProc_common(hWnd, uMsg, wParam, lParam, TRUE);
589 }
#define TRUE
Definition: types.h:120
BOOL WINAPI IsWindow(_In_opt_ HWND)
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI StaticWndProc_common(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: static.c:337
LPARAM lParam
Definition: combotst.c:139

Referenced by RegisterClientPFN().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( static  )

Variable Documentation

◆ color_3ddkshadow

COLORREF color_3ddkshadow
static

Definition at line 43 of file static.c.

Referenced by STATIC_InitColours(), and STATIC_PaintRectfn().

◆ color_3dhighlight

COLORREF color_3dhighlight
static

Definition at line 43 of file static.c.

Referenced by STATIC_InitColours(), and STATIC_PaintRectfn().

◆ color_3dshadow

COLORREF color_3dshadow
static

Definition at line 43 of file static.c.

Referenced by STATIC_InitColours(), and STATIC_PaintRectfn().

◆ STATIC_builtin_class

const struct builtin_class_descr STATIC_builtin_class
Initial value:
=
{
0
}
LRESULT WINAPI StaticWndProcA(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: static.c:576
#define STATIC_EXTRA_BYTES
Definition: static.c:49
#define CS_DBLCLKS
Definition: winuser.h:646
LRESULT WINAPI StaticWndProcW(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: static.c:585
static const WCHAR staticW[]
Definition: static.c:80
#define IDC_ARROW
Definition: winuser.h:682
#define CS_PARENTDC
Definition: winuser.h:651

Definition at line 81 of file static.c.

◆ staticPaintFunc

const pfPaint staticPaintFunc[SS_TYPEMASK+1]
static
Initial value:
=
{
NULL,
}
static void STATIC_PaintIconfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:763
static void STATIC_PaintEnhMetafn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:835
static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:794
smooth NULL
Definition: ftsmooth.c:416
static void STATIC_PaintRectfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:719
static void STATIC_PaintEtchedfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:854
static void STATIC_PaintOwnerDrawfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:591
static void STATIC_PaintTextfn(HWND hwnd, HDC hdc, DWORD style)
Definition: static.c:614

Definition at line 53 of file static.c.

Referenced by STATIC_TryPaintFcn(), and StaticWndProc_common().

◆ staticW

const WCHAR staticW[] = {'S','t','a','t','i','c',0}
static

Definition at line 80 of file static.c.