- This topic has 4 replies, 5 voices, and was last updated 16 years ago by Departure.
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
June 14, 2007 at 5:26 pm #187848autopilotMember
This is thanks to Chike:
To get the current typed text use the following:
'disable editing, may not be needed Call EnableWindow(RichEdit20AHnd, 0) 'Copy Text that has been typed in if any txt_len& = SendMessage(RichEdit20AHnd, 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(RichEdit20AHnd, EM_GETSEL, ByVal VarPtr(start_pos&), ByVal VarPtr(end_pos&)) ' select all text and cut res = SendMessage(RichEdit20AHnd, EM_SETSEL, 0, ByVal txt_len&) res = SendMessage(RichEdit20AHnd, WM_CUT, 0, 0) End If` Insert your code to send text to pal room... May look like the following:` 'Send Text to room Call SendMessageByString(RichEdit20AHnd, WM_SETTEXT, 0&, Text1.Text) Call SendMessage(RichEdit20AHnd, WM_KEYDOWN, 13, 0)` Then restore the user text with the following:` 'Send any typing back to box If txt_len& > 0 Then ' text box is empty, paste saved text res& = SendMessage(RichEdit20AHnd, WM_PASTE, 0, 0) ' restore selection / cursor position res& = SendMessage(RichEdit20AHnd, EM_SETSEL, start_pos&, ByVal end_pos&) End If 'enable editing Call EnableWindow(RichEdit20AHnd, 1)
Again Thank you Chike
July 31, 2007 at 1:09 am #187852DepartureMemberyes very good, After a few little modifycations to the code it works perfect, thank you and i’ll proberly use this in any new programs I do..
October 1, 2007 at 12:12 pm #187851jimmyngMembercannot get it wok
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) rich20 = FindWindowEx(alt, 0, "RichEdit20A", vbNullString) rich20 = FindWindowEx(alt, rich20, "RichEdit20A", vbNullString) Call SendMessageSTRING(rich20, WM_SETTEXT, 0&, Text$) Call SendMessageLong(rich20, WM_KEYDOWN, 13, 0&)
please help
October 1, 2007 at 7:28 pm #187850ChikeMemberSould be simple. However depending on how SendMessage is defined it may require some changes, and of course you need to define EnableWindow and maybe some other constants.
September 22, 2008 at 2:05 am #187849AhFoxMemberVery nice … thanks … works like charm !
-
AuthorPosts
Related
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.