From 4282f0ee70a5322c3c574adef5ccefcb9a266ac5 Mon Sep 17 00:00:00 2001 From: Forrest Smith Date: Sat, 12 May 2018 14:06:01 -0700 Subject: [PATCH] Initial commit --- .gitignore | 14 + LICENSE | 39 + fts_winsnap.sln | 25 + fts_winsnap/App.config | 6 + fts_winsnap/Properties/AssemblyInfo.cs | 36 + fts_winsnap/Properties/Resources.Designer.cs | 71 + fts_winsnap/Properties/Resources.resx | 117 + fts_winsnap/Properties/Settings.Designer.cs | 30 + fts_winsnap/Properties/Settings.settings | 7 + fts_winsnap/SnapTool.ico | Bin 0 -> 67646 bytes fts_winsnap/fts_winsnap.Designer.cs | 69 + fts_winsnap/fts_winsnap.cs | 788 ++ fts_winsnap/fts_winsnap.csproj | 86 + fts_winsnap/fts_winsnap.resx | 2388 ++++ fts_winsnap/main.cs | 22 + fts_winsnap/packages.config | 4 + packages/Newtonsoft.Json.11.0.2/LICENSE.md | 20 + .../Newtonsoft.Json.11.0.2.nupkg | Bin 0 -> 2400102 bytes .../lib/net20/Newtonsoft.Json.xml | 9967 ++++++++++++++ .../lib/net35/Newtonsoft.Json.xml | 9096 +++++++++++++ .../lib/net40/Newtonsoft.Json.xml | 9296 +++++++++++++ .../lib/net45/Newtonsoft.Json.xml | 10912 ++++++++++++++++ .../lib/netstandard1.0/Newtonsoft.Json.xml | 10619 +++++++++++++++ .../lib/netstandard1.3/Newtonsoft.Json.xml | 10722 +++++++++++++++ .../lib/netstandard2.0/Newtonsoft.Json.xml | 10887 +++++++++++++++ .../Newtonsoft.Json.xml | 8707 ++++++++++++ .../Newtonsoft.Json.xml | 10619 +++++++++++++++ readme.md | 32 + 28 files changed, 94579 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 fts_winsnap.sln create mode 100644 fts_winsnap/App.config create mode 100644 fts_winsnap/Properties/AssemblyInfo.cs create mode 100644 fts_winsnap/Properties/Resources.Designer.cs create mode 100644 fts_winsnap/Properties/Resources.resx create mode 100644 fts_winsnap/Properties/Settings.Designer.cs create mode 100644 fts_winsnap/Properties/Settings.settings create mode 100644 fts_winsnap/SnapTool.ico create mode 100644 fts_winsnap/fts_winsnap.Designer.cs create mode 100644 fts_winsnap/fts_winsnap.cs create mode 100644 fts_winsnap/fts_winsnap.csproj create mode 100644 fts_winsnap/fts_winsnap.resx create mode 100644 fts_winsnap/main.cs create mode 100644 fts_winsnap/packages.config create mode 100644 packages/Newtonsoft.Json.11.0.2/LICENSE.md create mode 100644 packages/Newtonsoft.Json.11.0.2/Newtonsoft.Json.11.0.2.nupkg create mode 100644 packages/Newtonsoft.Json.11.0.2/lib/net20/Newtonsoft.Json.xml create mode 100644 packages/Newtonsoft.Json.11.0.2/lib/net35/Newtonsoft.Json.xml create mode 100644 packages/Newtonsoft.Json.11.0.2/lib/net40/Newtonsoft.Json.xml create mode 100644 packages/Newtonsoft.Json.11.0.2/lib/net45/Newtonsoft.Json.xml create mode 100644 packages/Newtonsoft.Json.11.0.2/lib/netstandard1.0/Newtonsoft.Json.xml create mode 100644 packages/Newtonsoft.Json.11.0.2/lib/netstandard1.3/Newtonsoft.Json.xml create mode 100644 packages/Newtonsoft.Json.11.0.2/lib/netstandard2.0/Newtonsoft.Json.xml create mode 100644 packages/Newtonsoft.Json.11.0.2/lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.xml create mode 100644 packages/Newtonsoft.Json.11.0.2/lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.xml create mode 100644 readme.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..357356f --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# visual studio +.vs +bin +build +obj +*.opensdf +*.filters +*.sdf +*.opensdf +*.sdf +*.suo +*.user +*.VC.db +*.VC.opendb \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1183fd4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,39 @@ +------------------------------------------------------------------------------ +This software is available under 2 licenses -- choose whichever you prefer. +------------------------------------------------------------------------------ +ALTERNATIVE A - MIT License +Copyright (c) 2017 Forrest Smith +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +------------------------------------------------------------------------------ +ALTERNATIVE B - Public Domain (www.unlicense.org) +This is free and unencumbered software released into the public domain. +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this +software, either in source code form or as a compiled binary, for any purpose, +commercial or non-commercial, and by any means. +In jurisdictions that recognize copyright laws, the author or authors of this +software dedicate any and all copyright interest in the software to the public +domain. We make this dedication for the benefit of the public at large and to +the detriment of our heirs and successors. We intend this dedication to be an +overt act of relinquishment in perpetuity of all present and future rights to +this software under copyright law. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------------------------------------------------------------------------------ \ No newline at end of file diff --git a/fts_winsnap.sln b/fts_winsnap.sln new file mode 100644 index 0000000..2197991 --- /dev/null +++ b/fts_winsnap.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2027 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "fts_winsnap", "fts_winsnap\fts_winsnap.csproj", "{922E2C72-D829-4239-944A-E85AEE1E2A2A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {922E2C72-D829-4239-944A-E85AEE1E2A2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {922E2C72-D829-4239-944A-E85AEE1E2A2A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {922E2C72-D829-4239-944A-E85AEE1E2A2A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {922E2C72-D829-4239-944A-E85AEE1E2A2A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F91CF0A6-E073-4CDF-9C9E-12ECD7F764BF} + EndGlobalSection +EndGlobal diff --git a/fts_winsnap/App.config b/fts_winsnap/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/fts_winsnap/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/fts_winsnap/Properties/AssemblyInfo.cs b/fts_winsnap/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..356379b --- /dev/null +++ b/fts_winsnap/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("fts_winsnap")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("fts_winsnap")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("922e2c72-d829-4239-944a-e85aee1e2a2a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/fts_winsnap/Properties/Resources.Designer.cs b/fts_winsnap/Properties/Resources.Designer.cs new file mode 100644 index 0000000..4e5fc21 --- /dev/null +++ b/fts_winsnap/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace fts_winsnap.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("fts_winsnap.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/fts_winsnap/Properties/Resources.resx b/fts_winsnap/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/fts_winsnap/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/fts_winsnap/Properties/Settings.Designer.cs b/fts_winsnap/Properties/Settings.Designer.cs new file mode 100644 index 0000000..da0894d --- /dev/null +++ b/fts_winsnap/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace fts_winsnap.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/fts_winsnap/Properties/Settings.settings b/fts_winsnap/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/fts_winsnap/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/fts_winsnap/SnapTool.ico b/fts_winsnap/SnapTool.ico new file mode 100644 index 0000000000000000000000000000000000000000..3690adbf63533401e3d75f3cf3e2244a23d91fad GIT binary patch literal 67646 zcmeI5d5~4royT8;ETV#dECC6N7(fPvxD7K2Z8Tsqabn2gsHuuWio}{39j3-)j3l8O z5CTm%4b9Ts^!9q8St8Ml1?WgAVhW9PMP`f>;~yi1j#@L08b|~!)op)aM zdw1#A%eh^r-#vFZ=lA=5&+A!T==?PVHC)R*6D5$w7zw0F+T=lAwW~lojQ4;gy9lKOMs`#B}|b3 zw=*Qnk}x|qXwcQeMvRy{deWrpX3m>8|EAk+yXC8Q-uacU-F^4%1ok<`x$)DcT_@Mh z;~w|k_B2R~G^a?QT#y%ek~cCSi!BQRLWEm^q)nXzZ`x_P>-tQ-H~fd{_7 zVbi9Xs@mE%;qSDG+c1uiHhD;ysQpLDlf023A&XZQkP%twBW#->Ao$$C4h(5yacR;g zQ_p9AcEN(r|76vwpKhEn=oPC13&uFeOs%lo|1O@Ojq1=_jzPOwg;9kzYkfFIUzebc;&#h2LeWh zjXslhp8D?bKI;alS3fH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/null +++ b/fts_winsnap/fts_winsnap.Designer.cs @@ -0,0 +1,69 @@ +namespace fts_winsnap +{ + partial class fts_winsnap + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fts_winsnap)); + this._notifyIcon = new System.Windows.Forms.NotifyIcon(this.components); + this.SuspendLayout(); + // + // _notifyIcon + // + this._notifyIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info; + this._notifyIcon.BalloonTipText = "fts_winsnap"; + this._notifyIcon.BalloonTipTitle = "fts_winsnap"; + this._notifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("_notifyIcon.Icon"))); + this._notifyIcon.Text = "fts_winsnap"; + this._notifyIcon.Visible = true; + this._notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(this._notifyIcon_MouseClick); + this._notifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this._notifyIcon_MouseDoubleClick); + // + // fts_winsnap + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScroll = true; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(584, 761); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "fts_winsnap"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "fts_winsnap"; + this.Click += new System.EventHandler(this.fts_winsnap_Click); + this.Resize += new System.EventHandler(this.fts_winsnap_Resize); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.NotifyIcon _notifyIcon; + } +} + diff --git a/fts_winsnap/fts_winsnap.cs b/fts_winsnap/fts_winsnap.cs new file mode 100644 index 0000000..a4c368b --- /dev/null +++ b/fts_winsnap/fts_winsnap.cs @@ -0,0 +1,788 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using System.Windows.Forms; +using Newtonsoft.Json; + +namespace fts_winsnap +{ + public partial class fts_winsnap : Form + { + // Native imports + [DllImport("user32.dll")] static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vk); + [DllImport("user32.dll")] static extern bool UnregisterHotKey(IntPtr hWnd, int id); + [DllImport("user32.dll")] static extern IntPtr GetForegroundWindow(); + [DllImport("user32.dll")] static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect); + [DllImport("user32.dll")] static extern bool GetClientRect(IntPtr hWnd, out RECT lpRect); + [DllImport("user32.dll")] static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow); + [DllImport("user32.dll")] static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); enum ShowCmd : int { Hide = 0, Normal = 1, Minimize = 2, Maximize = 3, Restore = 9 } + [DllImport("user32.dll")] static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint); // screen coords + [DllImport("user32.dll")] static extern bool GetWindowPlacement(IntPtr hWnd, out WINDOWPLACEMENT lpwndpl); + [DllImport("user32.dll")] static extern bool SetWindowPlacement(IntPtr hWnd, [In] ref WINDOWPLACEMENT lpwndpl); // workspace coords + [DllImport("user32.dll")] static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); enum SWP_FLAGS : uint { NO_SIZE = 0x0001, NO_MOVE = 0x0002, NO_REDRAW = 0x0008 } + + // Native structures + [StructLayout(LayoutKind.Sequential)] struct RECT { + public int Left, Top, Right, Bottom; + public int Width { get { return Right - Left; } } + public int Height { get { return Bottom - Top; } } + + public RECT(int _left, int _top, int _right, int _bottom) { Left = _left; Top = _top; Right = _right; Bottom = _bottom; } + public RECT(Rectangle r) { Left = r.Left; Top = r.Top; Right = r.Right; Bottom = r.Bottom; } + public Rectangle AsRectangle() { return new Rectangle(Left, Top, Width, Height); } + public RECT Extended(RECT other) { return new RECT(Math.Min(Left, other.Left), Math.Min(Top, other.Top), Math.Max(Right, other.Right), Math.Max(Bottom, other.Bottom)); } + } + + [StructLayout(LayoutKind.Sequential)] struct WINDOWPLACEMENT { + public int length; + public int flags; + public ShowCmd showCmd; + public System.Drawing.Point ptMinPosition; + public System.Drawing.Point ptMaxPosition; + public RECT rcNormalPosition; + } + enum ShowWindowCommands : int { Hide = 0, Normal = 1, Minimized = 2, Maximized = 3, } + + + + // Fields + List _layouts = new List(); + Settings _settings = null; + bool _runOnStartup = false; + + + // Properties + IEnumerable
Sections { + get { + foreach (var layout in _layouts) + foreach (var section in layout.Sections) + yield return section; + } + } + + + // Methods + public fts_winsnap() + { + // Set working dir to exe dir so app don't crash on startup + var exePath = System.IO.Path.GetDirectoryName(Application.ExecutablePath); + bool autoStarted = Environment.CurrentDirectory != exePath; + if (autoStarted) + Environment.CurrentDirectory = exePath; + + // Read settings from disk (if there are any) + LoadSettings(); + + // Check registry for startup option + var registryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); + var v = registryKey.GetValue("fts_winsnap") as string; + if (v == Application.ExecutablePath) + _runOnStartup = true; + + // WinForm Component initialization + InitializeComponent(); + this._notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(new System.Windows.Forms.MenuItem[]{ + new System.Windows.Forms.MenuItem("Show fts_winsnap", (object sender, System.EventArgs e)=>{ this?.Show(); }), + new System.Windows.Forms.MenuItem("Close fts_winsnap", (object sender, System.EventArgs e)=>{ this?.Close(); }) + }); + Application.ApplicationExit += new EventHandler(this.OnApplicationExit); + + // Minimize to task bar if app was automatically launched by Windows on startup + if (autoStarted) { + this.ShowInTaskbar = false; + this.WindowState = FormWindowState.Minimized; + } + + // Register hotkeys + RegisterHotKey(this.Handle, 0, Constants.WM_MOD_CTRL | Constants.WM_MOD_ALT, (int)Keys.Left); + RegisterHotKey(this.Handle, 1, Constants.WM_MOD_CTRL | Constants.WM_MOD_ALT, (int)Keys.Right); + RegisterHotKey(this.Handle, 2, Constants.WM_MOD_CTRL | Constants.WM_MOD_ALT, (int)Keys.Up); + RegisterHotKey(this.Handle, 3, Constants.WM_MOD_CTRL | Constants.WM_MOD_ALT, (int)Keys.Down); + RegisterHotKey(this.Handle, 4, Constants.WM_MOD_CTRL | Constants.WM_MOD_SHIFT | Constants.WM_MOD_ALT, (int)Keys.Down); + RegisterHotKey(this.Handle, 5, Constants.WM_MOD_CTRL | Constants.WM_MOD_SHIFT | Constants.WM_MOD_ALT, (int)Keys.Left); + RegisterHotKey(this.Handle, 6, Constants.WM_MOD_CTRL | Constants.WM_MOD_SHIFT | Constants.WM_MOD_ALT, (int)Keys.Right); + RegisterHotKey(this.Handle, 7, Constants.WM_MOD_CTRL | Constants.WM_MOD_SHIFT | Constants.WM_MOD_ALT, (int)Keys.Up); + + + // Initialize fonts for UI + var helveticaFamily = new FontFamily("Helvetica"); + var monospaceFamily = new FontFamily(System.Drawing.Text.GenericFontFamilies.Monospace); + + var pfc = new System.Drawing.Text.PrivateFontCollection(); + pfc.AddFontFile(@"Karla-Regular.ttf"); + var karlaFamily = pfc.Families[0]; + + + // Initialize per-monitor settings + while (_settings.monitorSettings.Count < Screen.AllScreens.Count()) { + var newSettings = new Settings.MonitorSettings(); + _settings.monitorSettings.Add(newSettings); + } + + // createLabel helper + Func createLabel = + (string text, FontFamily fontFamily, float fontScale, FontStyle fontStyle, Padding padding, Rectangle bounds) => { + var newLabel = new Label(); + newLabel.Text = text; + newLabel.Font = new Font(fontFamily, newLabel.Font.Size * fontScale, fontStyle); + newLabel.AutoSize = true; + newLabel.Padding = padding; + newLabel.Bounds = bounds; + this.Controls.Add(newLabel); + return newLabel; + }; + + // Create UI for each monitor + int idx = 1; + int y = 0; + foreach (var monitor in Screen.AllScreens) + { + // Create a new layout for this monitor + var newLayout = new MonitorLayout(monitor); + _layouts.Add(newLayout); + + // Grab settings for this monitor + var monitorSettings = _settings.monitorSettings[idx - 1]; + + // Monitor # + var titleLabel = createLabel("Monitor " + idx.ToString(), karlaFamily, 2f, FontStyle.Bold, new Padding(4), new Rectangle(0, y, 0, 0)); + + // Resolution: 1920x1080 + var resolutionLabel = createLabel("Resolution: " + monitor.Bounds.Width.ToString() + "x" + monitor.Bounds.Height.ToString(), + karlaFamily, 1.5f, FontStyle.Regular, new Padding(32, 3, 3, 3), new Rectangle(titleLabel.Bounds.Left, titleLabel.Bounds.Bottom, 0, 0)); + + // Resize: + var resizeLabel = createLabel("Resize: ", karlaFamily, 1.5f, FontStyle.Regular, new Padding(32, 0, 0, 0), new Rectangle(0, resolutionLabel.Bottom, 0, 0)); + + var resizeControl = new NumericUpDown(); + resizeControl.Bounds = new Rectangle(resizeLabel.Bounds.Right + 4, resizeLabel.Bounds.Top, 50, 0); + resizeControl.Minimum = -30; + resizeControl.Maximum = 30; + resizeControl.Value = monitorSettings.adjustSize; + resizeControl.AutoSize = true; + resizeControl.TabStop = false; + resizeControl.ValueChanged += (object sender, EventArgs e) => { + // Update settings + newLayout.adjustSize = (int)resizeControl.Value; + monitorSettings.adjustSize = newLayout.adjustSize; + SaveSettings(); + }; + + this.Controls.Add(resizeControl); + + + // Layout plus predefined buttons + var layout = createLabel("Layout: ", karlaFamily, 1.5f, FontStyle.Regular, new Padding(32, 8, 3, 3), new Rectangle(resizeLabel.Bounds.Left, resizeLabel.Bounds.Bottom + 5, 0, 0)); + + var customField = new System.Windows.Forms.TextBox(); + Button selectedBtn = null; + Button customBtn = null; + + // Helper to style button visuals + Action