03-29-2018, 01:48 PM
Need InvalidateRect or RedrawWindow.
Macro Macro3014
Macro Macro3014
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 222 128 "Dialog"
;3 Button 0x54032000 0x0 51 21 122 29 "Make editfield-backrgournd yellow"
;4 Edit 0x54231044 0x200 12 54 199 52 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2040601 "*" "" "" ""
str controls = "4"
str e4
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
#sub DlgProc
function# hDlg message wParam lParam
int-- t_edit
int-- t_backcolor
__GdiHandle-- t_hbrush
sel message
,case WM_INITDIALOG
,t_edit=id(4 hDlg)
,
,case WM_CTLCOLOREDIT
,if(t_hbrush and lParam=t_edit)
,,SetBkColor wParam t_backcolor ;;text background
,,ret t_hbrush ;;other background
,
,case WM_DESTROY
,t_hbrush.Delete
,
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 3
,;make background of editfield, yellow
,t_backcolor=0x00ffff
,t_hbrush.Delete
,t_hbrush=CreateSolidBrush(t_backcolor)
,InvalidateRect t_edit 0 0
ret 1