implement SetSolidBrush16

Andreas Mohr a.mohr at mailto.de
Fri Apr 20 11:56:18 CDT 2001


Hi all,

take a stab at implementing SetSolidBrush16 (not tested at all !).

Andreas Mohr
-------------- next part --------------
Determining best CVS host...
Using CVSROOT :pserver:cvs at winehq.tiepmiep.dk:/home/wine
Index: objects/brush.c
===================================================================
RCS file: /home/wine/wine/objects/brush.c,v
retrieving revision 1.24
diff -u -r1.24 brush.c
--- objects/brush.c	2001/02/14 23:11:19	1.24
+++ objects/brush.c	2001/04/20 17:53:26
@@ -400,16 +400,29 @@
 /***********************************************************************
  *           SetSolidBrush16   (GDI.604)
  *
- *  If hBrush is a solid brush, change it's color to newColor.
+ *  If hBrush is a solid brush, change its color to newColor.
  *
  *  RETURNS
  *           TRUE on success, FALSE on failure.
- *   FIXME: not yet implemented!
+ *
+ *  FIXME: untested, not sure if correct.
  */
 BOOL16 WINAPI SetSolidBrush16(HBRUSH16 hBrush, COLORREF newColor )
 {
-     FIXME("(hBrush %04x, newColor %04x): stub!\n", hBrush, (int)newColor);
+    BRUSHOBJ * brushPtr;
+    BOOL16 res = FALSE;
+
+    TRACE("(hBrush %04x, newColor %08lx)\n", hBrush, (DWORD)newColor);
+    if (!(brushPtr = (BRUSHOBJ *) GDI_GetObjPtr( hBrush, BRUSH_MAGIC )))
+	return FALSE;
+
+    if (brushPtr->logbrush.lbStyle == BS_SOLID)
+    {
+        brushPtr->logbrush.lbColor = newColor;
+	res = TRUE;
+    }
 
-     return(FALSE);
+     GDI_ReleaseObj( hBrush );
+     return res;
 }
 


More information about the wine-patches mailing list