1. 程式人生 > >HBRUSH to RGB value

HBRUSH to RGB value

str style line ets sizeof msd sof col true

GetObject函數返回一個LOGBRUSH結構體,包含了COLORREF結構。

LOGBRUSH lgbrush;
COLORREF color;
GetObject((HBRUSH)GetStockObject(WHITE_BRUSH), sizeof(LOGBRUSH), &lgbrush);
color=lgbrush.lbColor;

參考鏈接

GetObject function https://msdn.microsoft.com/en-us/library/windows/desktop/dd144904(v=vs.85).aspx

LOGBRUSH structure https://msdn.microsoft.com/en-us/library/windows/desktop/dd145035(v=vs.85).aspx

HBRUSH to RGB value