|
|
Terms of Agreement:
By using this article, you agree to the following terms...
1) You may use
this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description. | // insert this code into your dialog's W
// inProc code
case WM_CTLCOLORDLG:
// case WM_CTLCOLORSTATIC:
LOGBRUSH lb;
static HBRUSH hBrush;
lb.lbColor = RGB(0,0,0);
lb.lbStyle = 0;
hBrush = CreateBrushIndirect(&lb;);
return (int)hBrush;
break;
| |
|
Report Bad Submission |
|
|
Your Vote! |
See Voting Log |
|
Other User Comments |
2/9/2004 9:55:30 PM:Danny J psc stripped my newline tags....
|
2/9/2004 9:59:34 PM:Danny J fixed the newline taggs, but your going
to have to tab it yourself...
If you
need help with C++, I'm open on MSN
|
2/10/2004 6:04:45 PM:Wolf McCloud Well, no problem. I posted it long time
ago and I see it helped some people.
I'm no newb anymore and I do much more
complicated stuff, but it is always
good to remember how to do basic
things. Also, you should use
CreateSolidBrush(color);
|
2/13/2004 3:53:01 PM: I have looked for 4 hours how to do
this. I have been through many
tutorials and google groups. Thanks so
much. It worked like a charm. All I
could find was mfc stuff. Thanks
again.
Shawn
Nedwidek
smn4780@cs.rit.edu
|
2/13/2004 4:01:47 PM: Not sure if the last message went
through but I just wanted to thank you.
I have spent many hours looking how to
do this but could only find mfc. You
rock. Thanks again
|
2/13/2004 7:51:08 PM:Danny J I was in your shoes before. But after
finding some kind of code (maybe C), I
thought of how it was used in
lpszBackground, and how you could use
CreateBrushIndirect() to use a
different color rather white, grey,
black. I'm making a new submission on
common controls, so get ready.
|
2/14/2004 11:06:03 PM: is C++ software like VB??
|
2/15/2004 1:58:28 PM:Danny J C++ is very different from Visual
Basic. First, it does not feature any
RAD(ical) tools, most of everything in
C++ has to be defined in code. In C++,
you use APIs much more than STD, the
main Win32 framework.
|
2/15/2004 3:14:56 PM:Wolf McCloud For newbies... Rapid Application
Developpement (RAD)... Advanced
Programming Interfac (API)... I don't
know and I don't care about what STD
means =P correct me if I'm wrong.
|
2/15/2004 3:15:36 PM:Wolf McCloud Danny, you should use CreateSolidBrush,
which is a faster way to create a
brush, since it does not require a
LOGBRUSH.
|
2/15/2004 3:39:46 PM:Danny J If you want to use styles, LOGBRUSH is
anyones answer.
|
2/15/2004 10:16:03 PM:Wolf McCloud Yea, but if you don't, like you are
showing on the example,
CreateSolidBrush is. Both ways are
great. Anyways, I never, or rarely, use
dialogs.
|
2/15/2004 10:17:49 PM:Wolf McCloud You do no need a break; if you
have return (int)hBrush;
|
2/18/2004 6:34:08 PM: Yes you do need the break. The break
keyword is what tells the program to
leave the switch statement. Without it,
after that one message is processed,
the program will go back to switch
statement and will try to process
another case. Since you cannot have the
same value case in the same switch
statement, the program will go through
the entire statement until it reaches
the end. If the break keyword is
implemented, though, the program will
leave the switch statement and go on
normally. It really doesn't make a
difference, but if you're talking
sufficient coding, you need the break.
|
2/18/2004 6:35:22 PM: If you need more help, look up 'switch
statements' on MSDN for more
information on this small technicallity.
|
3/1/2004 8:13:05 PM:Jon braud Wolf, API means Application programming
Interface.
|
|
Add Your Feedback! |
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.
NOTICE: The author of this article has been kind enough to share it with you. If you have a criticism, please state it politely or it will be deleted.
For feedback not related to this particular article, please click here. |
|