I using the code listed below to automatically select and copy
all the text from a specified edit control (text or rich-text),
but it doesn't work with either the PBDLL editor or UltraEdit 7.
Does anyone know how I could provide the means of reliably
selecting and copy text from most any edit control? PGP 7.0
offers this type of function to encrypt and/or decrypt text from
what it refers to as the "current window". Any ideas on how
this could be done from PBDLL?
Thanks,
Doug
------------------
all the text from a specified edit control (text or rich-text),
but it doesn't work with either the PBDLL editor or UltraEdit 7.
Does anyone know how I could provide the means of reliably
selecting and copy text from most any edit control? PGP 7.0
offers this type of function to encrypt and/or decrypt text from
what it refers to as the "current window". Any ideas on how
this could be done from PBDLL?
Code:
' ' Load Clipboard From Selected Text or Rich-Text Edit Control ' SUB Txb2ClipBrd(hTXB AS LONG) ' hTXB = Handle to edit control ' ' Create Local Variables ' LOCAL i AS LONG LOCAL Stt AS LONG LOCAL Stp AS LONG LOCAL sClass AS STRING LOCAL selData AS CHARRANGE ' ' Display Class Name (For DEBUG Only!!!) ' ' sClass = STRING$(51,0) ' GetClassName hTXB, BYVAL STRPTR(sClass), 50 ' MSGBOX sClass ' ' Select Text ' SendMessage hTXB, %EM_SETSEL, 0, -1 ' ' Check For Selected Text ' SendMessage hTXB, %EM_GETSEL, VARPTR(Stt), VARPTR(Stp) ' ' Display Selected Patameters (For DEBUG Only!!!) ' ' MSGBOX "Stt = " & FORMAT$(Stt) & CHR$(13,13) & "Stp = " & FORMAT$(Stp) ' ' Textbox Failed, Try RichEdit ' IF Stt = -1 THEN ' ' Get Number Of Characters To Copy ' i = SendMessage(hTXB, %WM_GETTEXTLENGTH, 0, 0) IF i = 0 THEN EXIT SUB ' ' Select Rich-Text ' selData.cpMin = 0 SelData.cpMax = i - 1 SendMessage hTXB, %EM_EXSETSEL, 0, VARPTR(selData) END IF ' ' Empty Clipboard First ' ClearClipboard ' ' Copy Text ' SendMessage hTXB, %WM_COPY, 0, 0 END SUB
Doug
------------------
Comment