You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
The edit control in the IDE is a custom control, not a standard control. I suspect many IDE's use a similar technique, hence the problem you describe arises.
I don't have any information on manipulating the IDE directly, sorry. Only R&D would have that information... you could write to
Maybe I'm missing something, but how does encrypting data have anything to do with the IDE, anyway?
Actually the code works with most edit controls (text and
rich-text), but fails with a few editors (like PBDLL and
UltraEdit). The SendMessage function seems to work fine once
I have the handle to the control in question (even if it is in
a different application). I'm hoping some member has had
experience with something simular and/or someone from
PowerBASIC (Lance or Dave?) can help with the routine working
with the PBDLL editor. Perhaps that will give me a clue to
making the code work with other edit controls.
Doug --
it looks that you want to copy a text, from a window, which doesn't belong to your app
(in this case SendMessage with addresses do not work).
If so, I think, there are two variants.
1) to attach keyboard focus to this window (not so simple, but possible), and to emulate Ctrl-A and Ctrl-C (using keybd_event).
2) to integrate own dll in each process using CBT-hook.
See, for example, my hook to monitor active windows.
Very simple, but it's necessary to worry about performance.
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?
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
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: