TextBackgroundColor := 0x404040			
TextBackgroundBrush := DllCall("CreateSolidBrush", UInt, TextBackgroundColor)	

; 64 位脚本必须调用 SetWindowLongPtr 代替 SetWindowLong:
SetWindowLong := A_PtrSize=8 ? "SetWindowLongPtr" : "SetWindowLong"
				 
WindowProcNew := RegisterCallback("WindowProc", "" , 4, covertextid)  
; 使用了 EventInfo 参数时必须明确指定 ParamCount.
 ; 指定 "" 来避免子类化中使用快速模式.

WindowProcOld := DllCall(SetWindowLong, Ptr, TheGuiID, Int, -4, Ptr, WindowProcNew, Ptr)
; -4 是 GWL_WNDPROC
; 返回值必须设置为 Ptr 或 UPtr 而不是 Int.  
					

其中 TheGuiID为当前控件所在窗口的ID,covertextID表示需要自定义颜色控件的ID

可以在gui, add, text, hwndcovertxtID 在生成控件的时候直接赋值。