Aigh so instead of doing all the new coding dealing with indexes and stuff, I went back to the old days ehheh
- Code: Select all
Dim iHnd As Long
Dim parent, child, alt, rich20 As Long
Dim res&, sel&, start_pos&, end_pos&, txt_len&
'iHnd = getPalSubForm(Form1.WindowClass, Form1.Combo1.Text, Form1.RoomOutboundTextBoxClass, Form1.SendTxtIndex)
On Error Resume Next
'disable editing, may not be needed
Call EnableWindow(iHnd, 0)
'Copy Text that has been typed in if any
parent = FindWindow("DlgGroupChat Window Class", Form1.Combo1.Text)
child = FindWindowEx(parent, 0, "WTL_SplitterWindow", vbNullString)
child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
alt = GetWindow(child, GW_Child)
alt = GetWindow(alt, GW_HWNDNEXT)
alt = FindWindowEx(alt, 0, "atlaxwin71", vbNullString)
alt = FindWindowEx(alt, 0, "#32770", vbNullString)
iHnd = FindWindowEx(alt, 0, "RichEdit20A", vbNullString)
iHnd = FindWindowEx(alt, iHnd, "RichEdit20A", vbNullString)
txt_len& = SendMessage(iHnd, WM_GETTEXTLENGTH, 0, 0)
If txt_len& > 0 Then ' don't need all this if user not typing
' save user selection / cursor position
Call SendMessage(iHnd, EM_GETSEL, ByVal VarPtr(start_pos&), ByVal VarPtr(end_pos&))
' select all text and cut
res = SendMessage(iHnd, EM_SETSEL, 0, ByVal txt_len&)
res = SendMessage(iHnd, WM_CUT, 0, 0)
End If
parent = FindWindow("DlgGroupChat Window Class", Form1.Combo1.Text)
child = FindWindowEx(parent, 0, "WTL_SplitterWindow", vbNullString)
child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
child = FindWindowEx(child, 0, "WTL_SplitterWindow", vbNullString)
alt = GetWindow(child, GW_Child)
alt = GetWindow(alt, GW_HWNDNEXT)
alt = FindWindowEx(alt, 0, "atlaxwin71", vbNullString)
alt = FindWindowEx(alt, 0, "#32770", vbNullString)
iHnd = FindWindowEx(alt, 0, "RichEdit20A", vbNullString)
iHnd = FindWindowEx(alt, iHnd, "RichEdit20A", vbNullString)
Call SendMessageSTRING(iHnd, WM_SETTEXT, 0&, Text$)
Call SendMessageLong(iHnd, WM_KEYDOWN, 13, 0&)
'Send any typing back to box
If txt_len& > 0 Then
' text box is empty, paste saved text
res& = SendMessage(iHnd, WM_PASTE, 0, 0)
' restore selection / cursor position
res& = SendMessage(iHnd, EM_SETSEL, start_pos&, ByVal end_pos&)
End If
'enable editing
Call EnableWindow(iHnd, 1)








