i've got an problem with edit control..... see your self couse i do not know how to explain this.
what i want to do is disable that what U see on the picture and do a normal refreshing or some other thing 'couse i dont even know why it acts like that. i'm not very good at gdi and maybe some of U guys met such problem and know how to remove it.
thx for any help
cya
what i want to do is disable that what U see on the picture and do a normal refreshing or some other thing 'couse i dont even know why it acts like that. i'm not very good at gdi and maybe some of U guys met such problem and know how to remove it.
thx for any help
cya
I can't be sure without seeing some code, but I've had similar results when I override the painting methods of a control, and accidentally disable "background erase". Things to check:
[*] Are you repainting the control with InvalidateRect? If so, make sure you're sending TRUE as the bErase parameter.
[*] Are you trapping window messages by hand? If so, make sure WM_ERASEBKGND is being handled properly. If you're not handling it, make sure it's being forwarded to DefWindowProc.
[*] Are you double-buffering the control by painting to a memory DC and then blitting? If you are, you could be drawing the source image wrong... if you're caching the image and then or'ing the text over it, that would be highly suspect.
[*] Any of a zillion other possibilities... post some code!
Good luck,
-Chalain
and here's the source code
ohh... and i work on win98
ohh... and i work on win98
Did you set the yellow font with SelectObject(hDC, hYellowFont)? If so use the WM_SETFONT, it should work (I hope :) ).
Edit:
Please don't consider my post. I take too much time to write my replies... I didn't see your source code and I thoght you have used a custom font for the edit box :rolleyes:
Edit:
Please don't consider my post. I take too much time to write my replies... I didn't see your source code and I thoght you have used a custom font for the edit box :rolleyes:
Nemo,
The problem is that you're not forwarding other messages. In the final .ELSE clause, you need to invoke DefWindowProc and return its return value rather than simply return false.
If you look at the bottom of the dialog, it's not repainting correctly, either. Try resizing your dialog, and/or swapping windows so that the dialog goes behind a window and then comes back and you'll see what I mean.
The major problem here is that you're dropping WM_PAINT messages; there will be other problems from less frequent messages as well.
Good luck,
-Chalain
The problem is that you're not forwarding other messages. In the final .ELSE clause, you need to invoke DefWindowProc and return its return value rather than simply return false.
If you look at the bottom of the dialog, it's not repainting correctly, either. Try resizing your dialog, and/or swapping windows so that the dialog goes behind a window and then comes back and you'll see what I mean.
The major problem here is that you're dropping WM_PAINT messages; there will be other problems from less frequent messages as well.
Good luck,
-Chalain
LuHa, no it did'nt help :(
but thx 4 reply
but thx 4 reply
Chalain, thnx for reply. i'll check your method later but with DefWindowProc U aren't right - with modeless or modal dialogbox we dont use DefWindowProc but the dialogbox proc should return TRUE if it processed the message, and FALSE if it didn't.
see Iczelion's Tutorial 10: Dialog Box as Main Window
cya & thx
see Iczelion's Tutorial 10: Dialog Box as Main Window
cya & thx
:o Ooops.
You're right. Okay, now I'm curious myself, and trying to get your project to build. I see a .rap file in there that looks like it drives some kind of make utility. How do you build this project?
Thanks,
-Chalain
You're right. Okay, now I'm curious myself, and trying to get your project to build. I see a .rap file in there that looks like it drives some kind of make utility. How do you build this project?
Thanks,
-Chalain
NEMO,
It's not easy to do the logic with edits.
Here is one simple way to do it,
I did example - you do the rest - cut from Rose bmp rect at the
same place as edit in the dialog and create second pattern brush from it to return it when WM_CTLCOLOREDIT.
And you'll get the picture and behavior for edit you wanted.
I used the same pattern as for dialog that's why whole picture looks mozaic in edit place.
It's not easy to do the logic with edits.
Here is one simple way to do it,
I did example - you do the rest - cut from Rose bmp rect at the
same place as edit in the dialog and create second pattern brush from it to return it when WM_CTLCOLOREDIT.
And you'll get the picture and behavior for edit you wanted.
I used the same pattern as for dialog that's why whole picture looks mozaic in edit place.
i use RadASM, and .rap file is its project file.
to download RadASM go here and d\l two first attachments.
to download RadASM go here and d\l two first attachments.
thx, it's solve my problem but with your post i see i need to learn much about GDI
does anyone know nay good tut about it?
cya
does anyone know nay good tut about it?
cya
NEMO, try creating the edit control with WS_EX_TRANSPARENT set,
if I read MSDN correctly the background will be redrawn before
the edit control is repainted. At least that's how I solved
transparency issues for my transparent label stuff.
if I read MSDN correctly the background will be redrawn before
the edit control is repainted. At least that's how I solved
transparency issues for my transparent label stuff.
f0dder, it can be used only with static, with edit it doesn't work.
And with static if you change text, it might lead to paintingover
effects.
I usually change existing text in static to zero and then to new text, when static is transparent and painted over some pattern or picture.
And with static if you change text, it might lead to paintingover
effects.
I usually change existing text in static to zero and then to new text, when static is transparent and painted over some pattern or picture.