IonicWind Software

IWBasic => General Questions => Topic started by: AdrianFox on November 26, 2013, 05:22:55 AM

Title: Hex colors with SendMessage
Post by: AdrianFox on November 26, 2013, 05:22:55 AM
Just a very simple and probably stupid sounding  'newbie' question, but I seem to be stuck on this.

SENDMESSAGE win.hWnd,0x1026,0,0xFCDC3B,12:'Set text background colour

is not producing the results I expect.  (That is not the right color)

I am unclear about using the hex code to set the colors in the above line.

I am changing the hex code which is the penultimate parameter. LPARAM (eg 0xFDC3B) using hex color codes I found on a website.  But I am not getting the color I expect .

Using the syntax for SendMessage:  UINT = SENDMESSAGE(win as ANYTYPE, msg as UINT, wparam as UINT,lparam as ANYTYPE,OPT id=0 as UINT),  I must admit I don't understand what data is being passed in the msg (0x1026) or which parameter the 0 following is either.  Are these parameters affecting the color I get with the Lparam, which I assume is the color,  or am I just using the wrong hex codes?

Could someone point me to where I could read more about this to arrive at an understanding of what is happening here?

Thanks,

 
Title: Re: Hex colors with SendMessage
Post by: LarryMc on November 26, 2013, 05:36:22 AM
What kind of control is 12, the control you are trying to change the background color of?
Title: Re: Hex colors with SendMessage
Post by: LarryMc on November 26, 2013, 05:38:31 AM
I don't know where you got your hex number from but try changing 0xFCDC3B to 0x3BDCFC and see if you get the color you want.
Title: Re: Hex colors with SendMessage
Post by: billhsln on November 26, 2013, 05:44:59 AM
This should explain the 1026 at least.

/* Set text colour */
SENDMESSAGE d1.hWnd,0x1024,0,0x000000,D1_LV
/* Set text background colour */
SENDMESSAGE d1.hWnd,0x1026,0,0xFFDF00,D1_LV
/* Set background colour */
SENDMESSAGE d1.hWnd,0x1001,0,0xF78000,D1_LV

Text color = 1024, text background = 1026 and background color = 1001.

Bill
Title: Re: Hex colors with SendMessage
Post by: AdrianFox on November 26, 2013, 05:54:38 AM
Thanks both Larry and Bill.   The control is a Listview and I am simply trying to modify what I think is Bill's csv file reader.  I see how the wparam and lparams work now....