LRESULT lResult = 0;
LONG full_style = GetWindowLongPtrW( hwnd, GWL_STYLE );
LONG style = full_style & SS_TYPEMASK;
+#ifdef __REACTOS__
+ PWND pWnd;
+
+ pWnd = ValidateHwnd(hwnd);
+ if (pWnd)
+ {
+ if (!pWnd->fnid)
+ {
+ NtUserSetWindowFNID(hwnd, FNID_STATIC);
+ }
+ }
+#endif
switch (uMsg)
{
break;
case WM_NCDESTROY:
+#ifdef __REACTOS__
+ NtUserSetWindowFNID(hwnd, FNID_DESTROY);
+#endif
if (style == SS_ICON) {
/*
* FIXME
GetClientRect( hwnd, &rc);
/* FIXME: send WM_CTLCOLORSTATIC */
+#ifdef __REACTOS__
+ hBrush = STATIC_SendWmCtlColorStatic(hwnd, hdc); // Always sent....
+#endif
switch (style & SS_TYPEMASK)
{
case SS_BLACKRECT:
DeleteObject( hBrush );
}
-/* Modified for ReactOS */
static void STATIC_PaintIconfn( HWND hwnd, HDC hdc, DWORD style )
{
RECT rc, iconRect;
HBRUSH hbrush;
HICON hIcon;
- ICONINFO info;
+ SIZE size;
GetClientRect( hwnd, &rc );
hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc);
hIcon = (HICON)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET );
- if (!hIcon || (!GetIconInfo(hIcon, &info)))
+ if (!hIcon || !get_icon_size( hIcon, &size ))
{
FillRect(hdc, &rc, hbrush);
}
else
{
- BITMAP bm;
- if (!GetObjectW(info.hbmColor, sizeof(BITMAP), &bm)) return;
if (style & SS_CENTERIMAGE)
{
- iconRect.left = (rc.right - rc.left) / 2 - bm.bmWidth / 2;
- iconRect.top = (rc.bottom - rc.top) / 2 - bm.bmHeight / 2;
- iconRect.right = iconRect.left + bm.bmWidth;
- iconRect.bottom = iconRect.top + bm.bmHeight;
+ iconRect.left = (rc.right - rc.left) / 2 - size.cx / 2;
+ iconRect.top = (rc.bottom - rc.top) / 2 - size.cy / 2;
+ iconRect.right = iconRect.left + size.cx;
+ iconRect.bottom = iconRect.top + size.cy;
}
else
iconRect = rc;
break;
}
}
+