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
Posted on 2002-04-28 15:25:33 by NEMO
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,

Posted on 2002-04-28 15:36:19 by Chalain
and here's the source code
ohh... and i work on win98
Posted on 2002-04-28 15:37:37 by NEMO
Did you set the yellow font with SelectObject(hDC, hYellowFont)? If so use the WM_SETFONT, it should work (I hope :) ).

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:
Posted on 2002-04-28 15:42:38 by LuHa

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,

Posted on 2002-04-28 15:47:42 by Chalain
LuHa, no it did'nt help :(
but thx 4 reply
Posted on 2002-04-28 15:49:12 by NEMO
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
Posted on 2002-04-28 16:03:48 by NEMO
: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?


Posted on 2002-04-28 18:35:13 by Chalain
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.
Posted on 2002-04-28 19:25:44 by The Svin
i use RadASM, and .rap file is its project file.
to download RadASM go here and d\l two first attachments.
Posted on 2002-04-28 19:27:48 by NEMO
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?

Posted on 2002-04-28 19:39:23 by NEMO
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.
Posted on 2002-04-29 04:24:13 by f0dder
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
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.
Posted on 2002-04-29 12:42:49 by The Svin