Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

SETDCBRUSHCOLOR

Brooks_Van_Horn
New Contributor I
131 Views

Has the function SETDCBRUSHCOLOR been deprecated and if so how do you change the brush color?

Thanks,

Brooks

0 Kudos
2 Replies
Steve_Lionel
Black Belt Retired Employee
131 Views

No, it hasn't. It ought to be defined in module GDI32, but isn't. You can define your own interface, for example:

interface
function SetDCBrushColor (hdc,color) BIND(C,NAME="SetDCBrushColor")
!DEC$ ATTRIBUTES DEFAULT, STDCALL :: SetDCBrushColor
use IFWINTY
integer(ULONG) :: SetDCBrushColor
integer(HANDLE), intent(IN), value :: hdc
integer(ULONG), intent(IN), value :: color
end function SetDCBrushColor
end interface

 

Paul_Curtis
Valued Contributor I
131 Views

Interesting...  I use CreateSolidBrush(), which is defined in GDI32, works perfectly.  Note that with this API you have to explicitly clean up with DeleteObject(hbrush) when done.  The MSDN chat on SetDCBrushColor is unclear (to me, at least) about who does the memory management when a stock system brush is replaced with a user brush, so be careful not to create small memory leaks which would be difficult to detect.

Reply