Skip to content
⌘ NSIS Forum Archive

Problem in EM_SETBKGNDCOLOR

2 posts

r2du-soft#

Problem in EM_SETBKGNDCOLOR

hi
i have problem with change the RichEdit color:

In principle Color 0x008899 a range of blue, but when i set RichEdit color to 0x008899 i see the yellow color.



!include "MUI2.nsh"

!insertmacro MUI_LANGUAGE English
Page Custom nsDialogsPage



Function nsDialogsPage

	  nsDialogs::Create 1018
	  Pop $0
	  ${IF} $0 == error
		Abort
	  ${EndIF}


	${NSD_CreateRichEdit} 0 0 753 340 "" 
	Pop $0
	SendMessage $0 ${EM_SETBKGNDCOLOR} 0 0x008899
	# Color 008899 is Blue but show yellow

	nsDialogs::Show
FunctionEnd


Section
SectionEnd

but if i Reverse color From the last to the first: 0x008899 to 0x998800
and set that i see the blue color
what is the problem?
Anders#
No problem, the parameter is a COLORREF, not just hex RGB.

When specifying an explicit RGB color, the COLORREF value has the following hexadecimal form:

0x00bbggrr

The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue.