public static int ConfigHeight(string sSkin) { IntPtr hwnd = (IntPtr)(UInt32.Parse(Rainmeter.PluginBridge("GetWindow", sSkin))); RECT rct; GetWindowRect(hwnd, out rct); return(rct.Bottom - rct.Top); }
// Call this function to determine if the parent skin is topmost public static bool ParentIsTopmost(Rainmeter.Settings.InstanceSettings Instance) { IntPtr hwnd = (IntPtr)(UInt32.Parse(Rainmeter.PluginBridge("GetWindow", Rainmeter.PluginBridge("GetConfig", Instance.INI_File)))); WINDOWINFO info = new WINDOWINFO(true); GetWindowInfo(hwnd, ref info); return((info.dwExStyle & 0x00000008L) > 0); }
public static int ConfigHeight(Rainmeter.Settings.InstanceSettings Instance) { IntPtr hwnd = (IntPtr)(UInt32.Parse(Rainmeter.PluginBridge("GetWindow", Rainmeter.PluginBridge("GetConfig", Instance.INI_File)))); RECT rct; GetWindowRect(hwnd, out rct); return(rct.Bottom - rct.Top); }
public static int ConfigWidth(string sSkin) { IntPtr hwnd = (IntPtr)(UInt32.Parse(Rainmeter.PluginBridge("GetWindow", sSkin))); RECT rct; GetWindowRect(hwnd, out rct); return(rct.Right - rct.Left); }
public unsafe void Initialize(Settings _PluginSettings, char *iniFile, char *section, UInt32 id) { this.PluginSettings = _PluginSettings; this._ID = id; this._INI_File = new string(iniFile); this._Section = new string(section); this.ConfigName = Rainmeter.PluginBridge("GetConfig", this.INI_File); }
private unsafe static string PluginBridge(string sCommand, string sData) { try { return(new string(PluginBridge(Rainmeter.String(sCommand), Rainmeter.String(sData)))); } catch { } return(string.Empty); }
public double Update2(Rainmeter.Settings.InstanceSettings Instance) { try { MeasureResult result = Measure(Instance); return(result.AsDouble(Instance)); } catch (Exception e) { Rainmeter.Log(Rainmeter.LogLevel.Error, "Sorry, " + e.ToString()); return(double.NaN); } }
public string GetString(Rainmeter.Settings.InstanceSettings Instance) { try { MeasureResult result = Measure(Instance); return(result.AsString(Instance)); } catch (Exception e) { Rainmeter.Log(Rainmeter.LogLevel.Error, "Sorry, " + e.ToString()); return("Sorry, " + e.ToString()); } }
public void Go() { this.Instance.SetTempValue("__RMT_EB_AlreadyRunning", true); try { new OutlookPlugin().ExecuteBang(this.Instance, this.Command); } catch (Exception ex) { Rainmeter.Log(Rainmeter.LogLevel.Error, "C# plugin in GetString(), " + ex.GetType().ToString() + ": " + ex.Message); } this.Instance.SetTempValue("__RMT_EB_AlreadyRunning", false); }
public void Go() { this.Instance.SetTempValue("__RMT_U2_AlreadyRunning", true); try { this.Instance.SetTempValue("__RMT_U2_LastValue", new OutlookPlugin().Update2(this.Instance)); } catch (Exception ex) { Rainmeter.Log(Rainmeter.LogLevel.Error, "C# plugin in GetString(), " + ex.GetType().ToString() + ": " + ex.Message); } this.Instance.SetTempValue("__RMT_U2_AlreadyRunning", false); }
// If an INI is missing, a blank string will be returned to avoid raising exceptions private unsafe static string ReadConfigString(string sSection, string sKey) { try { char *szString = ReadConfigString(Rainmeter.String(sSection), Rainmeter.String(sKey), Rainmeter.String(string.Empty)); if (szString != null) { return(new string(szString)); } } catch { } return(string.Empty); }
public unsafe static char *GetPluginAuthor() { if (!string.IsNullOrEmpty(Plugin.Email) && !string.IsNullOrEmpty(Plugin.Comments)) { return(Rainmeter.String(Plugin.Author + " (" + Plugin.Email + "): " + Plugin.Comments)); } if (!string.IsNullOrEmpty(Plugin.Email)) { return(Rainmeter.String(Plugin.Author + " (" + Plugin.Email + ")")); } if (!string.IsNullOrEmpty(Plugin.Comments)) { return(Rainmeter.String(Plugin.Author + ": " + Plugin.Comments)); } return(Rainmeter.String(Plugin.Author)); }
// 'ExecuteBang' is a way of Rainmeter telling your plugin to do something *right now*. // What it wants to do can be defined by the 'Command' parameter. public void ExecuteBang(Rainmeter.Settings.InstanceSettings Instance, string Command) { //string[] args = Command.Split(' '); //Command = args[0]; try { switch (Command) { case "ClearCache": resetId++; return; } MeasureResult mr = Measure(Instance); mr.Bang(GetOutlook(), Command); } catch (Exception e) { Rainmeter.Log(Rainmeter.LogLevel.Error, e.ToString()); } return; }
public static IntPtr GetConfigWindow(Rainmeter.Settings.InstanceSettings Instance) { return((IntPtr)(UInt32.Parse(Rainmeter.PluginBridge("GetWindow", Rainmeter.PluginBridge("GetConfig", Instance.INI_File))))); }
public string SetVariable(string sVariable, object oData) { return(Rainmeter.PluginBridge("SetVariable", "\"" + this.ConfigName + "\" " + sVariable.Trim() + " \"" + oData.ToString().Trim() + "\"")); }
public static UInt32 GetPluginVersion() { return(Rainmeter.Version(Plugin.Version)); }
// You can call this function directly to log to Rainmeter.log // // Rainmeter needs to be configured to allow debug logging, of course. public static unsafe bool Log(LogLevel level, string sText) { return(Rainmeter.LSLog((int)level, Rainmeter.String("C# plugin"), Rainmeter.String(sText)) != 0); }
public string GetVariable(string sVariable) { return(Rainmeter.PluginBridge("GetVariable", "\"" + this.ConfigName + "\" " + sVariable.Trim() + "")); }
/// <summary> /// Rainmeter's request for text data from the plugin. /// </summary> /// <param name="id">The unique instance ID of this request.</param> /// <param name="flags">Unused still as of Dec 2nd, 2010.</param> /// <returns></returns> public unsafe static char *GetString(UInt32 id, UInt32 flags) { // Do not modify this member. Instead, update your code in 'OutlookPlugin.cs'. return(Rainmeter.String(new YourPlugin().GetString(Plugin, id))); }