|
Actually, here is better code for linqpad....
void Main()
{
string textData = "I want to put this string on the clipboard.";
System.Windows.Clipboard.SetData(DataFormats.Text, (Object)textData);
}
Add that code, then
1. Press F4 (and a window will open)
2. You have to add the library PresentationCore.dll
Run the code, it _should_ copy to the clipboard.
Try pasting.
|
|
|
|
|
Actually after yet another reboot, the problem seems to have gone away and has not yet come back (for the first time in maybe 5 days and as many reboots)...I'm not gonna go out of my way to intentionally try to break it. But if it does come back, I will definitely look into it. I've used the clipboard API before, in the same way you do in your little 2-liner sample, and with the way it behaved (until now) throughout the entire OS, I wouldn't be surprised if nothing got copied after SetData().
Unfortunately according to the docs, the API doesn't return anything, but could throw exceptions. I suspect it's not, in my case. If it was, either every app is anticipating exceptions and remaining completely silent about them (unlikely), or if something's not anticipating them, then I'd expect them to end up in the Windows event log - and it's clean.
|
|
|
|
|
And, oh yeah, I should also say that I have a similar challenge using RealVNC and connecting to my headless Mac Mini.
In that case the clipboard works locally (on the mac) but will never copy back to my local environment. They function as two separate clipboards.
I'm on Linux and I use Remmina for remote desktop to Windows machines and there the clipboard works in unison (if I copy on my remote Win10 machine I can paste to my local Linux machine.
|
|
|
|
|
This may be a dumb question, but have you checked if it's a problem with your keyboard? IOW, do the Edit | Copy,Paste menu commands work in Notepad?
/ravi
|
|
|
|
|
My 5-year-old laptop recently started to do this. ZXCV keys occasionally do nothing and have to be sledgehammered before they wake up. I had to get an external keyboard as a backup.
|
|
|
|
|
I also tried to copy/paste purely using the mouse. I get the same thing. After copying to the clipboard, the right-click menu shows that Paste is grayed out, indicating there's nothing on it.
Besides, copy/paste does continue to work on remote machines I'm accessing over RDP.
|
|
|
|
|
I put a setting (on purpose) on my RDP so that things I copy on my Remote Desktop cannot transfer into my local clipboard.
If you have different RDP connections, maybe they have conflicting settings?
|
|
|
|
|
This might be as well... We had a shared clipboard when accessing a windows server per RDP...
If you used a compatible enviroment in that moment, you could paste what I had previously copied.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Good thought, but the problem is (almost) immediately present after a reboot, and using (say) Notepad even locally, before getting any RDP session involved.
|
|
|
|
|
Oi Mick ! [^]
Do i need to remind you that the Baha Men's "Who Let the Dogs Out" [^] is the song your unconscious mind is playing now ?
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
modified 2-Nov-21 19:01pm.
|
|
|
|
|
Wow so life like...btw which one was the real Mic?
I'd be surprised if that was not KR's theme song...Prop me up!
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
Kids: screen time ... what do you do with your children ? [^]
i made the choice to not have children in this life long ago, but, i have wondered, if i were a parent, now, what i would, or wouldn't, do in terms of controlling/modulating a child's computer/internet use. i think back to my childhood where i spent so much time. alone, reading books ... rather than playing sports, or hanging out with peers ... i was known as 'bookworm.'
In many ways, for child and young teen me, characters in books were as real as my peers ... something i learned to use socially to get attention Fortunately, in those years (late 1940's to early 1960's), they didn't have school psychologists.
i'm surrounded by people (Thais) who are so immersed in using the internet for constant-contact socializing, gaming, etc., that i experience them as "altered steaks" who are less aware of environmental clues, non-verbal communication, etc. And, i am sure they experience me as an "odd alien" whose even odder because he doesn't have a mobile with a camera, or internet, and, for being able to make jokes, use puns in Thai.
cheers, past-his-use-by-date bill
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
Which is why I put my son into Waldorf school and he didn't touch a computer, screen (and I gave away the TV) until he was 13 or 14.
|
|
|
|
|
Hi Marc,
i bet you are a great father, and, i would also bet it may take your son a few decades to fully appreciate that
i am curious how, after age 14, he has involved himself with computers.
cheers, Bill
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
Thankfully my kids have their own kids and they can worry about it!
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Yes, but what chance do they have against all the propaganda ministers and indoctrinators in the world?
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Like me they are teaching their grommets to be cynical and question everything. It is the law makers that they worry about.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
It was about a week back.
|
|
|
|
|
Brilliant !
|
|
|
|
|
I searched and didn't find it either. You'd best put it behind you.
|
|
|
|
|
PIEBALDconsult wrote: You'd best put it behind you.
He said chiropractor, not proctologist.
|
|
|
|
|
I think that response is beneath you.
|
|
|
|
|
If this had been a phish test at work, I would have failed 😞
|
|
|
|
|
|
lol,
schadenfreude.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|