Well, I kinda have a problem, I'm trying to append a rich text box, The text gets sent, but it is always the color of the background, so I can't see it.
How would you specify the color of the text when using SendMessage() to append it.
Dim X As CharFormat
X.cbSize = LenB(X)
X.crTextColor = vbRed
X.dwMask = CFM_COLOR
A = SendMessage(Z, WM_GETTEXTLENGTH, 0, 0) + 1
SendMessage Z, EM_SETSEL, A, 1
SendMessage Z, EM_SETCHARFORMAT, SCF_SELECTION, ByVal X
SendMessage Z, EM_REPLACESEL, 0, ByVal "Testing" & vbNewLine
SendMessage Z, EM_SCROLL, SB_LINEDOWN, 0
All of the constants are there proper formats, as far as I know:
Private Const WM_GETTEXTLENGTH As Long = &HE
Private Const EM_SETSEL& = &HB1
Private Const EM_REPLACESEL& = &HC2
Private Const EM_SCROLL& = &HB5
Private Const SB_LINEDOWN& = 1
Private Const SCF_SELECTION& = 1
Private Const EM_SETCHARFORMAT& = &H444
Private Const EM_GETCHARFORMAT& = &H43A
Private Const CFM_COLOR& = &H40000000
Private Type CharFormat
cbSize As Long
dwMask As Long
dwEffects As Long
yHeight As Long
yOffset As Long
crTextColor As Long
bCharSet As Byte
bPitchAndFamily As Byte
szFaceName(32) As Byte
End Type
Z of corse is the handle for the RTB.
But please, Don't think I don't know how to use .SelColor -.- its not the point of this program, the point is to do it via sendmessage, for experiance.
Unless you know a way of Java using the SendMessage/FindWindow/FindWindowEx APis, it needs to be in VB, BTW, it does NOT have to be cross platform of corse
~-~(HDX)~-~