Hi!
I have made a Dialog. In this Dialog is a ES_MULTILINE EditControl. In this Control there is some text displayed. The EditControl has a Scroller at the side (WS_VSCROLL + ES_AUTOVSCROLL). The Text in the Editfield and the Dialog are colored with the following code:
.elseif uMsg == WM_CTLCOLORDLG
RGB 0,0,0
invoke SetBkColor,wParam,eax
invoke GetStockObject,BLACK_BRUSH
return eax
.elseif uMsg == WM_CTLCOLOREDIT
RGB 252,212,4
invoke SetTextColor,wParam,eax
invoke SetBkMode,wParam,TRANSPARENT
invoke GetStockObject,BLACK_BRUSH
return eax
If I now scroll the text down, then everything messes up, the text is displayed like sh.. and it looks like a big orange rectangle in the editfield, you can't read anything any longer.
Please can someone help me ?
thx...
P.S.: I used this Proc to subclass the Editcontrol, but even without everything went wrong:
EditSubCls PROC hCtl:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
.if uMsg == WM_CHAR ;that nobody can write something, just for not using ES_READONLY
.if wParam != 0
.if lParam != 0
invoke GetDlgItem,hWnd,EditID
invoke RedrawWindow,eax,NULL,NULL,RDW_INVALIDATE or RDW_ERASE
ret
.endif
.endif
.else
invoke CallWindowProc,hOldEditProc,hCtl,uMsg,wParam,lParam
ret
.endif
xor eax,eax
ret
EditSubCls ENDP
I have made a Dialog. In this Dialog is a ES_MULTILINE EditControl. In this Control there is some text displayed. The EditControl has a Scroller at the side (WS_VSCROLL + ES_AUTOVSCROLL). The Text in the Editfield and the Dialog are colored with the following code:
.elseif uMsg == WM_CTLCOLORDLG
RGB 0,0,0
invoke SetBkColor,wParam,eax
invoke GetStockObject,BLACK_BRUSH
return eax
.elseif uMsg == WM_CTLCOLOREDIT
RGB 252,212,4
invoke SetTextColor,wParam,eax
invoke SetBkMode,wParam,TRANSPARENT
invoke GetStockObject,BLACK_BRUSH
return eax
If I now scroll the text down, then everything messes up, the text is displayed like sh.. and it looks like a big orange rectangle in the editfield, you can't read anything any longer.
Please can someone help me ?
thx...
P.S.: I used this Proc to subclass the Editcontrol, but even without everything went wrong:
EditSubCls PROC hCtl:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
.if uMsg == WM_CHAR ;that nobody can write something, just for not using ES_READONLY
.if wParam != 0
.if lParam != 0
invoke GetDlgItem,hWnd,EditID
invoke RedrawWindow,eax,NULL,NULL,RDW_INVALIDATE or RDW_ERASE
ret
.endif
.endif
.else
invoke CallWindowProc,hOldEditProc,hCtl,uMsg,wParam,lParam
ret
.endif
xor eax,eax
ret
EditSubCls ENDP
invoke SetBkMode,wParam,TRANSPARENT
this is your problem. by using transparent text just the chars itselfs are drawn, but the text which was there before drawing isn't erased. so you must not use this attribute.