Hello,
I've a trouble to grab the text from a multiline editbox.
Basically, I use the following command to get it :
But i can't get anything in my buffer. Is EM_GETSELTEXT valid for a multiline editbox ? I though
it was, but I didn't found confirmation of this on msdn. Shall I better do that from a RichEdit control
or did I missed something ?
I ran it through Olly, the message EM_SETSEL seem to work fine, Olly didn't recognize EM_GETSELTEXT
(he send 43E as message), but appart that the function return 0 caracters copied. Have also trying
WM_GETTEXT without result......
Regards
etherlord
I've a trouble to grab the text from a multiline editbox.
Basically, I use the following command to get it :
.data
LongText db 1024 dup(?)
......
.code
.......
; selectionne le contenu de l'edit box
invoke SendMessage,IDC_EDT4,EM_SETSEL,0,-1
; copie le contenu de l'editbox
invoke SendMessage,IDC_EDT4,EM_GETSELTEXT,0,addr LongText
But i can't get anything in my buffer. Is EM_GETSELTEXT valid for a multiline editbox ? I though
it was, but I didn't found confirmation of this on msdn. Shall I better do that from a RichEdit control
or did I missed something ?
I ran it through Olly, the message EM_SETSEL seem to work fine, Olly didn't recognize EM_GETSELTEXT
(he send 43E as message), but appart that the function return 0 caracters copied. Have also trying
WM_GETTEXT without result......
Regards
etherlord
Hi etherlord
Seem like you are using the ID not the controls handle.
To get the handle use GetDlgItem.
Or you can use SendDlgItemMessage instead.
KetilO
Seem like you are using the ID not the controls handle.
To get the handle use GetDlgItem.
invoke GetDlgItem,hWnd,IDC_EDT4
invoke SendMessage,eax,EM_SETSEL,0,-1
Or you can use SendDlgItemMessage instead.
KetilO
Yeah, you are right, I was not using the handle.
Currently this does not make it work better, so I think I'll have to
make a single app that does just that to see where I've missed
something...
Thanks for your help
etherlord
Currently this does not make it work better, so I think I'll have to
make a single app that does just that to see where I've missed
something...
Thanks for your help
etherlord
Invoke SendDlgItemMessage, hWnd, IDC_EDT4, EM_SETSEL, 0, -1
Invoke SendDlgItemMessage, hWnd, IDC_EDT4, EM_GETSELTEXT, 0, ADDR LongText
is more on what you are looking for, but I prefer:
Invoke GetDlgItemText, hWnd, IDC_EDT4, ADDR LongText, SIZEOF LongText
But to each their own :)
Regards,
Bryant Keller (aka Synfire)
Hi etherlord
EM_GETSELTEXT might only work with richedit. If you want all the text in the editcontrol then Synfire has the solution.
KetilO
EM_GETSELTEXT might only work with richedit. If you want all the text in the editcontrol then Synfire has the solution.
KetilO
Thanks for the help you two, Synfire prefered solution work perfectly ;)
Regards
etherlord
Regards
etherlord