|
-
Apr 20th, 2002, 07:41 AM
#1
Thread Starter
Lively Member
change backcolor of a dialog
how to change the backcolor of a dialog?
VIP
-
Apr 23rd, 2002, 07:51 AM
#2
Try using SetWindowLong to set the background handle. Not sure if it will work, it just comes to my mind.
Else you might want to catch the WM_ERASEBKGRND message
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 23rd, 2002, 09:00 AM
#3
Thread Starter
Lively Member
how to find the background handle?
-
Apr 23rd, 2002, 10:05 AM
#4
SetClassLong(hDlg, GCL_HBRBACKGROUND, hNewBrush);
You must first create the new brush somehow.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 23rd, 2002, 10:23 AM
#5
Thread Starter
Lively Member
If I use a brush it gives the error:
'Cannot convert parrameter 3 from CBrush to long'
so I used RGB(0,0,0) but then the color of the dialog doesn't change. I places the code in the Paint function.
what's wrong?
-
Apr 23rd, 2002, 10:48 AM
#6
Use
br.GetSafeHandle();
And don't place the code in OnPaint but rather in OnCreate.
I still can't guarantee it will work.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 23rd, 2002, 11:20 AM
#7
Thread Starter
Lively Member
it doesn't work
-
Apr 23rd, 2002, 12:42 PM
#8
Search for CWnd::OnEraseBkgnd in the reference. This is what you need then.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 23rd, 2002, 02:17 PM
#9
Thread Starter
Lively Member
isn't in the list 
the dialog created with MFC is a CWnd Class? isn't it?
VIP
-
Apr 23rd, 2002, 02:22 PM
#10
CDialog is derived from CWnd
Search for WM_ERASEBKGND and then choose CWnd::OnEraseBkgnd from the popup window.
Basically this function is called so you can erase the background of your window. Simply draw in whatever color you want to.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 23rd, 2002, 02:29 PM
#11
Thread Starter
Lively Member
I'm sorry, but it really isn't in the list, it goes from WM_DRAWITEM to WM_HELPINFO.
-
Apr 23rd, 2002, 03:30 PM
#12
Download the newest SDK, you're misssing not only WM_ERASEBKGND but also
WM_DROPFILES, WM_ENDSESSION, WM_ENTERIDLE and many others...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 25th, 2002, 07:10 AM
#13
Thread Starter
Lively Member
which one? there are more than one.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|