01-29-2013, 06:56 PM
If DT_SetTextColor used, dialog procedure does not receive WM_CTLCOLORSTATIC messages. Don't remember why, probably there is a reason.
If you need WM_CTLCOLORSTATIC and text color, don't use DT_SetTextColor. It's easy to set color on WM_CTLCOLORSTATIC with SetTextColor.
Function Dialog610
If you need WM_CTLCOLORSTATIC and text color, don't use DT_SetTextColor. It's easy to set color on WM_CTLCOLORSTATIC with SetTextColor.
Function Dialog610
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;BEGIN DIALOG
;0 "" 0x90CB0AC8 0x0 0 0 223 135 "Dialog"
;3 Static 0x54000081 0x20 24 62 46 12 "Text1"
;4 Static 0x50000101 0x100020 78 28 48 13 "Text2"
;5 msctls_progress32 0x54030000 0x0 56 28 100 13 ""
;6 ListBox 0x54230101 0x200 0 44 96 48 ""
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030407 "" "" "" ""
if(!ShowDialog("" &Dialog610)) ret
ret
;messages
sel message
,case WM_INITDIALOG
,/DT_SetBackgroundColor2(hDlg 0 0xFFFFFF)
,;DT_SetTextColor(hDlg 0x0000FF "4")
,;DT_SetTextColor(hDlg 0xFF0000 "3")
,
,case WM_CTLCOLORSTATIC
,int cid col
,cid=GetWinId(lParam)
,sel cid
,,case [3,4]
,,sel cid
,,,case 3 col=0xFF0000
,,,case 4 col=0x0000FF
,,SetTextColor wParam col
,,SetBkMode wParam TRANSPARENT
,,ret GetStockObject(NULL_BRUSH) ;;transparent brush
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1