Rafael Dipold 0 Posted October 11, 2022 Hi, Can anyone explain to me why this specific sequence of characters, when copying to clipboard and pasting to notepad, windows pastes memory garbage? If I change '42' to '32', for example, this issue not happen procedure TForm1.Button1Click(Sender: TObject); var C, R: TArray<String>; begin C := []; C := C + ['42']; C := C + ['N']; C := C + ['N']; C := C + ['=DOLLAR(4967.32, 2)']; C := C + ['=DOLLAR(1515.61, 2)']; C := C + ['=DOLLAR(0, 2)']; C := C + ['=DOLLAR(58054.89, 2)']; C := C + ['=DOLLAR(4084.55, 2)']; R := R + [''.Join(#9, C)]; Clipboard.AsText := ''.Join(#13#10, R); ShowMessage('Copy to Clipboard!'); end; Share this post Link to post
Uwe Raabe 2057 Posted October 11, 2022 10 minutes ago, Rafael Dipold said: when copying to clipboard and pasting to notepad, windows pastes memory garbage? What does that garbage look like? Share this post Link to post
Lajos Juhász 293 Posted October 11, 2022 I get: 42 N N =DOLLAR(4967.32, 2) =DOLLAR(1515.61, 2) =DOLLAR(0, 2) =DOLLAR(58054.89, 2) =DOLLAR(4084.55, 2) I cannot spot the garbage. Share this post Link to post
Rafael Dipold 0 Posted October 11, 2022 42 N N =DOLLAR(4967.32, 2) =DOLLAR(1515.61, 2) =DOLLAR(0, 2) =DOLLAR(58054.89, 2) =DOLLAR(4084.55, 2) 42 N N =DOLLAR(4B8r3B4p7yhRXuBWLqsQ546WR43cqQwrbXMDFnBi6vSJBeif8tPW85a7r7DM961Jvk4hdryZoByEp8GC8HzsqJpRN4FxGM9, 2) For me, even if I copy and paste here on the Forum, it pastes garbage from memory... see second line above. I will try to install the latest windows updates.. seems to be a windows bug Share this post Link to post
Anders Melander 1783 Posted October 11, 2022 I would start by examining what it is you put onto the clipboard. You can use a simple clipboard viewer for this but it needs to be able to display the data as hex to be of much use. The Drag and Drop Component Suite has a Drop Source Analyzer application that can do it. If you're brave you can use the one I have attached. SourceAnalyzer.zip Share this post Link to post
Rafael Dipold 0 Posted October 11, 2022 I updated Windows to 22H2, no programs running in the background, and even copying this string from notepad, my string has only memory garbage.. Initially I thought it was a bug in Delphi, that's why I posted it here, but now I see that my computer has some glitch, as I tested it on another computer and the bug doesn't happen Share this post Link to post
Anders Melander 1783 Posted October 11, 2022 22 minutes ago, Rafael Dipold said: no programs running in the background You might not have started anything manually but there are always programs running in the background. This isn't DOS after all. I would suggest you run a virus scanner on that system ASAP. My guess is that "something" has hooked into the clipboard chain and is corrupting the clipboard. If the list contains CF_UNICODETEXT then it should also contain CF_TEXT because the clipboard internally synthesizes between the two formats automatically. It is impossible to only have one of them on the clipboard. Share this post Link to post
Rafael Dipold 0 Posted October 11, 2022 In fact there was a trojan installed, it must have been a few days ago when I tried to install software downloaded via torrent Thank you, problem solved Share this post Link to post