All Projects → Willy-Kimura → SharpClipboard

Willy-Kimura / SharpClipboard

Licence: other
A library for anonymously monitoring clipboard entries.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to SharpClipboard

unlimited-clipboard
simple clipboard manager with unlimited history on electron
Stars: ✭ 21 (-83.46%)
Mutual labels:  clipboard, clipboard-manager, clipboard-management, clipboard-history
clipper
📋 Cross Platform Desktop App to Save history of all information you copy and use them whenever with a solitary snap
Stars: ✭ 42 (-66.93%)
Mutual labels:  clipboard, clipboard-manager, clipboard-history
genius
powerful clipboard manager for linux and windows
Stars: ✭ 21 (-83.46%)
Mutual labels:  clipboard-manager, clipboard-history
cliptext
Clipboard manager for macOS. Built with Electron.js
Stars: ✭ 37 (-70.87%)
Mutual labels:  clipboard, clipboard-manager
cbs
interface to manage clipboard from the command line
Stars: ✭ 25 (-80.31%)
Mutual labels:  clipboard, clipboard-manager
clipboard-manager-electron
A clipboard manager built with Electron
Stars: ✭ 92 (-27.56%)
Mutual labels:  clipboard, clipboard-manager
CLIp
CLIp is a clipboard manager for a command line interface written in 100% standard C only. Pipe to it to copy, pipe from it to paste.
Stars: ✭ 12 (-90.55%)
Mutual labels:  clipboard, clipboard-manager
Copyq
Clipboard manager with advanced features
Stars: ✭ 4,346 (+3322.05%)
Mutual labels:  clipboard, clipboard-manager
json-to-go
将json生成go的数据结构。Online tool that convert JSON to Go.
Stars: ✭ 16 (-87.4%)
Mutual labels:  clipboard
townshell
For Townscaper, an application providing additional keyboard shortcuts, tools to manipulate .scape files, screen recording
Stars: ✭ 40 (-68.5%)
Mutual labels:  clipboard
nvim-hclipboard
Hijack your clipboard in Neovim
Stars: ✭ 19 (-85.04%)
Mutual labels:  clipboard
cookie-extraction
登录后提取在线cookie,更新至服务器或拷贝至剪切板,为爬虫抓取跳过复杂验证码识别程序
Stars: ✭ 46 (-63.78%)
Mutual labels:  clipboard
ClipboardCleaner
Check and clean your clipboard using service, widget, shortcut and quick setting tile.
Stars: ✭ 85 (-33.07%)
Mutual labels:  clipboard-manager
vim-cutlass
Plugin that adds a 'cut' operation separate from 'delete'
Stars: ✭ 134 (+5.51%)
Mutual labels:  clipboard
MagicWE2
[MagicWE2] Lag free asynchronous world editor for PMMP with plenty of options
Stars: ✭ 109 (-14.17%)
Mutual labels:  clipboard
fauxClip
Clipboard support for Vim without +clipboard
Stars: ✭ 32 (-74.8%)
Mutual labels:  clipboard
cliphist
wayland clipboard manager
Stars: ✭ 47 (-62.99%)
Mutual labels:  clipboard-manager
ossFileTransferClient
이 프로젝트는 업무망과 인터넷망으로 분리된 망간자료전송 솔루션의 인터넷망용 클라이언트를 개발합니다.
Stars: ✭ 18 (-85.83%)
Mutual labels:  clipboard
alfred-string-operations
Perform string operations to clipboard content
Stars: ✭ 70 (-44.88%)
Mutual labels:  clipboard
dokuwiki-plugin-syntaxhighlighter4
SyntaxHighlighter4 plugin for DokuWiki
Stars: ✭ 51 (-59.84%)
Mutual labels:  clipboard

SharpClipboard

nuget-downloads wk-donate

SharpClipboard is a clipboard-monitoring library for .NET that listens to the system's clipboard entries, allowing developers to tap into the rich capabilities of determining the clipboard's contents at runtime.

Here's a screenshot and below a usage-preview of the library's features:

sc-preview-01 sc-usage

Installation

To install via the NuGet Package Manager Console, run:

Install-Package SharpClipboard

Features

  • Supports .NET Framework 2.0 and above plus .NET Core.
  • Built as a component making it accessible in Design Mode.
  • Silently monitors the system clipboard uninterrupted; can also be disabled while running.
  • Provides support for multi-instance clipboard monitoring.
  • Ability to detect clipboard content in various formats: text, images, files, and other complex types.
  • Option to control the type of content to be monitored, e.g. text only, text and images only.
  • Ability to capture the background application's details from where the clipboard's contents were captured.

Usage

If you prefer working with the Designer, simply add the library to Visual Studio's Toolbox and use the Properties window to change its options:

sc-preview-02

To use it in code, first import WK.Libraries.SharpClipboardNS - the code below will then assist you:

    var clipboard = new SharpClipboard();

    // Attach your code to the ClipboardChanged event to listen to cuts/copies.
    clipboard.ClipboardChanged += ClipboardChanged;
    
    private void ClipboardChanged(Object sender, ClipboardChangedEventArgs e)
    {
        // Is the content copied of text type?
        if (e.ContentType == SharpClipboard.ContentTypes.Text)
        {
            // Get the cut/copied text.
            Debug.WriteLine(clipboard.ClipboardText);
        }

        // Is the content copied of image type?
        else if (e.ContentType == SharpClipboard.ContentTypes.Image)
        {
            // Get the cut/copied image.
            Image img = clipboard.ClipboardImage;
        }

        // Is the content copied of file type?
        else if (e.ContentType == SharpClipboard.ContentTypes.Files)
        {
            // Get the cut/copied file/files.
            Debug.WriteLine(clipboard.ClipboardFiles.ToArray());

            // ...or use 'ClipboardFile' to get a single copied file.
            Debug.WriteLine(clipboard.ClipboardFile);
        }

        // If the cut/copied content is complex, use 'Other'.
        else if (e.ContentType == SharpClipboard.ContentTypes.Other)
        {
            // Do something with 'clipboard.ClipboardObject' or 'e.Content' here...
        }
    }

You can also get the details of the application from where the clipboard's contents were cut/copied from using the ClipboardChanged argument property SourceApplication:

    private void ClipboardChanged(Object sender, SharpClipboard.ClipboardChangedEventArgs e)
    {
        // Gets the application's executable name.
        Debug.WriteLine(e.SourceApplication.Name);
        // Gets the application's window title.
        Debug.WriteLine(e.SourceApplication.Title);
        // Gets the application's process ID.
        Debug.WriteLine(e.SourceApplication.ID.ToString());
        // Gets the application's executable path.
        Debug.WriteLine(e.SourceApplication.Path);
    }

This option could come in handy especially when you're building a clipboard-monitoring application where users may feel the need to know where every recorded cut/copy action occurred.

To manually parse the content after a cut/copy has been detected, you can use the argument property e.Content in the ClipboardChanged event:

    private void ClipboardChanged(Object sender, ClipboardChangedEventArgs e)
    {
        // For texts...
        string text = e.Content.ToString();

        // or images...
        Image img = (Image)e.Content;

        // or files...
        List<string> files = (List<string>)e.Content;
		
        // or other complex types too.
        // Person p = JsonConvert.DeserializeObject<Person>(e.Content);
    }

Made with 💛 by Willy Kimura | Like to say thank you? Star this project. Feel free to BuyMeACoffee also. 😊

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].