hello
i'm trying to make an edit box control with a specified background
(bmp image)
could any one direct me how to do it?

thanks
Posted on 2002-07-09 13:48:16 by arkon
CreatePatternBrush, WM_CTLCOLOREDIT.
Posted on 2002-07-09 14:13:36 by comrade
it tried it doesn't work
maybe you can show some piece of (working) code?
or you wanna see mine first?

thanks!
Posted on 2002-07-23 14:20:53 by arkon
use STM_SETIMAGE in a "SendMessage" call to you static control! this should work!

bye
Posted on 2002-07-23 14:24:24 by NOP-erator
ooops, sorry.. you wanted to set an background image to an edit control..

erm.. how about drawing the control yourself?

don't ask me how to do that :tongue: , i just know that it's possible. just look for owner drawn controls..

hope that helps somehow..

bye
Posted on 2002-07-23 14:25:36 by NOP-erator
What Comrade is getting at:



WinProc PROC hWin,uMsg,wParam,lParam:DWORD
mov eax,uMsg
cmp eax,WM_CTLCOLOREDIT
je @@CtlColorEdit
cmp eax,WM_CREATE
je @@Create
cmp eax,WM_DESTROY
je @@Destroy
...
invoke DefWindowProc,hWin,uMsg,wParam,lParam
ret
...
@@CtlColorEdit:
mov eax,EditBackgrondBrush
ret
@@Create:
invoke CreatePatternBrush,hBitmap
mov EditBackgroundBrush,eax
ret
@@Destroy:
invoke DeleteObject,EditBackgroundBrush
ret
WinProc ENDP



You should check MSDN for the CreatePatternBrush API and WM_CTLCOLOREDIT window message. You would find that an edit control sends a WM_CTLCOLOREDIT message to it's parent before it erases it's background to determine which brush to use to paint the background. If you handle this message, pass it a brush made from CreatePatternBrush in eax.

--Chorus
Posted on 2002-07-23 14:47:47 by chorus
IIRC, KetilO tried to do this some time ago, the source code was posted, it only has a bit of flickering I think : search the board to find it.
Posted on 2002-07-23 14:52:40 by JCP
alright, i see

well, can i do static box with scrolling?
cuz, if so, is solves the whole problem..

i was trying the createpatternbrush - the problem is that when you scroll in the edit box, the bkg is scrolled as well....so it scrambles too
i have to make it fixed some how..


and i don't wanna write my own control...altough it shouldn't be hard, but there have to be a way to do it!

thanks
Posted on 2002-07-24 12:00:03 by arkon