From 55fe5036360a924300fbc6b5ddf9a21cfa51407e Mon Sep 17 00:00:00 2001 From: JamesAC Date: Sun, 29 Jan 2012 18:59:22 +0000 Subject: [PATCH] Added new Bang "!SetClip" Usage - !SetClip "Text to set, #Variable#, [Measure]" Dynamic Variables is only needed if a dynamic #Variable# is used, it is not needed for a [Measure] to appear dynamically. --- Library/MeterWindow.cpp | 6 ++++++ Library/MeterWindow.h | 2 ++ Library/Rainmeter.cpp | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 9fc7a5c9..dacc25da 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -949,6 +949,12 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg) } break; + case BANG_SETCLIP: + { + CSystem::SetClipboardText(arg); + } + break; + case BANG_PLUGIN: { std::wstring args = arg; diff --git a/Library/MeterWindow.h b/Library/MeterWindow.h index 80658f7b..322ee29d 100644 --- a/Library/MeterWindow.h +++ b/Library/MeterWindow.h @@ -148,6 +148,8 @@ enum BANGCOMMAND BANG_DISABLEMEASUREGROUP, BANG_UPDATEMEASUREGROUP, + BANG_SETCLIP, + BANG_PLUGIN, BANG_SETVARIABLE, BANG_SETOPTION, diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index 55b415ff..ace48437 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -1653,6 +1653,10 @@ BOOL CRainmeter::ExecuteBang(const std::wstring& bang, const std::wstring& arg, { BangWithArgs(BANG_SETTRANSPARENCY, args, 1); } + else if (_wcsicmp(name, L"SetClip") == 0) + { + BangWithArgs(BANG_SETCLIP, args, 1); + } else if (_wcsicmp(name, L"SetVariable") == 0) { BangWithArgs(BANG_SETVARIABLE, args, 2);