What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » RichEdit: Formatting Text using SendMessage from the Windows' APIs

RichEdit: Formatting Text using SendMessage from the Windows' APIs
Author: Message:
whiles
New Member
*


Posts: 6
33 / Male / –
Joined: Aug 2006
O.P. RichEdit: Formatting Text using SendMessage from the Windows' APIs
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.

This post was edited on 08-27-2006 at 08:51 PM by whiles.
08-27-2006 08:50 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
RichEdit: Formatting Text using SendMessage from the Windows' APIs - by whiles on 08-25-2006 at 09:55 AM
RE: RichEdit looks like... not rich - by RaceProUK on 08-25-2006 at 10:25 AM
RE: RichEdit looks like... not rich - by Dempsey on 08-25-2006 at 10:31 AM
RE: RichEdit looks like... not rich - by Eljay on 08-25-2006 at 11:12 AM
RE: RichEdit looks like... not rich - by whiles on 08-25-2006 at 04:17 PM
RichEdit: Formatting Text using SendMessage from the Windows' APIs - by whiles on 08-26-2006 at 08:34 AM
RichEdit: Formatting Text using SendMessage from the Windows' APIs - by whiles on 08-27-2006 at 08:50 PM
RE: RichEdit: Formatting Text using SendMessage from the Windows' APIs - by matty on 08-27-2006 at 09:03 PM
RE: RE: RichEdit: Formatting Text using SendMessage from the Windows' APIs - by whiles on 08-28-2006 at 07:08 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On