08-29-2020, 12:51 AM
after taking another look at this
these lines can be eliminated
__GdiHandle- t_hbrush
int backcolor_at_start=0xffffff
,t_hbrush=CreateSolidBrush(backcolor_at_start)
and instead use
for the edit control
full code
these lines can be eliminated
__GdiHandle- t_hbrush
int backcolor_at_start=0xffffff
,t_hbrush=CreateSolidBrush(backcolor_at_start)
and instead use
for the edit control
full code
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Button 0x54032000 0x0 95 80 48 14 "Button"
;4 Edit 0x54231044 0x200 30 10 152 22 ""
;5 Static 0x54000000 0x0 90 40 48 12 "TEST"
;END DIALOG
;DIALOG EDITOR: "" 0x2040A00 "*" "" "" ""
str controls = "4"
str e4="TEST"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,int- col_1;col_1=ColorFromRGB(255 10 120)
,int- col_2;col_2=ColorFromRGB(0 110 120) ;; NEW COLOR
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case [WM_CTLCOLORSTATIC,WM_CTLCOLOREDIT] ;; WM_CTLCOLORLISTBOX not used in this example
,if(lParam=id(4 hDlg))
,,SetBkMode wParam TRANSPARENT
,,SetTextColor wParam col_1
,,ret GetStockObject(DC_BRUSH)
,if(lParam=id(5 hDlg))
,,SetBkMode wParam TRANSPARENT
,,SetTextColor wParam col_1
,,ret GetStockObject(NULL_BRUSH)
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 3
,col_1=col_2
,RedrawWindow(id(4 hDlg) 0 0 RDW_INVALIDATE) ;; redraw control editfield
,RedrawWindow(id(5 hDlg) 0 0 RDW_INVALIDATE) ;; redraw control statc
ret 1