Click here to Skip to main content
15,916,417 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Slow Editor in VC+ 6.0 Pin
Brian Shifrin2-Dec-03 5:50
Brian Shifrin2-Dec-03 5:50 
GeneralRe: Slow Editor in VC+ 6.0 Pin
BadJerry2-Dec-03 7:11
BadJerry2-Dec-03 7:11 
Generalkey sound Pin
viliam1-Dec-03 23:48
viliam1-Dec-03 23:48 
GeneralRe: key sound Pin
David Crow2-Dec-03 9:53
David Crow2-Dec-03 9:53 
GeneralRe: key sound Pin
viliam2-Dec-03 22:30
viliam2-Dec-03 22:30 
GeneralChanging COLORREF to RGB Pin
harinat1-Dec-03 23:41
harinat1-Dec-03 23:41 
GeneralRe: Changing COLORREF to RGB Pin
Steve S1-Dec-03 23:44
Steve S1-Dec-03 23:44 
GeneralRe: Changing COLORREF to RGB Pin
BaldwinMartin2-Dec-03 1:04
BaldwinMartin2-Dec-03 1:04 
COLORREF RGB(
BYTE bRed, // red component of color
BYTE bGreen, // green component of color
BYTE bBlue // blue component of color
);

above is the structure

#define RGB(r, g ,b) ((DWORD) (((BYTE) (r) | \
((WORD) (g) << 8)) | \
(((DWORD) (BYTE) (b)) << 16)))
Above is the Macro

So COLORREF is a 24-bit RGB color.

BYTE GetBValue(
WORD rgb // 32-bit RGB value // blue
);

BYTE GetGValue(
DWORD rgb // 32-bit RGB value // green
);

BYTE GetRValue(
DWORD rgb // 32-bit RGB value // red

);

The GetRValue macro is defined as follows:

#define GetRValue(rgb) ((BYTE) (rgb))
#define GetGValue(rgb) ((BYTE) (rgb))
#define GetBValue(rgb) ((BYTE) (rgb))

long green = 128;
long red = 128;
long blue = 128;

COLORREF clr = RGB((blue + (green * 256) + (red * 255));

You may also create a structure of you own with COLORREF as a element with it.

Hope this helps.






Best Wishes and Happy Holiday's,
ez_way
GeneralMicheal Dunn Help!!! Pin
Prakash Nadar1-Dec-03 23:24
Prakash Nadar1-Dec-03 23:24 
GeneralC++ Programming on Concert Hall Reservation sytem Pin
omissom20021-Dec-03 23:03
omissom20021-Dec-03 23:03 
GeneralRe: C++ Programming on Concert Hall Reservation sytem Pin
Debs2-Dec-03 1:16
Debs2-Dec-03 1:16 
GeneralRe: C++ Programming on Concert Hall Reservation sytem Pin
omissom20022-Dec-03 22:41
omissom20022-Dec-03 22:41 
GeneralRe: C++ Programming on Concert Hall Reservation sytem Pin
Debs3-Dec-03 23:14
Debs3-Dec-03 23:14 
GeneralRe: C++ Programming on Concert Hall Reservation sytem Pin
Anonymous4-Dec-03 20:35
Anonymous4-Dec-03 20:35 
GeneralRe: C++ Programming on Concert Hall Reservation sytem Pin
David Crow2-Dec-03 9:49
David Crow2-Dec-03 9:49 
GeneralRe: C++ Programming on Concert Hall Reservation sytem Pin
Taka Muraoka2-Dec-03 14:57
Taka Muraoka2-Dec-03 14:57 
GeneralRe: C++ Programming on Concert Hall Reservation sytem Pin
Debs3-Dec-03 23:02
Debs3-Dec-03 23:02 
GeneralDon't show places bar Pin
Urban Olars1-Dec-03 22:24
Urban Olars1-Dec-03 22:24 
GeneralRe: Don't show places bar Pin
Mike Dimmick1-Dec-03 23:11
Mike Dimmick1-Dec-03 23:11 
Generalrotating gripper in top left corner of scroll bar Pin
suneetchandok1-Dec-03 22:17
susssuneetchandok1-Dec-03 22:17 
GeneralLoading an Icon to a Button from a local directory in runtime Pin
harinat1-Dec-03 21:56
harinat1-Dec-03 21:56 
GeneralRe: Loading an Icon to a Button from a local directory in runtime Pin
Prakash Nadar1-Dec-03 22:56
Prakash Nadar1-Dec-03 22:56 
GeneralRe: Loading an Icon to a Button from a local directory in runtime Pin
Kene1-Dec-03 23:14
Kene1-Dec-03 23:14 
QuestionHow can I override CPropertySheet::RemovePage(int nPage) in a derived class? Pin
mfc_surfer1-Dec-03 21:35
mfc_surfer1-Dec-03 21:35 
AnswerRe: How can I override CPropertySheet::RemovePage(int nPage) in a derived class? Pin
Kene1-Dec-03 22:19
Kene1-Dec-03 22:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.