Skip to content

ui::ClipboardContent

Header: winui/ui/Clipboard.hpp.

What to put on the clipboard. Every part that is set goes on it together, in one operation, and an app pasting picks the format it understands.

Example:

ui::ClipboardContent content;
content.text                = "report.pdf";
content.storage_items       = {"C:/Reports/report.pdf"};
content.requested_operation = ui::DataPackageOperation::Move; // a cut
ui::clipboard().set_content(content, {.is_allowed_in_history = false});

Field Type Default
text std::optional<std::string> UTF-8 text, or nullopt to put no text on the clipboard.
bitmap std::optional<Bitmap> A picture (straight-alpha RGBA), or nullopt for none.
storage_items std::vector<std::filesystem::path> File-system paths of files or folders.
requested_operation DataPackageOperation DataPackageOperation::Copy The operation requested of whoever pastes the storage items (a file manager copies or moves them accordingly).