Reputation: 5503
I'm creating a Dialog window with some button controls. I want the buttons to be coloured individually. I've searched and found something that I think I should use, the WM_CTLCOLORBTN Message.
As stated the return value should be a "handle to a brush".
I can create a brush, for example like this:
HBRUSH blueBrush=CreateSolidBrush(RGB(0,255,0));
but how do I return the handle to this brush?
EDIT: My message handling function is defined as
LRESULT CALLBACK ClientDlgProc(...)
and if I try to return blueBrush I get this error:
error C2440: 'return' : cannot convert from 'HBRUSH' to 'LRESULT'
Upvotes: 0
Views: 1897
Reputation: 2611
I'm pretty sure the value returned by CreateSolidBrush is the handle (the H in HBRUSH stands for 'handle').
Upvotes: 3