Make an editor gadget transparent (richedit)
Posted: Fri Dec 14, 2007 8:28 pm
The following procedure I happen to use on a little project of mine, where I have a richedit required to have a transparent background (because the window has an image background!)
It works just fine, make sure theres something on the back redrawing, if not your editor gadget won't have a background at all and thus it wont redraw.
(if someone could help me improve my function, that'd be nice!)
The old style is returned by the procedure, in case you want to revert it back.
Sorry if this was already posted, I just couldn't find it on the forums so I had to write my own. (I did find a code by Sparkie but it wasn't redrawing and it required quite a few hacks just to render a background image)
Code: Select all
Procedure.l hWndTransparent( hWnd.l )
Define.l lwTemp
#WS_EX_TRANSPARENT = $20
lwTemp = GetWindowLong_(hWnd, #GWL_STYLE)
SetWindowLong_(hWnd, #GWL_EXSTYLE, lwTemp | #WS_EX_TRANSPARENT)
ProcedureReturn lwTemp
EndProcedure
(if someone could help me improve my function, that'd be nice!)
The old style is returned by the procedure, in case you want to revert it back.
Sorry if this was already posted, I just couldn't find it on the forums so I had to write my own. (I did find a code by Sparkie but it wasn't redrawing and it required quite a few hacks just to render a background image)