Page 1 of 1

Get marked text in an editor gadget

Posted: Tue Dec 30, 2003 7:35 pm
by willib
Hi all

I want to get the text that an user has marked in an editor gadget.

Does someone know how to begin. Maybe there is an easy way without
callback ( Windows should know because STRG C runs in PB, maybe API? )

My sys Win2000 SP3 PB3.8

best regards

Willi

Posted: Tue Dec 30, 2003 8:06 pm
by Karbon
Take a look at the #EM_GETSEL message..

http://msdn.microsoft.com/library/defau ... ntrols.asp

I can post an example of how to use it in a bit if you need it

Posted: Tue Dec 30, 2003 9:48 pm
by willib
thank you

let me try for a while to learn ....

Willi

Posted: Fri Jan 02, 2004 5:49 pm
by willib
Hi

I found out that

SendMessage_(GadgetID(0), #EM_GETSELTEXT,0,*Buffer )
a2$ = PeekS(*Buffer)
Debug a2$

runs , but in the win32-SDK-file they wrote The calling application must ensure that the buffer is large enough to hold the selected text.
For me it's ok because I know the maximum but normal I think you should get the real length with EM_GETSEL....

To make it easier for all, can you please put your example here ?

Willi