I re-explane the problem, if anybody don't understood it:
i have an RichEdit whose ID is rchNick in a window and i must change the format of the selected text to "Bold". Dt on the MsgPlus' IRC Channel suggest me to use the SendControlMessage, but i'm not very expert in Js than him made the code for me. The code is this:
code:
// The definition of the required windows api constants
var EM_SETCHARFORMAT = 1092;
var SCF_ALL = 4;
var SCF_SELECTION = 1;
var CFM_BOLD = 1;
var CFE_BOLD = 1;
var CFM_CHARSET = 0x8000000;
// I alloc the required structure and assign it the values, the structure is descripted here
var charFormat = Interop.Allocate(90);
charFormat.WriteDWORD(0, charFormat.Size); //cbSize
charFormat.WriteDWORD(4, CFM_BOLD); //dwMask
charFormat.WriteDWORD(8, CFE_BOLD); //dwEffects
//I send the message to the richEdit called "RchNick", the message SETCHARFORMAT is descripted here.
//The function DataPtr return a pointer to the structure charFormat.
//The function return a not-zero value if success.
var ret = Wnd.SendControlMessage("RchNick", EM_SETCHARFORMAT, SCF_SELECTION, charFormat.DataPtr);
Debug.Trace("Ret: " + ret);
The problem is: the function return 0 (error), but i can't define what is this error. The richEdit is rich because I fixed the previus problem (thanks to Eljay). I think is an error on the definition of the structure because i tried to send a message simplier than this and it works (than the function send the message)! I hope you can help me. Thanks.