diff options
author | Your Name <you@example.com> | 2019-01-16 02:48:17 +0900 |
---|---|---|
committer | Your Name <you@example.com> | 2019-01-16 02:48:17 +0900 |
commit | 96dfb5c08ffc78c7eafd833d2a4d5107d5c06d5b (patch) | |
tree | 0e3ff86fb69a3138f367cd1bf6d4bad433c2c37b /WarframeClock | |
download | wf-clock-96dfb5c08ffc78c7eafd833d2a4d5107d5c06d5b.tar.gz |
initial commit
Diffstat (limited to 'WarframeClock')
-rw-r--r-- | WarframeClock/App.config | 6 | ||||
-rw-r--r-- | WarframeClock/ClockOverlay.cs | 196 | ||||
-rw-r--r-- | WarframeClock/Native.cs | 69 | ||||
-rw-r--r-- | WarframeClock/Program.cs | 136 | ||||
-rw-r--r-- | WarframeClock/Properties/AssemblyInfo.cs | 36 | ||||
-rw-r--r-- | WarframeClock/Properties/Resources.resx | 124 | ||||
-rw-r--r-- | WarframeClock/Properties/Resources1.Designer.cs | 73 | ||||
-rw-r--r-- | WarframeClock/Resources/TrayIcon.ico | bin | 0 -> 45451 bytes | |||
-rw-r--r-- | WarframeClock/WarframeClock.csproj | 123 | ||||
-rw-r--r-- | WarframeClock/packages.config | 8 |
10 files changed, 771 insertions, 0 deletions
diff --git a/WarframeClock/App.config b/WarframeClock/App.config new file mode 100644 index 0000000..ff3c507 --- /dev/null +++ b/WarframeClock/App.config @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/> + </startup> +</configuration> diff --git a/WarframeClock/ClockOverlay.cs b/WarframeClock/ClockOverlay.cs new file mode 100644 index 0000000..0e39049 --- /dev/null +++ b/WarframeClock/ClockOverlay.cs @@ -0,0 +1,196 @@ +using System; +using System.Linq; +using Process.NET; +using Process.NET.Memory; +using SharpDX; +using SharpDX.Direct2D1; +using SharpDX.DirectWrite; +using SharpDX.DXGI; +using SharpDX.Mathematics.Interop; +using AlphaMode = SharpDX.Direct2D1.AlphaMode; +using Color = System.Drawing.Color; + +namespace WarframeClock +{ + class ClockOverlay : IDisposable + { + private readonly string targetProcessName; + private Program.WorldStateDataStruct worldStateData; + private IntPtr targetWindowHandle; + private IntPtr handle; + private bool isVisible; + private bool isTopMost; + private IntPtr previousActiveWindow = IntPtr.Zero; + private Native.Rect parentBounds; + + private WindowRenderTarget device; + private SharpDX.Direct2D1.Factory _factory; + private SharpDX.DirectWrite.Factory _fontFactory; + private static readonly Color gdiTransparent = Color.Transparent; + private readonly RawColor4 transparent = new RawColor4(gdiTransparent.R, gdiTransparent.G, gdiTransparent.B, + gdiTransparent.A); + private TextFormat textFont; + private SolidColorBrush textBrush; + + public ClockOverlay(Program.WorldStateDataStruct worldStateData, string targetProcessName) + { + this.worldStateData = worldStateData; + this.targetProcessName = targetProcessName; + + SetupOverlayWindow(); + } + + ~ClockOverlay() + { + Dispose(); + } + + private void SetupOverlayWindow() + { + isVisible = false; + + parentBounds = new Native.Rect() + { + Top = 0, + Left = 0, + Right = Native.GetSystemMetrics(0), + Bottom = Native.GetSystemMetrics(1), + }; + + handle = Native.CreateWindowEx( + 0x8000000 /* WS_EX_NOACTIVATE */ + | 0x80000 /* WS_EX_LAYERED */ + | 0x80 /* WS_EX_TOOLWINDOW */ + | 0x20 /* WS_EX_TRANSPARENT */, + "Static", + "", + 0x8000000 /* WS_DISABLED */ + | 0x80000000 /* WS_POPUP */, + parentBounds.Left, + parentBounds.Top, + parentBounds.Right - parentBounds.Left, + parentBounds.Bottom - parentBounds.Top, + IntPtr.Zero, + IntPtr.Zero, + IntPtr.Zero, + IntPtr.Zero); + if (handle == IntPtr.Zero) + { + throw new Exception("Could not create OverlayWindow"); + } + Native.SetLayeredWindowAttributes(handle, 0, 255, 0x00000002 /* LWA_ALPHA */); + + // Setup Direct* + _factory = new SharpDX.Direct2D1.Factory(); + _fontFactory = new SharpDX.DirectWrite.Factory(); + + var targetProperties = new HwndRenderTargetProperties + { + Hwnd = handle, + PixelSize = new Size2( + parentBounds.Right - parentBounds.Left, + parentBounds.Bottom - parentBounds.Top), + PresentOptions = PresentOptions.None + }; + + var prop = new RenderTargetProperties(RenderTargetType.Hardware, + new PixelFormat(Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied), 0, 0, RenderTargetUsage.None, + FeatureLevel.Level_DEFAULT); + device = new WindowRenderTarget(_factory, prop, targetProperties); + + textBrush = new SolidColorBrush(device, new RawColor4(0xff, 0xff, 0xff, 0x7f)); + textFont = new TextFormat(_fontFactory, "Segoe UI", FontWeight.Normal, FontStyle.Normal, 12); + } + + public void Dispose() + { + textBrush.Dispose(); + textFont.Dispose(); + _fontFactory.Dispose(); + _factory.Dispose(); + device.Dispose(); + + Native.DestroyWindow(handle); + } + + public void Update() + { + GetTargetWindow(); + if (targetWindowHandle != IntPtr.Zero != isVisible) + { + isVisible = !isVisible; + Native.ShowWindow(handle, isVisible ? (uint)5 : 0); + } + if (!isVisible) + return; + + var currentActiveWindow = Native.GetForegroundWindow(); + if (currentActiveWindow == targetWindowHandle != isTopMost) + { + isTopMost = !isTopMost; + Native.SetWindowPos(handle, isTopMost ? -1 : -2, 0, 0, 0, 0, + 0x0001 /* SWP_NOSIZE */ | 0x0002 /* SWP_NOMOVE */); + } + + Native.Rect newBounds; + Native.GetWindowRect(targetWindowHandle, out newBounds); + if (parentBounds.Left != newBounds.Left || parentBounds.Right != newBounds.Right || + parentBounds.Top != newBounds.Top || parentBounds.Bottom != newBounds.Bottom) + { + parentBounds = newBounds; + + var width = parentBounds.Right - parentBounds.Left; + var height = parentBounds.Bottom - parentBounds.Top; + + Native.SetWindowPos(handle, 0, parentBounds.Left, parentBounds.Top, width, height, + 0x0004 /* SWP_NOZORDER */); + + device.Resize(new Size2(width, height)); + + Native.RawMargin _margin; + _margin.cxLeftWidth = parentBounds.Left; + _margin.cxRightWidth = width; + _margin.cyBottomHeight = height; + _margin.cyTopHeight = parentBounds.Top; + Native.DwmExtendFrameIntoClientArea(handle, ref _margin); + } + + // Render text + device.BeginDraw(); + device.Clear(transparent); + + var infoText = $"{worldStateData.CetusExpiryString()} {worldStateData.VallisExpiryString()}"; + device.DrawText(infoText, textFont, + new RawRectangleF(30, parentBounds.Bottom - parentBounds.Top - 50, float.MaxValue, float.MaxValue), + textBrush); + + device.EndDraw(); + } + + private void GetTargetWindow() + { + if (targetWindowHandle == IntPtr.Zero || Native.IsWindow(targetWindowHandle) == 0) + { + targetWindowHandle = IntPtr.Zero; + + var process = System.Diagnostics.Process.GetProcessesByName(targetProcessName).FirstOrDefault(); + if (process == null) + { + Console.WriteLine($"ClockOverlay: Process with name={targetProcessName} not found; skipping"); + return; + } + try + { + using (var processSharp = new ProcessSharp(process, MemoryType.Remote)) + { + targetWindowHandle = processSharp.WindowFactory.MainWindow.Handle; + } + } + catch (InvalidOperationException) + { + // e.g. process is exiting + } + } + } + } +} diff --git a/WarframeClock/Native.cs b/WarframeClock/Native.cs new file mode 100644 index 0000000..e1203a8 --- /dev/null +++ b/WarframeClock/Native.cs @@ -0,0 +1,69 @@ +using System; +using System.Runtime.InteropServices; + +namespace WarframeClock +{ + class Native + { + [DllImport("user32.dll")] + public static extern IntPtr CreateWindowEx( + uint dwExStyle, + string lpClassName, + string lpWindowName, + uint dwStyle, + int x, + int y, + int nWidth, + int nHeight, + IntPtr hWndParent, + IntPtr hMenu, + IntPtr hInstance, + IntPtr lpParam); + + [DllImport("user32.dll")] + public static extern int DestroyWindow(IntPtr hwnd); + + [DllImport("user32.dll")] + public static extern int SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int cx, int cy, + uint uFlags); + + [DllImport("user32.dll")] + public static extern int GetSystemMetrics(int index); + + [DllImport("user32.dll")] + public static extern int IsWindow(IntPtr hWnd); + + [DllImport("user32.dll")] + public static extern IntPtr GetForegroundWindow(); + + [DllImport("user32.dll")] + public static extern int ShowWindow(IntPtr hWnd, uint nCmdShow); + + [DllImport("user32.dll")] + public static extern int GetWindowRect(IntPtr hwnd, out Rect lpRect); + + [DllImport("user32.dll")] + public static extern bool SetLayeredWindowAttributes(IntPtr hwnd, uint crKey, byte bAlpha, uint dwFlags); + + [StructLayout(LayoutKind.Sequential)] + public struct Rect + { + public int Left; + public int Top; + public int Right; + public int Bottom; + } + + [DllImport("dwmapi.dll")] + public static extern void DwmExtendFrameIntoClientArea(IntPtr hWnd, ref RawMargin pMargins); + + [StructLayout(LayoutKind.Sequential)] + public struct RawMargin + { + public int cxLeftWidth; + public int cxRightWidth; + public int cyTopHeight; + public int cyBottomHeight; + } + } +}
\ No newline at end of file diff --git a/WarframeClock/Program.cs b/WarframeClock/Program.cs new file mode 100644 index 0000000..9d287f0 --- /dev/null +++ b/WarframeClock/Program.cs @@ -0,0 +1,136 @@ +using System; +using System.Net.Http; +using System.Threading; +using System.Windows.Forms; +using Newtonsoft.Json; + +namespace WarframeClock +{ + class Program + { + public class WorldStateDataStruct + { + public long CetusExpiry { get; set; } = -1; + + public string CetusExpiryString() + { + if (CetusExpiry < 0) + return "Plains: <NOT READY>"; + + long cetusLen = 150 * 60, cetusDayLen = 100 * 60; + + var currentTime = GetCurrentTime(); + var cetusBegin = CetusExpiry / 1000 - cetusLen; + cetusBegin += (currentTime - cetusBegin) / cetusLen * cetusLen; + + if (currentTime < cetusBegin + cetusDayLen) + return $"Plains: ☀ {GetReadableTimeSpan(cetusBegin + cetusDayLen - currentTime)}"; + else + return $"Plains: 🌙 {GetReadableTimeSpan(cetusBegin + cetusLen - currentTime)}"; + } + + public string VallisExpiryString() + { + long currentTime = GetCurrentTime(); + long dayStart = 1542131224; + dayStart += (currentTime - dayStart) / 1600 * 1600; + + if (currentTime - dayStart < 400) + return $"Vallis: ❄️[→☁] {GetReadableTimeSpan(dayStart + 400 - currentTime)}"; + else if (currentTime - dayStart < 800) + return $"Vallis: ☁[→🌣] {GetReadableTimeSpan(dayStart + 800 - currentTime)}"; + else if (currentTime - dayStart < 1200) + return $"Vallis: 🌣[→☁] {GetReadableTimeSpan(dayStart + 1200 - currentTime)}"; + else + return $"Vallis: ☁[→❄️] {GetReadableTimeSpan(dayStart + 1600 - currentTime)}"; + } + + private long GetCurrentTime() => (long)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds; + + private string GetReadableTimeSpan(long span) => $"{span / 60}m{span % 60}s"; + } + + public static WorldStateDataStruct WorldStateData = new WorldStateDataStruct(); + + [STAThread] + static void Main(string[] args) + { + StartNotifyIcon(); + StartWorldStateFetch(); + StartOverlay(); + } + + private static void StartNotifyIcon() + { + var thread = new Thread(delegate () + { + var iconMenu = new ContextMenu(); + var icon = new NotifyIcon() + { + Text = "Warframe Clock", + ContextMenu = iconMenu, + Icon = Properties.Resources.TrayIcon + }; + + iconMenu.MenuItems.Add("Quit", (_, __) => + { + icon.Dispose(); + Environment.Exit(0); + }); + icon.Visible = true; + + Application.Run(); + }); + thread.Start(); + } + + private static void StartWorldStateFetch() + { + var httpClient = new HttpClient(); + + var period = 10 * 60 * 1000; // 10 Minutes + var timer = new System.Threading.Timer(state => + { + lock (state) + { + var res = httpClient.GetAsync("http://content.warframe.com/dynamic/worldState.php").Result; + if (!res.IsSuccessStatusCode) + { + Console.WriteLine("WorldState: Could not fetch worldState.php"); + return; + } + + var json = res.Content.ReadAsStringAsync().Result; + dynamic obj = JsonConvert.DeserializeObject(json); + + dynamic cetusSyndicate = null; + foreach (var syndicateMission in obj.SyndicateMissions) + { + if (syndicateMission.Tag == "CetusSyndicate") + cetusSyndicate = syndicateMission; + } + if (cetusSyndicate == null) + { + Console.WriteLine("WorldState: CetusSyndicate missions not found"); + return; + } + + dynamic cetusExpiry = cetusSyndicate.Expiry["$date"]["$numberLong"]; + Console.WriteLine($"WorldState: CetusSyndicate missions expire at {cetusExpiry}"); + + WorldStateData.CetusExpiry = cetusExpiry; + } + }, new object(), 0, period); + } + + private static void StartOverlay() + { + var plugin = new ClockOverlay(WorldStateData, "Warframe.x64"); + while (true) + { + plugin.Update(); + Thread.Sleep(16); + } + } + } +} diff --git a/WarframeClock/Properties/AssemblyInfo.cs b/WarframeClock/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b24e4b0 --- /dev/null +++ b/WarframeClock/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("WarframeClock")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WarframeClock")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[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("b6f30bd0-5917-4c89-8c8d-def0029e08a3")] + +// 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/WarframeClock/Properties/Resources.resx b/WarframeClock/Properties/Resources.resx new file mode 100644 index 0000000..a03fc62 --- /dev/null +++ b/WarframeClock/Properties/Resources.resx @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="TrayIcon" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\TrayIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> +</root>
\ No newline at end of file diff --git a/WarframeClock/Properties/Resources1.Designer.cs b/WarframeClock/Properties/Resources1.Designer.cs new file mode 100644 index 0000000..4c6da81 --- /dev/null +++ b/WarframeClock/Properties/Resources1.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// 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. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace WarframeClock.Properties { + using System; + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // 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", "15.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() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WarframeClock.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// </summary> + internal static System.Drawing.Icon TrayIcon { + get { + object obj = ResourceManager.GetObject("TrayIcon", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + } +} diff --git a/WarframeClock/Resources/TrayIcon.ico b/WarframeClock/Resources/TrayIcon.ico Binary files differnew file mode 100644 index 0000000..5d06b9f --- /dev/null +++ b/WarframeClock/Resources/TrayIcon.ico diff --git a/WarframeClock/WarframeClock.csproj b/WarframeClock/WarframeClock.csproj new file mode 100644 index 0000000..1ec7fd2 --- /dev/null +++ b/WarframeClock/WarframeClock.csproj @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{B6F30BD0-5917-4C89-8C8D-DEF0029E08A3}</ProjectGuid> + <OutputType>WinExe</OutputType> + <RootNamespace>WarframeClock</RootNamespace> + <AssemblyName>WarframeClock</AssemblyName> + <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <Deterministic>true</Deterministic> + <TargetFrameworkProfile /> + <PublishUrl>publish\</PublishUrl> + <Install>true</Install> + <InstallFrom>Disk</InstallFrom> + <UpdateEnabled>false</UpdateEnabled> + <UpdateMode>Foreground</UpdateMode> + <UpdateInterval>7</UpdateInterval> + <UpdateIntervalUnits>Days</UpdateIntervalUnits> + <UpdatePeriodically>false</UpdatePeriodically> + <UpdateRequired>false</UpdateRequired> + <MapFileExtensions>true</MapFileExtensions> + <ApplicationRevision>0</ApplicationRevision> + <ApplicationVersion>1.0.0.%2a</ApplicationVersion> + <IsWebBootstrapper>false</IsWebBootstrapper> + <UseApplicationTrust>false</UseApplicationTrust> + <BootstrapperEnabled>true</BootstrapperEnabled> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup> + <StartupObject /> + </PropertyGroup> + <PropertyGroup /> + <PropertyGroup> + <SignAssembly>false</SignAssembly> + </PropertyGroup> + <ItemGroup> + <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> + </Reference> + <Reference Include="Process.NET, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\Process.NET.1.0.8\lib\Process.NET.dll</HintPath> + </Reference> + <Reference Include="SharpDX, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL"> + <HintPath>..\packages\SharpDX.4.2.0\lib\net45\SharpDX.dll</HintPath> + </Reference> + <Reference Include="SharpDX.Direct2D1, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL"> + <HintPath>..\packages\SharpDX.Direct2D1.4.2.0\lib\net45\SharpDX.Direct2D1.dll</HintPath> + </Reference> + <Reference Include="SharpDX.DXGI, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL"> + <HintPath>..\packages\SharpDX.DXGI.4.2.0\lib\net45\SharpDX.DXGI.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="ClockOverlay.cs" /> + <Compile Include="Native.cs" /> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Properties\Resources1.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + <None Include="packages.config" /> + </ItemGroup> + <ItemGroup> + <None Include="Resources\TrayIcon.ico" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources1.Designer.cs</LastGenOutput> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <BootstrapperPackage Include=".NETFramework,Version=v4.6.2"> + <Visible>False</Visible> + <ProductName>Microsoft .NET Framework 4.6.2 %28x86 and x64%29</ProductName> + <Install>true</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.5 SP1</ProductName> + <Install>false</Install> + </BootstrapperPackage> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/WarframeClock/packages.config b/WarframeClock/packages.config new file mode 100644 index 0000000..07efd4d --- /dev/null +++ b/WarframeClock/packages.config @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="Newtonsoft.Json" version="12.0.1" targetFramework="net462" /> + <package id="Process.NET" version="1.0.8" targetFramework="net462" /> + <package id="SharpDX" version="4.2.0" targetFramework="net462" /> + <package id="SharpDX.Direct2D1" version="4.2.0" targetFramework="net462" /> + <package id="SharpDX.DXGI" version="4.2.0" targetFramework="net462" /> +</packages>
\ No newline at end of file |