del /AudioWallpaper.1.2.1.nupkg

This commit is contained in:
2024-10-18 08:30:59 +08:00
parent d351e442ab
commit dba24c0cbb
3773 changed files with 8960 additions and 79217 deletions

View File

@@ -0,0 +1,188 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<None Update="shell\surface0000.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0000_2001.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0000_2002.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0000_2004.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0001.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0002.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0003.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0004.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0005.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0006.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0007.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0008.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0009.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0010.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0020.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0025.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0029.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0030.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0032.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0033.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0034.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0035.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0036.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0037.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0038.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0042.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0043.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0044.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0091.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0092.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface0093.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface1001.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface1002.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface1003.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface1004.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface2001.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface2002.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface2003.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface2004.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3000.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3001.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3002.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3003.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3004.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3005.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3006.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3007.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3100.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3101.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3102.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3103.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3104.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3200.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3201.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3202.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3203.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface3204.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="shell\surface9999.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,130 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace AccompanyingAssistant {
public class BubbleForm : Form {
private string _message = "";
private int cornerRadius = 12;
private int tailHeight = 10;
private Color bubbleColor = Color.FromArgb(255, 255, 230);
private Color borderColor = Color.FromArgb(220, 220, 200);
private Font messageFont = new Font("微软雅黑", 9);
public string Message {
get { return _message; }
set {
_message = value;
CalculateSize();
Invalidate();
}
}
public BubbleForm() {
this.FormBorderStyle = FormBorderStyle.None;
this.ShowInTaskbar = false;
this.StartPosition = FormStartPosition.Manual;
this.Padding = new Padding(12, 12, 12, 12 + tailHeight);
this.BackColor = Color.Magenta;
this.TransparencyKey = Color.Magenta;
this.DoubleBuffered = true;
// 初始大小
this.Size = new Size(200, 100);
// 添加关闭按钮
var closeButton = new Button();
closeButton.Text = "×";
closeButton.FlatStyle = FlatStyle.Flat;
closeButton.FlatAppearance.BorderSize = 0;
closeButton.BackColor = Color.Transparent;
closeButton.ForeColor = Color.Gray;
closeButton.Font = new Font("Arial", 8, FontStyle.Bold);
closeButton.Size = new Size(20, 20);
closeButton.Location = new Point(this.Width - closeButton.Width - 5, 5);
closeButton.Click += (s, e) => this.Hide();
this.Controls.Add(closeButton);
}
public void UpdateSize() {
CalculateSize();
}
private void CalculateSize() {
using (Graphics g = this.CreateGraphics()) {
// 增加最大宽度限制,防止气泡过宽
int maxWidth = Screen.PrimaryScreen.WorkingArea.Width / 3;
SizeF textSize = g.MeasureString(_message, messageFont, maxWidth);
int newWidth = (int)Math.Max(150, Math.Min(maxWidth, textSize.Width + this.Padding.Horizontal));
int newHeight = (int)(textSize.Height + this.Padding.Vertical);
this.Size = new Size(newWidth, newHeight);
if (this.Controls.Count > 0) {
this.Controls[0].Location = new Point(this.Width - 25, 5);
}
}
}
protected override void OnPaint(PaintEventArgs e) {
base.OnPaint(e);
Graphics g = e.Graphics;
g.SmoothingMode = SmoothingMode.AntiAlias;
// 创建气泡路径
GraphicsPath path = new GraphicsPath();
Rectangle mainRect = new Rectangle(0, 0, this.Width, this.Height - tailHeight);
// 绘制圆角矩形主体
path.AddArc(mainRect.X, mainRect.Y, cornerRadius, cornerRadius, 180, 90);
path.AddArc(mainRect.X + mainRect.Width - cornerRadius, mainRect.Y, cornerRadius, cornerRadius, 270, 90);
path.AddArc(mainRect.X + mainRect.Width - cornerRadius, mainRect.Y + mainRect.Height - cornerRadius, cornerRadius, cornerRadius, 0, 90);
// 添加尾巴
int tailWidth = 20;
int tailX = this.Width / 2 - tailWidth / 2;
path.AddLine(mainRect.X + mainRect.Width - cornerRadius, mainRect.Y + mainRect.Height, tailX + tailWidth, mainRect.Y + mainRect.Height);
path.AddLine(tailX + tailWidth, mainRect.Y + mainRect.Height, this.Width / 2, this.Height);
path.AddLine(this.Width / 2, this.Height, tailX, mainRect.Y + mainRect.Height);
path.AddLine(tailX, mainRect.Y + mainRect.Height, mainRect.X + cornerRadius, mainRect.Y + mainRect.Height);
path.AddArc(mainRect.X, mainRect.Y + mainRect.Height - cornerRadius, cornerRadius, cornerRadius, 90, 90);
// 填充气泡
using (Brush bubbleBrush = new SolidBrush(bubbleColor)) {
g.FillPath(bubbleBrush, path);
}
// 绘制边框
using (Pen borderPen = new Pen(borderColor, 1)) {
g.DrawPath(borderPen, path);
}
// 绘制文本
using (Brush textBrush = new SolidBrush(Color.Black)) {
g.DrawString(_message, messageFont, textBrush,
new RectangleF(
this.Padding.Left,
this.Padding.Top,
this.Width - this.Padding.Horizontal,
this.Height - this.Padding.Vertical));
}
}
private void InitializeComponent() {
this.SuspendLayout();
//
// BubbleForm
//
this.ClientSize = new System.Drawing.Size(284, 261);
this.Name = "BubbleForm";
this.ResumeLayout(false);
}
}
}

View File

@@ -0,0 +1,120 @@
<?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>
</root>

191
AccompanyingAssistant/MainForm.Designer.cs generated Normal file
View File

@@ -0,0 +1,191 @@
namespace AccompanyingAssistant {
partial class MainForm {
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent() {
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.tmrDrag = new System.Windows.Forms.Timer(this.components);
this.rightClickMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.退ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tmrBlink = new System.Windows.Forms.Timer(this.components);
this.tmrBubble = new System.Windows.Forms.Timer(this.components);
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.rightClickMenu.SuspendLayout();
this.SuspendLayout();
//
// tmrDrag
//
this.tmrDrag.Tick += new System.EventHandler(this.tmrDrag_Tick);
//
// rightClickMenu
//
this.rightClickMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.退ToolStripMenuItem,
this.ToolStripMenuItem,
this.ToolStripMenuItem,
this.ToolStripMenuItem});
this.rightClickMenu.Name = "rightClickMenu";
this.rightClickMenu.Size = new System.Drawing.Size(181, 114);
//
// 退出ToolStripMenuItem
//
this.退ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.退ToolStripMenuItem.Text = "退出";
this.退ToolStripMenuItem.Click += new System.EventHandler(this.退ToolStripMenuItem_Click);
//
// 眨眼ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "眨眼ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "眨眼";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 衣柜ToolStripMenuItem
//
this.ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem,
this.ToolStripMenuItem,
this.ToolStripMenuItem,
this.ToolStripMenuItem,
this.ToolStripMenuItem,
this.ToolStripMenuItem});
this.ToolStripMenuItem.Name = "衣柜ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "衣柜";
//
// 圣诞帽子ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "圣诞帽子ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.ToolStripMenuItem.Text = "帽子 — 圣诞";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 樱花帽子ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "樱花帽子ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.ToolStripMenuItem.Text = "帽子 — 樱花";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 水手帽ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "水手帽ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.ToolStripMenuItem.Text = "帽子 — 水手帽";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 风车帽子ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "风车帽子ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.ToolStripMenuItem.Text = "帽子 — 风车";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 圣诞衣服ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "圣诞衣服ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.ToolStripMenuItem.Text = "衣服 — 圣诞";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// 和服ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "和服ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.ToolStripMenuItem.Text = "衣服 — 和服";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// tmrBlink
//
this.tmrBlink.Tick += new System.EventHandler(this.tmrBlink_Tick);
//
// tmrBubble
//
this.tmrBubble.Tick += new System.EventHandler(this.tmrBubble_Tick);
//
// notifyIcon1
//
this.notifyIcon1.ContextMenuStrip = this.rightClickMenu;
this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
this.notifyIcon1.Text = "notifyIcon1";
this.notifyIcon1.Visible = true;
//
// 消息测试ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "消息测试ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "消息测试";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(266, 242);
this.ContextMenuStrip = this.rightClickMenu;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Name = "Form1";
this.ShowInTaskbar = false;
this.Text = "Form1";
this.TopMost = true;
this.Load += new System.EventHandler(this.Form1_Load);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseUp);
this.rightClickMenu.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Timer tmrDrag;
private System.Windows.Forms.ContextMenuStrip rightClickMenu;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 退ToolStripMenuItem;
private System.Windows.Forms.Timer tmrBlink;
private System.Windows.Forms.Timer tmrBubble;
private System.Windows.Forms.NotifyIcon notifyIcon1;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
}
}

View File

@@ -0,0 +1,342 @@
using System.ComponentModel;
namespace AccompanyingAssistant {
public partial class MainForm : Form {
bool haveHandle = true; //<2F><><EFBFBD><EFBFBD>SetBits
bool bFormDragging = false; // <20><><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>ƶ<EFBFBD>
Point oPointClicked; // <20><><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>ƶ<EFBFBD>
int dragFrame = 0; //<2F><>ק֡<D7A7><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int blinkFrame = 0; //գ<><D5A3>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int hatNum = -1;
int clothesNum = -1;
private enum PetStates { General = 0, Drag = 1 };
Bitmap[] pet = new Bitmap[30];
Bitmap[] petDrag = new Bitmap[3];
Bitmap[] petBlink = new Bitmap[2];
Bitmap[,] petHat = new Bitmap[10, 2];
Bitmap[,] petClothes = new Bitmap[5, 4];
Bitmap[] petWithClothes = new Bitmap[30];
Bitmap[] petDragWithClothes = new Bitmap[3];
Bitmap[] petBlinkWithClothes = new Bitmap[3];
private Queue<string> messageQueue = new Queue<string>();
private bool isBubbleVisible = false;
private int bubbleShowTime = 5000; // <20><>ʾʱ<CABE><CAB1>(<28><><EFBFBD><EFBFBD>)
private DateTime bubbleStartTime;
private BubbleForm bubbleForm;
public MainForm() {
InitializeComponent();
}
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
protected override void OnClosing(CancelEventArgs e) {
e.Cancel = true;
base.OnClosing(e);
haveHandle = false;
}
protected override void OnHandleCreated(EventArgs e) {
InitializeStyles();
base.OnHandleCreated(e);
haveHandle = true;
}
private void InitializeStyles() {
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.UserPaint, true);
UpdateStyles();
}
protected override CreateParams CreateParams {
get {
CreateParams cParms = base.CreateParams;
cParms.ExStyle |= 0x00080000; // WS_EX_LAYERED
return cParms;
}
}
#endregion
public void SetBits(Bitmap bitmap) {
if (!haveHandle) return;
if (!Bitmap.IsCanonicalPixelFormat(bitmap.PixelFormat) || !Bitmap.IsAlphaPixelFormat(bitmap.PixelFormat))
MessageBox.Show("Error Bitmap");
IntPtr oldBits = IntPtr.Zero;
IntPtr screenDC = Win32.GetDC(IntPtr.Zero);
IntPtr hBitmap = IntPtr.Zero;
IntPtr memDc = Win32.CreateCompatibleDC(screenDC);
try {
Win32.Point topLoc = new Win32.Point(Left, Top);
Win32.Size bitMapSize = new Win32.Size(bitmap.Width, bitmap.Height);
Win32.BLENDFUNCTION blendFunc = new Win32.BLENDFUNCTION();
Win32.Point srcLoc = new Win32.Point(0, 0);
hBitmap = bitmap.GetHbitmap(Color.FromArgb(0));
oldBits = Win32.SelectObject(memDc, hBitmap);
blendFunc.BlendOp = Win32.AC_SRC_OVER;
blendFunc.SourceConstantAlpha = 255;
blendFunc.AlphaFormat = Win32.AC_SRC_ALPHA;
blendFunc.BlendFlags = 0;
Win32.UpdateLayeredWindow(Handle, screenDC, ref topLoc, ref bitMapSize, memDc, ref srcLoc, 0, ref blendFunc, Win32.ULW_ALPHA);
} finally {
if (hBitmap != IntPtr.Zero) {
Win32.SelectObject(memDc, oldBits);
Win32.DeleteObject(hBitmap);
}
Win32.ReleaseDC(IntPtr.Zero, screenDC);
Win32.DeleteDC(memDc);
}
}
private Bitmap CombinedPic(Bitmap bottom, Bitmap top, int x, int y) {
Bitmap bitmap = new Bitmap(bottom.Width, bottom.Height);
Graphics g = Graphics.FromImage(bitmap);
g.DrawImage(bottom, new Rectangle(0, 0, bottom.Width, bottom.Height), new Rectangle(0, 0, bottom.Width, bottom.Height), GraphicsUnit.Pixel);
g.DrawImage(top, new Rectangle(x, y, top.Width, top.Height), new Rectangle(0, 0, top.Width, top.Height), GraphicsUnit.Pixel);
return bitmap;
}
private Bitmap Dress(Bitmap img, int state) {
Bitmap bitmap = new Bitmap(img.Width, img.Height);
bitmap = img;
if (clothesNum != -1) {
bitmap = CombinedPic(bitmap, petClothes[clothesNum, state], 0, 0);
}
if (hatNum != -1) {
bitmap = CombinedPic(bitmap, petHat[hatNum, state], 0, 0);
}
return bitmap;
}
protected override void OnLocationChanged(EventArgs e) {
base.OnLocationChanged(e);
if (isBubbleVisible) {
bubbleForm.Location = CalculateBubblePosition();
}
}
private void Form1_Load(object sender, EventArgs e) {
pet[0] = new Bitmap(Application.StartupPath + "\\shell\\surface0000.png");
pet[1] = new Bitmap(Application.StartupPath + "\\shell\\surface0001.png");
pet[2] = new Bitmap(Application.StartupPath + "\\shell\\surface0002.png");
pet[3] = new Bitmap(Application.StartupPath + "\\shell\\surface0003.png");
pet[4] = new Bitmap(Application.StartupPath + "\\shell\\surface0004.png");
pet[5] = new Bitmap(Application.StartupPath + "\\shell\\surface0005.png");
pet[6] = new Bitmap(Application.StartupPath + "\\shell\\surface0006.png");
pet[7] = new Bitmap(Application.StartupPath + "\\shell\\surface0007.png");
pet[8] = new Bitmap(Application.StartupPath + "\\shell\\surface0008.png");
pet[9] = new Bitmap(Application.StartupPath + "\\shell\\surface0009.png");
petDrag[0] = new Bitmap(Application.StartupPath + "\\shell\\surface0091.png");
petDrag[1] = new Bitmap(Application.StartupPath + "\\shell\\surface0092.png");
petDrag[2] = new Bitmap(Application.StartupPath + "\\shell\\surface0093.png");
petBlink[0] = new Bitmap(Application.StartupPath + "\\shell\\surface1003.png");
petBlink[1] = new Bitmap(Application.StartupPath + "\\shell\\surface1004.png");
petHat[0, 0] = new Bitmap(Application.StartupPath + "\\shell\\surface3000.png");
petHat[0, 1] = new Bitmap(Application.StartupPath + "\\shell\\surface3001.png");
petHat[1, 0] = new Bitmap(Application.StartupPath + "\\shell\\surface3002.png");
petHat[1, 1] = new Bitmap(Application.StartupPath + "\\shell\\surface3003.png");
petHat[2, 0] = new Bitmap(Application.StartupPath + "\\shell\\surface3004.png");
petHat[2, 1] = new Bitmap(Application.StartupPath + "\\shell\\surface3005.png");
petHat[3, 0] = new Bitmap(Application.StartupPath + "\\shell\\surface3006.png");
petHat[3, 1] = new Bitmap(Application.StartupPath + "\\shell\\surface3007.png");
petClothes[0, 0] = new Bitmap(Application.StartupPath + "\\shell\\surface3100.png");
petClothes[0, 1] = new Bitmap(Application.StartupPath + "\\shell\\surface3101.png");
petClothes[0, 2] = new Bitmap(Application.StartupPath + "\\shell\\surface3102.png");
petClothes[0, 3] = new Bitmap(Application.StartupPath + "\\shell\\surface3103.png");
petClothes[1, 0] = new Bitmap(Application.StartupPath + "\\shell\\surface3200.png");
petClothes[1, 1] = new Bitmap(Application.StartupPath + "\\shell\\surface3201.png");
petClothes[1, 2] = new Bitmap(Application.StartupPath + "\\shell\\surface3202.png");
petClothes[1, 3] = new Bitmap(Application.StartupPath + "\\shell\\surface3203.png");
DressAll();
SetBits(petWithClothes[0]);
// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD>
InitializeBubbleForm();
}
// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD>
private void InitializeBubbleForm() {
bubbleForm = new BubbleForm();
bubbleForm.Visible = false;
bubbleForm.Owner = this;
bubbleForm.Location = CalculateBubblePosition();
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ã<EFBFBD><C3A3>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD>
private Point CalculateBubblePosition() {
// <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFB4B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>
Point petCenter = new Point(
this.Left + (this.Width / 2),
this.Top
);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD>
return new Point(
petCenter.X - (bubbleForm.Width / 2),
petCenter.Y - bubbleForm.Height - 10
);
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
public void ShowMessage(string message) {
if (isBubbleVisible) {
messageQueue.Enqueue(message);
return;
}
bubbleForm.Message = message;
// <20><>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD>С<EFBFBD>Ѹ<EFBFBD><D1B8><EFBFBD>
bubbleForm.UpdateSize();
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷλ<C8B7><CEBB>
Point bubblePos = CalculateBubblePosition();
bubbleForm.Location = bubblePos;
bubbleForm.Show();
bubbleForm.BringToFront();
isBubbleVisible = true;
bubbleStartTime = DateTime.Now;
tmrBubble.Interval = 100;
tmrBubble.Enabled = true;
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>رյ<D8B1>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>
public void CloseBubble() {
bubbleForm.Hide();
isBubbleVisible = false;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>д<EFBFBD><D0B4><EFBFBD>ʾ<EFBFBD><CABE>Ϣ
if (messageQueue.Count > 0) {
ShowMessage(messageQueue.Dequeue());
}
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD>ʱ<EFBFBD><CAB1>Tick<63>¼<EFBFBD>
private void tmrBubble_Tick(object sender, EventArgs e) {
// <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFB5BD>ʾʱ<CABE><CAB1>
if ((DateTime.Now - bubbleStartTime).TotalMilliseconds >= bubbleShowTime) {
CloseBubble();
}
}
#region <EFBFBD><EFBFBD>ק
private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) {
if (e.Button == System.Windows.Forms.MouseButtons.Left) {
bFormDragging = true;
oPointClicked = new Point(e.X, e.Y);
tmrDrag.Interval = 110;
tmrDrag.Enabled = true;
}
}
private void Form1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) {
if (e.Button == System.Windows.Forms.MouseButtons.Left) {
bFormDragging = false;
tmrDrag.Enabled = false;
SetBits(petWithClothes[0]);
}
}
private void Form1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) {
if (bFormDragging) {
Point oMoveToPoint = default(Point);
//<2F>Ե<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD>Ŀ<EFBFBD><C4BF>λ<EFBFBD><CEBB>
oMoveToPoint = PointToScreen(new Point(e.X, e.Y));
oMoveToPoint.Offset(oPointClicked.X * -1, (oPointClicked.Y + SystemInformation.CaptionHeight + SystemInformation.BorderSize.Height) * -1 + 24);
Location = oMoveToPoint;
}
}
private void tmrDrag_Tick(object sender, EventArgs e) {
if (dragFrame < 2) {
SetBits(petDragWithClothes[dragFrame]);
dragFrame += 1;
} else {
SetBits(petDragWithClothes[dragFrame]);
dragFrame = 0;
}
}
#endregion
private void <EFBFBD>˳<EFBFBD>ToolStripMenuItem_Click(object sender, EventArgs e) {
Application.Exit();
}
private void գ<EFBFBD><EFBFBD>ToolStripMenuItem_Click(object sender, EventArgs e) {
tmrBlink.Interval = 40;
tmrBlink.Start();
}
private void tmrBlink_Tick(object sender, EventArgs e) {
if (blinkFrame < 2) {
SetBits(petBlinkWithClothes[blinkFrame]);
blinkFrame += 1;
} else {
SetBits(petWithClothes[0]);
blinkFrame = 0;
tmrBlink.Stop();
}
}
private void ñ<EFBFBD><EFBFBD>ToolStripMenuItem_Click(object sender, EventArgs e) {
bool itemChecked = (sender as ToolStripMenuItem).Checked;
if (itemChecked) {
hatNum = -1;
} else {
hatNum = this.<EFBFBD>¹<EFBFBD>ToolStripMenuItem.DropDownItems.IndexOf(sender as ToolStripMenuItem);
}
this.ʥ<EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD>ToolStripMenuItem.Checked = false;
this.ӣ<EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD>ToolStripMenuItem.Checked = false;
this.ˮ<EFBFBD><EFBFBD>ñToolStripMenuItem.Checked = false;
this.<EFBFBD>ñ<EFBFBD><EFBFBD>ToolStripMenuItem.Checked = false;
(sender as ToolStripMenuItem).Checked = !itemChecked;
DressAll();
SetBits(petWithClothes[0]);
}
private void <EFBFBD>·<EFBFBD>ToolStripMenuItem_Click(object sender, EventArgs e) {
bool itemChecked = (sender as ToolStripMenuItem).Checked;
if (itemChecked) {
clothesNum = -1;
} else {
clothesNum = this.<EFBFBD>¹<EFBFBD>ToolStripMenuItem.DropDownItems.IndexOf(sender as ToolStripMenuItem) - 4;
}
this.ʥ<EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>ToolStripMenuItem.Checked = false;
this.<EFBFBD>ͷ<EFBFBD>ToolStripMenuItem.Checked = false;
(sender as ToolStripMenuItem).Checked = !itemChecked;
DressAll();
SetBits(petWithClothes[0]);
}
private void DressAll() {
int i;
for (i = 0; i < 10; i++) {
petWithClothes[i] = Dress(pet[i], (int)PetStates.General);
}
for (i = 0; i < 3; i++) {
petDragWithClothes[i] = Dress(petDrag[i], (int)PetStates.Drag);
}
for (i = 0; i < 2; i++) {
petBlinkWithClothes[i] = Dress(petBlink[i], (int)PetStates.General);
}
}
private void <EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ToolStripMenuItem_Click(object sender, EventArgs e) {
ShowMessage("<22><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD>ݣ<EFBFBD>\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD>5<EFBFBD><35><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD>ʧ<EFBFBD><CAA7>\n<><6E><EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD><D4B5><EFBFBD><EFBFBD>Ҽ<EFBFBD><D2BC><EFBFBD><E9BFB4><EFBFBD><EFBFBD>ѡ<EFBFBD>");
}
}
}

View File

@@ -0,0 +1,120 @@
<?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>
</root>

View File

@@ -0,0 +1,14 @@
namespace AccompanyingAssistant {
internal static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main() {
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new MainForm());
}
}
}

View File

@@ -0,0 +1,67 @@
namespace AccompanyingAssistant {
using System;
using System.Runtime.InteropServices;
internal class Win32 {
public const byte AC_SRC_ALPHA = 1;
public const byte AC_SRC_OVER = 0;
public const int ULW_ALPHA = 2;
[DllImport("gdi32.dll")]
public static extern IntPtr CreateCompatibleDC(IntPtr hDC);
[DllImport("gdi32.dll")]
public static extern Bool DeleteDC(IntPtr hdc);
[DllImport("gdi32.dll")]
public static extern Bool DeleteObject(IntPtr hObject);
[DllImport("user32.dll")]
public static extern IntPtr GetDC(IntPtr handle);
[DllImport("user32.dll", ExactSpelling = true)]
public static extern int ReleaseDC(IntPtr handle, IntPtr hDC);
[DllImport("gdi32.dll")]
public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObject);
[DllImport("user32.dll")]
public static extern Bool UpdateLayeredWindow(IntPtr handle, IntPtr hdcDst, ref Point pptDst, ref Size psize, IntPtr hdcSrc, ref Point pprSrc, int crKey, ref BLENDFUNCTION pblend, int dwFlags);
[DllImport("user32.dll")]
public static extern Bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern Bool SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);
[StructLayout(LayoutKind.Sequential)]
public struct BLENDFUNCTION {
public byte BlendOp;
public byte BlendFlags;
public byte SourceConstantAlpha;
public byte AlphaFormat;
}
public enum Bool {
False,
True
}
[StructLayout(LayoutKind.Sequential)]
public struct Point {
public int x;
public int y;
public Point(int x, int y) {
this = new Win32.Point();
this.x = x;
this.y = y;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct Size {
public int cx;
public int cy;
public Size(int cx, int cy) {
this = new Win32.Size();
this.cx = cx;
this.cy = cy;
}
}
}
}

View File

@@ -0,0 +1,51 @@
using AccompanyingAssistant;
public class WindowManager {
private MainForm? mainForm = null;
private Thread? uiThread = null;
public void ShowMain() {
if (mainForm == null || mainForm.IsDisposed) {
uiThread = new Thread(() => {
ApplicationConfiguration.Initialize();
mainForm = new MainForm();
Application.Run(mainForm);
});
uiThread.SetApartmentState(ApartmentState.STA);
uiThread.IsBackground = true;
uiThread.Start();
// 等待窗体创建完毕(简单阻塞)
while (mainForm == null || !mainForm.IsHandleCreated) {
Thread.Sleep(10);
}
} else {
mainForm.Invoke(() => mainForm.Show());
}
}
public void ShowBubble(string message) {
ShowMain();
// 此处保证 ShowMessage 在 UI 线程上执行
if (mainForm != null && mainForm.IsHandleCreated) {
mainForm.Invoke(() => mainForm.ShowMessage(message));
}
}
public void CloseBubble() {
if (mainForm != null && mainForm.IsHandleCreated) {
mainForm.Invoke(() => mainForm.CloseBubble());
}
}
public void CloseMain() {
if (mainForm != null && mainForm.IsHandleCreated) {
mainForm.Invoke(() => {
mainForm.Close();
mainForm.Dispose();
mainForm = null;
});
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB