I've made a little text editor using RichEdit, but i have a problem with cut/copy/paste function. If I cut or copy something and i close the prog, the cut/copy data is lost. How can i bypass this ?
Posted on 2000-12-05 07:04:00 by (scalp)
I'm just guessing here, but I would assume you should copy the text to the windows 'clipboard' - which is a shared area, that can be used by any process (?) I assume, at the moment, you are copying the text to your own memory area - which will be lost when you close the program. (Don't ask me how to use the clipboard though :))
Posted on 2000-12-05 08:04:00 by Tedd
You can find a really nice example on Iczelion's site: http://members.nbci.com/_XMCM/winasm/source.html --4oh4
Posted on 2000-12-05 10:06:00 by 4oh4
You can find a really nice example on Iczelion's site: http://members.nbci.com/_XMCM/winasm/source.html --4oh4
Posted on 2000-12-05 10:09:00 by 4oh4
Make sure you destroy your RichEdit window before you exit your program. "INVOKE DestroyWindow, hxxxxxx" Ewayne
Posted on 2000-12-05 13:06:00 by Ewayne
i don't really see why destroying the window could help me...
Posted on 2000-12-05 14:53:00 by (scalp)
.....i dont know too, but perhaps the richedit control send a message to windows to store the copied or cut into the windows clipboard when its destroyed. but dont ask me. ;-)
Posted on 2000-12-05 15:12:00 by [SaFc0n]
Just took this directly out of a rich text editor, works fine, no need to destroy the window. .elseif wParam == 1100 invoke SendMessage,hRichEd,EM_UNDO,0,0 .elseif wParam == 1101 invoke SendMessage,hRichEd,WM_CUT,0,0 .elseif wParam == 1102 invoke SendMessage,hRichEd,WM_COPY,0,0 .elseif wParam == 1103 invoke SendMessage,hRichEd,EM_PASTESPECIAL,CF_TEXT,0 .elseif wParam == 1104 invoke SendMessage,hRichEd,WM_CLEAR,0,0 Regards, hutch@pbq.com.au
Posted on 2000-12-05 15:15:00 by hutch--
I meant to destroy the parent window. The DestroyWindow function removes clipboard ownership, and breaks the clipboard viewer chain. It's posible that without the DestroyWindow function the clipboard data from the Cut, Copy is still owned by that window and other applications can not access that data. I know different versions of the RichEdit behave differently. I have several RichEdit editor programs and if I don't Destroy the parent window on exit I do not retain the clipboard data. If you would like, I could send you one of my edit programs. Ewayne
Posted on 2000-12-05 19:28:00 by Ewayne
ok, now i understand ! and yes if you want to, u can send me what u did ! my prog is at : scalper.cjb.net/sPad/ if u want
Posted on 2000-12-06 04:02:00 by (scalp)