ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • C Sharp Copy File Clipboards
    카테고리 없음 2020. 2. 19. 17:33

    Hi everybody. I'm Rainmeter fan and it has totally replaced Windows Gadgets for me, except one gadget - Clipboard Manager.

    Copy Clipboard History

    C Sharp Copy File Clipboards

    It monitores clipboard, save text from it and show you this history. I think it's very useful, and so I want to find Rainmeter skin with same functionality. Unfortunately, I couldn't find such skin, and (as I realise) this functionality cannot be reached with standard Rainmeter functions or existing plugins.

    So, as I'm.NET (C#) developer (beginner only ) I've decided to write C# application, which will iteract with Rainmeter (application as back-end, and Rainmeter as front-end ). The easiest way to iteract with Rainmeter is to programmatically change settings file and refresh Rainmeter. I found code for monitoring clipboard, writing text to Variables.inc and refreshing Rainmeter.

    Then I made a skin for Rainmeter, which loads values from file and show them to user. Click on text line in skin launches another application, that puts this text to clipboard. I also have to write this application, because I need to store and handle multiline text (Rainmeter variable doesn't support it). This is examle skin looks like: Tray menu: Instructions: - download Clipboard.zip and unzip it to folder with your Rainmeter theme. Refresh your Rainmeter and enable Clipboard.ini skin. launch GetClipboard.exe. You can see an icon of application in system tray (icon looks like Rainmeter's).

    Only one instance of application can be launched. try to copy some text (Ctrl+C or another way). if everything is allright, you'll see copied text in Rainmeter skin. try to copy another text. This text will be added to skin. now try to click on second line. This line will became first, and it's value will be copied to clipboard.

    Settings Application also support settings file, in which you can set your path to rainmeter.exe, variables.inc, variable name and hide tray icon. Settings file will be automatically generated and opened in case of some error, or you can manually create it by clicking 'Settings' in ContextMenu in tray.

    Settings file name should be 'GetClipboard.ini', and it should contain section name 'Settings'. There are 4 available options: - VariablesPath (string) - path to variables.inc file with clipboard variables in it. By default, application searches this file in the same folder.

    VariableName (string) - name of clipboard variable. All variables are named as VariableName0, VariableName1, VariableName2, etc. You need to use these names in your Rainmeter skin's code. Default value - 'clipboard'. RainmeterPath (string) - path to rainmeter.exe. By default, application searches this file in%ProgramFiles%/Rainmeter/. EnableTrayIcon (bool).

    You need to set it to '0', if you want to hide tray icon. Example of file: Settings VariablesPath=C: Users UserName Documents Rainmeter Skins Rainify @Settings Variables.inc VariableName=ClipboardApp RainmeterPath=C: Soft Rainmeter Rainmeter.exe EnableTrayIcon=0 If you want to store more than 5 lines, you need to modify skin and Variables.inc. Credits Rainmeter skin was originally created by and named (many thanks to him for this brilliant skin) Downloads Example skin and source code are attached to this post Any questions, replies, report bugs are welcome. I'm sorry for my language, English is not my native.

    Attachments (68.87 KiB) Downloaded 371 times (51.7 KiB) Downloaded 547 times. Zzeneg wrote:Hi AlC! Thank you for your reply. I didn't find an opportunity to refresh one skin through external program Do you know how can I do this?

    It is impossimble to close any application using bangs, because they can only start applications. The only way - to write some GetClipboardKiller.exe 1. Definitely possible.

    C Sharp Copy File Clipboards

    If you use the skin to start GetClipboard.exe you can have the skin send the configname to GetClipboard.exe (or to your settings file I guess) with #CURRENTCONFIG#. Then have GetClipboard.exe use!Refresh and the configname that was given instead of!RefreshApp. Now I normally would not suggest having a skin autorun an exe when it is loaded, but the skin is kind of pointless without it. I would probably on first load of the skin make a 'popup' in the skin that asks the user if they want to auto start GetClipboard.exe when the skin loads. If they select 'Yes' then a variable is changed which will allow the skin to start GetClipboard.exe with OnRefreshAction= Here is your skin with the AutoStart variables set up. I didn't add the 'popup' but it should be easy enough for you. If you choose to have GetClipboard.exe pull the config name from the settings file you could add !WriteKeyValue Settings ConfigName #CURRENTCONFIG# '#CURRENTPATH# GetClipboard.ini' to on=!Execute '#CURRENTPATH# GetClipboard.exe'.

    Code: Rainmeter Author=poiru AppVersion=2001000 Update=1000 OnRefreshAction=#AutoStart# MouseActionCursor=0 MiddleMouseDownAction=!RainmeterDeactivateConfig MouseLeaveAction=!Execute !RainmeterHideMeter Shutdown!RainmeterHideMeter Restart!RainmeterHideMeter Logout!RainmeterHideMeter X!RainmeterRedraw Metadata Name=Clipboard Description=Save multiple text values from clipboard. Great prog, really hope it gets updated to accept file clips, cause until then im sticking to clipboarder (a desktop gadget), although it isnt quite so pretty, as i can customize yours to fit my theme:P., acceptance of screenshots, and file clips is a dealbreaker. (the rainmeter UI should just show the filename of whatevers copied, not a picture) also i agree it probably should open the clipboard exe automatically:P, and close it respectively, (the rainmeter UI should just show the filename of whatevers copied, not a picture).

Designed by Tistory.