update invertermon window

This commit is contained in:
djnitehawk 2025-03-18 17:12:52 +05:30
parent e4b874ffa2
commit 68b33186f7
3 changed files with 1235 additions and 1275 deletions

View File

@ -13,45 +13,55 @@ partial class Main
base.Dispose(disposing);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main));
web = new Microsoft.Web.WebView2.WinForms.WebView2();
TrayIcon = new NotifyIcon(components);
TrayIcon = new System.Windows.Forms.NotifyIcon(components);
((System.ComponentModel.ISupportInitialize)web).BeginInit();
SuspendLayout();
//
// web
//
web.AllowExternalDrop = false;
web.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
web.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right));
web.CreationProperties = null;
web.DefaultBackgroundColor = Color.White;
web.Location = new Point(-1, 1);
web.DefaultBackgroundColor = System.Drawing.Color.White;
web.Location = new System.Drawing.Point(-1, 1);
web.Name = "web";
web.Size = new Size(642, 556);
web.Source = new Uri("http://inverter.djnitehawk.com", UriKind.Absolute);
web.Size = new System.Drawing.Size(642, 540);
web.Source = new System.Uri("http://inverter.djnitehawk.com", System.UriKind.Absolute);
web.TabIndex = 0;
web.ZoomFactor = 1D;
//
// TrayIcon
//
TrayIcon.Icon = (Icon)resources.GetObject("TrayIcon.Icon");
TrayIcon.Icon = ((System.Drawing.Icon)resources.GetObject("TrayIcon.Icon"));
TrayIcon.Text = "TrayIcon";
//
// Main
//
AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(639, 558);
AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
BackColor = System.Drawing.SystemColors.Desktop;
ClientSize = new System.Drawing.Size(639, 542);
Controls.Add(web);
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
MaximizeBox = false;
Name = "Main";
ShowIcon = false;
ShowInTaskbar = false;
StartPosition = FormStartPosition.CenterScreen;
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
Text = "InverterMon Window";
TopMost = true;
TransparencyKey = System.Drawing.Color.FromArgb(((int)((byte)0)), ((int)((byte)0)), ((int)((byte)64)));
((System.ComponentModel.ISupportInitialize)web).EndInit();
ResumeLayout(false);
}

View File

@ -12,9 +12,21 @@ public partial class Main : Form
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool UnregisterHotKey(IntPtr hWnd, int id);
void SetTitleBarColor(Color color)
{
var colorValue = color.R | (color.G << 8) | (color.B << 16);
DwmSetWindowAttribute(Handle, DWMWA_CAPTION_COLOR, ref colorValue, sizeof(int));
}
[DllImport("dwmapi.dll")]
static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, ref int attrValue, int attrSize);
const int DWMWA_CAPTION_COLOR = 35;
public Main()
{
InitializeComponent();
SetTitleBarColor(Color.Black);
TrayIcon.Click += TrayIcon_Click;
Load += Main_Load;
FormClosed += Main_FormClosed;
@ -62,13 +74,10 @@ public partial class Main : Form
{
case 1: // Alt+I hotkey
if (WindowState == FormWindowState.Normal)
{
WindowState = FormWindowState.Minimized;
}
else
{
TrayIcon_Click(null, null!);
}
break;
}
}

View File

@ -1,64 +1,5 @@
<?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">
@ -112,16 +53,16 @@
<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>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=9.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>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="TrayIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="TrayIcon.TrayLocation" type="System.Drawing.Point, System.Drawing.Primitives, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>13, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="TrayIcon.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<assembly alias="System.Drawing.Common" name="System.Drawing.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"/>
<data name="TrayIcon.Icon" type="System.Drawing.Icon, System.Drawing.Common" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAgIAAAAEAIAAoCAEAFgAAACgAAACAAAAAAAEAAAEAIAAAAAAAAAABACcAAAAnAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA