All Projects → DoumanAsh → clipboard-win

DoumanAsh / clipboard-win

Licence: BSL-1.0 License
Rust win clipboard utilities

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to clipboard-win

secure-pbcopy
pbcopy(1) replacement that marks data as confidential
Stars: ✭ 18 (-28%)
Mutual labels:  clipboard
kakboard
Clipboard integration for Kakoune
Stars: ✭ 49 (+96%)
Mutual labels:  clipboard
ClipboardXX
Header only, lightweight and cross platform C++ library for copy and paste text from clipboard.
Stars: ✭ 36 (+44%)
Mutual labels:  clipboard
vim-cutlass
Plugin that adds a 'cut' operation separate from 'delete'
Stars: ✭ 134 (+436%)
Mutual labels:  clipboard
XamarinClipboardPlugin
Cross Platform Clipboard access for Xamarin
Stars: ✭ 24 (-4%)
Mutual labels:  clipboard
clipetty
Manipulate the system (clip)board with (e)macs from a (tty)
Stars: ✭ 91 (+264%)
Mutual labels:  clipboard
UptimeFaker
Generic Windows library designed to help detecting issues related to high PC uptime
Stars: ✭ 53 (+112%)
Mutual labels:  winapi
pinwin
.NET clone of DeskPins software
Stars: ✭ 133 (+432%)
Mutual labels:  winapi
cb
Command line interface to manage clipboard
Stars: ✭ 69 (+176%)
Mutual labels:  clipboard
cotp
Trustworthy, encrypted, command-line TOTP/HOTP authenticator app with import functionality.
Stars: ✭ 45 (+80%)
Mutual labels:  clipboard
Delphi SChannelTLS
Helper functions and socket classes to perform TLS communication by means of WinAPI (SChannel)
Stars: ✭ 22 (-12%)
Mutual labels:  winapi
SharpClipboard
A library for anonymously monitoring clipboard entries.
Stars: ✭ 127 (+408%)
Mutual labels:  clipboard
go-windows-programming
Go Windows Programming Tutorial
Stars: ✭ 50 (+100%)
Mutual labels:  winapi
alfred-string-operations
Perform string operations to clipboard content
Stars: ✭ 70 (+180%)
Mutual labels:  clipboard
netflix-list-exporter
💫‎‎‎‏‏‎ An Extension to export your lists from Netflix to Clipboard area and share it with your friends.
Stars: ✭ 60 (+140%)
Mutual labels:  clipboard
cookie-extraction
登录后提取在线cookie,更新至服务器或拷贝至剪切板,为爬虫抓取跳过复杂验证码识别程序
Stars: ✭ 46 (+84%)
Mutual labels:  clipboard
clipboard-manager-electron
A clipboard manager built with Electron
Stars: ✭ 92 (+268%)
Mutual labels:  clipboard
ZetaHtmlEditControl
A small wrapper class around the Windows Forms 2.0 WebBrowser control.
Stars: ✭ 72 (+188%)
Mutual labels:  clipboard
midgard
⛰️ Universal clipboard sharing service (supports macOS/Linux/Windows/iOS)
Stars: ✭ 81 (+224%)
Mutual labels:  clipboard
v-copy
Vue directive to copy to clipboard. (1kB)
Stars: ✭ 88 (+252%)
Mutual labels:  clipboard

clipboard-win

Build Crates.io Docs.rs

This crate provide simple means to operate with Windows clipboard.

Note keeping Clipboard around:

In Windows Clipboard opens globally and only one application can set data onto format at the time.

Therefore as soon as operations are finished, user is advised to close Clipboard.

Clipboard

All read and write access to Windows clipboard requires user to open it.

Usage

Manually lock clipboard

use clipboard_win::{Clipboard, formats, Getter, Setter};

const SAMPLE: &str = "MY loli sample ^^";

let _clip = Clipboard::new_attempts(10).expect("Open clipboard");
formats::Unicode.write_clipboard(&SAMPLE).expect("Write sample");

let mut output = String::new();

assert_eq!(formats::Unicode.read_clipboard(&mut output).expect("Read sample"), SAMPLE.len());
assert_eq!(output, SAMPLE);

//Efficiently re-use buffer ;)
output.clear();
assert_eq!(formats::Unicode.read_clipboard(&mut output).expect("Read sample"), SAMPLE.len());
assert_eq!(output, SAMPLE);

//Or take the same string twice?
assert_eq!(formats::Unicode.read_clipboard(&mut output).expect("Read sample"), SAMPLE.len());
assert_eq!(format!("{0}{0}", SAMPLE), output);

Simplified API

use clipboard_win::{formats, get_clipboard, set_clipboard};

let text = "my sample ><";

set_clipboard(formats::Unicode, text).expect("To set clipboard");
//Type is necessary as string can be stored in various storages
let result: String = get_clipboard(formats::Unicode).expect("To set clipboard");
assert_eq!(result, text)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].