View Single Post
Old 2nd August 2019, 16:25   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,166
SS_BLACKRECT is a Static control style.

Windows does not allow you to modify the border colors of standard controls, you would need a custom plug-in.

You can put another control behind it though:

Quote:
!include nsDialogs.nsh
Function MyCustomPageCreate
nsDialogs::Create 1044
Pop $0

${NSD_CreateText} 1u 20u 144u 12u "something"
Pop $1

${NSD_CreateLabel} 0u 19u 146u 14u ""
Pop $2
SetCtlColors $2 ff0000 ff0000

; If the above control is not accurate enough you can set the exact pixel size:
System::Call 'USER32::GetWindowRect(p$1, @r3)' ; NSIS 3+
System::Call '*$3(i.r4, i.r5, i.r6, i.r7)'
IntOp $6 $6 - $4
IntOp $7 $7 - $5
System::Call 'USER32::MapWindowPoints(p0, p$hwndParent, p$3, i 1)i.r9'
System::Call '*$3(i.r4, i.r5)'
!define PXBORDERSIZE 1
!define /math PXBORDERSIZEDOUBLE ${PXBORDERSIZE} * 2
IntOp $4 $4 - ${PXBORDERSIZE}
IntOp $5 $5 - ${PXBORDERSIZE}
IntOp $6 $6 + ${PXBORDERSIZEDOUBLE}
IntOp $7 $7 + ${PXBORDERSIZEDOUBLE}
System::Call 'USER32::SetWindowPos(p$2, p0, i $4, i $5, i $6, i $7, i 0x14)'

nsDialogs::Show
FunctionEnd
If you want to mark invalid input I would maybe use a red exclamation triangle icon instead...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote