6 ms·
The Windows Clipboard, for all of its problems, remains one of the easiest program-to-program communication methods to use in modern GUIs. I can take a screens
by dragontamer 4y ago
The Windows Clipboard, for all of its problems, remains one of the easiest program-to-program communication methods to use in modern GUIs.
I can take a screenshot of my Firefox with "PrtScn" button (moving a bitmap of the page into the Clipboard), paste it into Microsoft Paint, edit it a bit, and then copy/paste that into my Discord chat screen for commentary.
--------
Yes, Linux / *Nix users have pipes and great text processing tools. Yes, Powershell has interesting objects that can be passed round. But practically speaking? Most of my "inter-process communications" is over this silly "Clipboard" Windows has, and it works way better than it probably should.
- magicalhippo 4y agoEven better, you can copy an attachment in a mail in Outlook, and paste it into an application running on another computer via RDP. The file will be copied over without the applications knowing any better. We use this so users can attach invoices and other documents they've received through mail to orders in our application. Users typically run Outlook on their laptop/PC, but our application as a published application. We rely on Excel exposing the data in an XML format on the clipboard to reliably import data from Excel. Same for Open/LibreOffice. Without it it's impossible to handle cells which contain both the quote character and newlines, due to the way Excel formats plaintext. We don't want to import the whole file, because the users typically only need to import parts of the spreadsheet. This saves us from writing a complex UI to select the data to import. And FWIW, I've used that with >100k rows of data.
- Melatonic 4y agoYea this is a super underrated feature - copy and paste through RDP is awesome. Although in some cases you would probably want to of course disable that for security reasons.
- yardshop 4y agoIt works several layers deep too. My typical WFH scenario these days is: home PC -> RDP to work laptop at home -> VNC to work network -> RDP to work desktop -> RDP to other VMs and PCs at work I can copy text or a file or a screen shot at any level and paste at any other level. Pretty amazing.
- mtVessel 4y agoIt's clipboards all the way down...
- MikeSchurman 4y agoI've found the clipboard to be a highly flexible tool, that seems under-used. As an example, I've extended my game engine editor to draw any position in 3d that I have in the clipboard. So when problems happen and are displayed in the logs, I select the log, copy to clipboard, boom, position drawn. This idea has a lot of legs IMO.
- dragontamer 4y agoThere was a browser based game called "Utopia" in the 00s that was reasonably popular. Someone wrote a tool where you'd copy/paste your kingdom homescreen, and get all sorts of calculations / predictions. It was one of the easiest-to-use calculators I've ever seen. Just enter your webpage to play the game, Ctrl-A (select-all), Ctrl-C (copy), and bam, the Utopia-program would instantly analyze your kingdom and provide advice. Just all off of the HTML-copy that Clipboard supports. ------------ Windows developers "know" the clipboard is one of the most important inter-process communication structures of the entire system, and have known for years. Its probably one of the Win32 API's biggest advantages, no joke. The shear amount of creative solutions I've seen from clipboard manipulations is outstanding.
- RajT88 4y agoSince Windows 7 or so, I've noticed more and more instances where you ctrl+C and the clipboard doesn't update. I had a chat with a Windows PM on it opportunistically a while back. It turns out, more and more applications are locking the clipboard and holding onto the lock inappropriately. Enough that there's a particular telemetry watcher for this condition for MSFT to get an idea on who the guilty parties are. Everyone has had it happen - I notice it when colleagues are in a rush and send me something they didn't mean to send (because their clipboard didn't update). I don't know who the guilty parties are (since that telemetry is encrypted, and can't be inspected), but I sure hope someone is knocking down some doors to address the problem.
- RedShift1 4y agoOooh so that's what that is. I've had it happen numerous times where I was absolutely sure I pressed CTRL+C yet the clipboard was empty. I now use CTRL+X and CTRL+Z just because of that.
- ryandrake 4y agoI haven't been keeping up with the Windows world. Does Microsoft provide any safeguards or tools for the user to limit access to the clipboard? The clipboard was introduced in the good ol' days when you could basically trust the applications running on your computer. Nowadays, third party (and for those of us more paranoid) first party apps need to be considered attackers. The clipboard is a juicy target that often contains sensitive data I'm sure most apps would like to gobble up and exfiltrate. I know iOS and Android both are starting to introduce restrictions on mobile apps' use of the clipboard. Has this made it into the Windows desktop world?
- gruez 4y agoWindows isn't sandboxed so any per-program restrictions is pretty much pointless because it'll be trivial to bypass.
- 323 4y agoRegular apps, Windows Store apps are sandboxed. Some of them are quite popular (eg: Netflix).
- pjc50 4y agoThe rules are completely different if you're running "appstore" apps, which actually have some kind of sandbox. If it's a regular win32 app, then it has access to all your filesystem (except UAC bits), can read and post keystrokes to other windows, and indeed can just straight up inject code into other processes.
- Melatonic 4y agoNot true anymore - there are process isolation modes you can enable in Windows 10 as well as kernel isolation where it runs core processes in a VM essentially. And there is also protected folder access.
- MrLeap 4y agoI've been wondering about this -- I'm making a text editor RPG, and in the medium term I want to make a file picker that builds a procedural dungeon based on your file system. I know such a thing would have been trivially fine in older versions of windows, but I didn't know if going down that road has any foot guns a more educated win developer would know. Is protected folder access an on-by-default thing, or is it only certain folders? Quick googling makes me think my plan might trigger windows defender for an exemption request. Hm That's a drag, but understandable I suppose?
- Blikkentrekker 4y agoWhat you describe also works on X11 and probably what MacOS uses too. I'm not sure why it would be impressive or unusual. The ability to store arbitrary data on the clipboard with metadata that describes what data it is, such as an image file, or an audio file, is very old.
- dragontamer 4y ago> What you describe also works on X11 and probably what MacOS uses too. Except its no where near as smooth or universal as in Windows. In Linux, you have to worry about KDE programs vs GNOME programs having different clipboards, for example. Its also why compatible suites of programs (ie: Adobe) can be so useful when those custom formats come into play. Adobe can copy/paste layers from Photoshop and send them over to other programs. If the photoshop layer isn't understood, it seems to become a Bitmap, which works when I'm on a VBulletin forum over in Firefox land. --------- Copy/paste works on files / file-managers, images, text, HTML. Yes, any OS could do the same thing, but they largely don't in my experience.
- partido3619463 4y agoThe conversion behavior you describe is also what happens in MacOS.
- mahkoh 4y ago>In Linux, you have to worry about KDE programs vs GNOME programs having different clipboards, for example. I don't worry about this on linux because it's not the case. I suppose if I were on windows I would have to worry about legacy programs that only understand UCS-2 not being able to talk to modern programs that only understand UTF-8. >Its also why compatible suites of programs (ie: Adobe) can be so useful when those custom formats come into play. Adobe can copy/paste layers from Photoshop and send them over to other programs. If the photoshop layer isn't understood, it seems to become a Bitmap, which works when I'm on a VBulletin forum over in Firefox land. I'm able to paste images from GIMP, Krita, and Thunar into forums just fine.
- jrochkind1 4y ago
- banana_giraffe 4y agoIt's cute just how old the concept of the Windows Clipboard is. The basic APIs were there from the beginning in Windows 1.0, including multiple clipboard formats, application specific formats, and the ability to register for clipboard changes. More standard formats have been added over the years, but it still supports some ancient formats, like Software Arts' Data Interchange Format.
- ziml77 4y agoI recently looked at the API docs for Windows 1 because I wanted to see if ExitWindows was there from the start (since that naming really only makes sense if Windows has something to exit to). It wasn’t there until Windows 3, but I was surprised to see just how far back many familiar functions go. I expected the API to be far smaller than it was for 1.0
- jwilk 4y agoI'd love to get my hands on old Windows API docs. Are they available online somewhere?
- banana_giraffe 4y agoSome are, here's the Win 1.0 and 2.0 SDK documentation: https://www.os2museum.com/wp/windows-history/windows-library/ https://www.os2museum.com/wp/windows-history/windows-library...
- pjc50 4y ago> "inter-process communications" Way back in the 90s, it was possible to put any (+) document inside any sufficiently aware app or document with OLE ("object linking and embedding") The (+) indicates that there were a lot of terms and conditions applying to this, but you could actually just put an excel spreadsheet in a word document, and it would run a small copy of excel inside word. This is why the original word save format is so horrendous - it's serialized binary objects.
- pkaye 4y agoI think OLE used the compound file format which was modeled after a FAT file system image. https://en.wikipedia.org/wiki/Compound_File_Binary_Format https://en.wikipedia.org/wiki/Compound_File_Binary_Format
- com2kid 4y agoOLE is an awesome tech that I am sad isn't more widely used. The idea of being applications being portable toolboxes that can be embedded inside of other applications is just so cool. I remember embedding, IIRC, Print Shop Pro media inside of Word and when I clicked on the graphics the PSP UI appeared! Well after 10-20 seconds of hard drive thrashing it appeared, and then operated at about 5 fps. Cool idea though!
- pvg 4y agoOn the current macOS, the screenshot can be edited/annotated when it's previewed on the mac or on a nearby iPad where it automagically appears (with edits propagating back to the mac). Something similar is available in the more modern Windows 'snipping tool' feature (win-shift-s) but without the tablet magic.
- jjice 4y agoFor screenshots and edits, I have to say that I love MacOS's tools. CMD-Shift-4 to capture a screen region, click on it in the bottom right, edit it right there, and click 'Done'. Their editing tools are also super intuitive there. Honestly my favorite MacOS tool and I'd love a cross platform equivalent.
- nonfamous 4y agoFWIW the process is about the same in Windows. The only difference is the keyboard shortcut is Windows-Shift-S.
- wongarsu 4y agoThe only real difference is that Windows introduced the simple way only fairly recently (7 years ago with Windows 10), so lots of people are still used to doing it the old way.
- cyral 4y agoIt's also great when you copy some text from Outlook and it pastes it into discord as an image of the text. I believe it has been fixed now but that was happening to me for a while.
- analog31 4y agoI believe Windows did a lot of things right by just keeping things simple for developers. I use the clipboard to transfer large blobs of data from one program to another when doing exploratory programming -- it's a lot quicker than creating file formats for everything. Of course there's the risk of losing it in the process. Another under-appreciated Windows feature is how they implement drag-and-drop apps. When you drag a file into an app icon, it just stuffs the file path into the command line arguments and runs the app. In contrast, though MacOS introduced drag-and-drop, actually implementing it in System 7 was a huge complex chore.
- lemoncookiechip 4y agoUnrelated, but you can actually use Firefox's own screenshot function which is far more robust than PrtScn, allowing you crop the image how you want (including snap to element), you can also save to clipboard or download it for further editing or storing. The key-shortcut is CTRL+LSHIFT+S.
- enlyth 4y agoI find WIN + SHIFT + S to be superior, because it is not limited to the browser window, automatically copies to the clipboard, and you can choose to annotate it if you want
- jwagenet 4y agoI mean, if you are in Windows already you should be using Snip at least since Win7. It has cropping, window snap, and basic annotation, in addition to capture save and copy.
- deleted 4y ago[deleted]
- cecilpl2 4y agoOn Windows, it's now faster/easier to use the built in Snip+Sketch tool (Win + Shift + S). It does instant rectangular selection, then pops up a simple editor which you can then copy/paste anywhere you'd like. I have Win+Shift+S bound to a mouse chord, as well as copy and paste, so I can actually paste an arbitrary rectangle of my screen without touching the keyboard.
- com2kid 4y agoI've had the pleasure of looking at the Windows source code for the clipboard. Insanely well engineered. It can perform miracles of computing. It damn well has to. > I can take a screenshot of my Firefox with "PrtScn" button (moving a bitmap of the page into the Clipboard), paste it into Microsoft Paint, edit it a bit, and then copy/paste that into my Discord chat screen for commentary. All without you worrying about supported image formats or color space encodings! It is insane! Copy from Firefox and then paste into a program that expects 16bit color and it'll probably work. The clipboard stores data in so many duplicate formats and can convert between so many formats, it is nuts.
- yardshop 4y agoAlso really handy sometimes is Win+PrintScreen, which puts the screen image on the clipboard, and also saves it to a numbered file in your Pictures\Screenshots folder. If things are happening fast and you don't want to paste and manipulate each screen shot, this lets you save several in a row to go back and work with later.
- lostsock 4y agoI love how when you copy something onto the clipboard, it silently and transparently outputs different things depending on where you paste. For example, copying from Excel can output: - to a table (when copied into word) - to rich text when copied into Wordpad - to plain text when copied into Notepad - and even an image when copied into Paint. All without having to select the desired type at the source.
- SolarNet 4y agoI do this exact same thing on linux without any issues. I use a presetup desktop environment, it's fine. If I used arch or some other power user linux, I suspect I would have to jump through quite a few hoops to get this experience setup as nicely. But as someone who daily drives both a linux distribution and a windows distribution, I see no notable differences in clipboard functionality.