优化壁纸程序,优化自启动

This commit is contained in:
snltty
2023-11-20 16:07:55 +08:00
parent 2ff34208d8
commit 80581b1008
83 changed files with 4695 additions and 502 deletions

View File

@@ -92,6 +92,7 @@
4. **【--screen-scale】** 屏幕图片缩放比例 **0.2** 默认1/5 4. **【--screen-scale】** 屏幕图片缩放比例 **0.2** 默认1/5
###### 客户端 ###### 客户端
1. **【--name】** 机器名
1. **【--server】** 服务器ip **192.168.1.18** 1. **【--server】** 服务器ip **192.168.1.18**
2. **【--service】** 服务端口 **1802** 2. **【--service】** 服务端口 **1802**
3. **【--share-key】** 自定数据共享 **cmonitor/share**每项数据长度255,klen+key+vlen+value 3. **【--share-key】** 自定数据共享 **cmonitor/share**每项数据长度255,klen+key+vlen+value
@@ -104,7 +105,8 @@
## 安装示例 ## 安装示例
##### windows计划任务客户端、服务端 ##### windows计划任务客户端、服务端
也可以运行 comitor.install.win.exe 进行安装操作 1. 也可以运行 comitor.install.win.exe 进行安装操作
2. 计划任务可以用ONLOGON以在用户登录系统后运行任务但是有时候需要在登录前就启动程序以远程操作解锁系统那就需要以ONSTART创建任务但是某些系统下ONSTART无法运行因此在 **Ctrl+Alt+Delete 服务**中有第四参数,填入主程序启动参数,可以在此服务中启动主程序
``` ```
params = " --report-delay 30 --screen-delay 200 --screen-scale 0.2"; params = " --report-delay 30 --screen-delay 200 --screen-scale 0.2";
//client //client
@@ -116,6 +118,16 @@ params = " --mode server --web 1800 --api 1801 --service 1802";
schtasks.exe /create /tn "cmonitor" /rl highest /sc ONSTART /delay 0000:30 /tr "\"{exePath}\"{params}" /f schtasks.exe /create /tn "cmonitor" /rl highest /sc ONSTART /delay 0000:30 /tr "\"{exePath}\"{params}" /f
``` ```
##### Ctrl+Alt+Delete 服务
必须以windows service方式运行cmonitor.sas.service.exe 才能使用**SendSAS**模拟**Ctrl+Alt+Delete**{params}为主程序启动参数,不填则不在此服务内启动主程序
```
sc create "cmonitor.sas.service"
binpath="xx\xx\cmonitor.sas.service.exe {--share-key} {--share-len} 3 {params}"
start=AUTO
```
##### linux服务端 systemd ##### linux服务端 systemd
``` ```
//1、下载linux版本程序放到 /usr/local/cmonitor 文件夹,并在文件夹下创建一个 log 目录 //1、下载linux版本程序放到 /usr/local/cmonitor 文件夹,并在文件夹下创建一个 log 目录
@@ -153,13 +165,6 @@ snltty/cmonitor-alpine-x64 \
--entrypoint ./cmonitor.run --mode server --web 1800 --api 1801 --service 1802 --entrypoint ./cmonitor.run --mode server --web 1800 --api 1801 --service 1802
``` ```
##### Ctrl+Alt+Delete 服务
由于使用**SendSAS**模拟**Ctrl+Alt+Delete**需要以windows service方式运行所以需要将 cmonitor.sas.service.exe 安装到服务中,可以使用 sc create创建服务不需要此功能可以不安装
```
sc create "cmonitor.sas.service"
binpath="xx\xx\cmonitor.sas.service.exe {--share-key} {--share-len} 3"
start=AUTO
```
## 发布项目 ## 发布项目
1. nodejs 16.17.0 vue3.0 web 1. nodejs 16.17.0 vue3.0 web

View File

@@ -63,6 +63,7 @@
this.installBtn = new System.Windows.Forms.Button(); this.installBtn = new System.Windows.Forms.Button();
this.label15 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label();
this.runBtn = new System.Windows.Forms.Button(); this.runBtn = new System.Windows.Forms.Button();
this.sasStart = new System.Windows.Forms.CheckBox();
this.SuspendLayout(); this.SuspendLayout();
// //
// serverIP // serverIP
@@ -152,11 +153,11 @@
// sasService // sasService
// //
this.sasService.AutoSize = true; this.sasService.AutoSize = true;
this.sasService.Location = new System.Drawing.Point(234, 51); this.sasService.Location = new System.Drawing.Point(261, 53);
this.sasService.Name = "sasService"; this.sasService.Name = "sasService";
this.sasService.Size = new System.Drawing.Size(168, 16); this.sasService.Size = new System.Drawing.Size(66, 16);
this.sasService.TabIndex = 10; this.sasService.TabIndex = 10;
this.sasService.Text = "ctrl+alt+delete(SAS)服务"; this.sasService.Text = "SAS服务";
this.sasService.UseVisualStyleBackColor = true; this.sasService.UseVisualStyleBackColor = true;
// //
// label5 // label5
@@ -348,11 +349,23 @@
this.runBtn.UseVisualStyleBackColor = true; this.runBtn.UseVisualStyleBackColor = true;
this.runBtn.Click += new System.EventHandler(this.RunClick); this.runBtn.Click += new System.EventHandler(this.RunClick);
// //
// sasStart
//
this.sasStart.AutoSize = true;
this.sasStart.Location = new System.Drawing.Point(328, 53);
this.sasStart.Name = "sasStart";
this.sasStart.Size = new System.Drawing.Size(66, 16);
this.sasStart.TabIndex = 34;
this.sasStart.Text = "SAS启动";
this.sasStart.UseVisualStyleBackColor = true;
this.sasStart.CheckedChanged += new System.EventHandler(this.sasStart_CheckedChanged);
//
// MainForm // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(416, 401); this.ClientSize = new System.Drawing.Size(411, 401);
this.Controls.Add(this.sasStart);
this.Controls.Add(this.runBtn); this.Controls.Add(this.runBtn);
this.Controls.Add(this.label15); this.Controls.Add(this.label15);
this.Controls.Add(this.installBtn); this.Controls.Add(this.installBtn);
@@ -432,6 +445,7 @@
private System.Windows.Forms.Button installBtn; private System.Windows.Forms.Button installBtn;
private System.Windows.Forms.Label label15; private System.Windows.Forms.Label label15;
private System.Windows.Forms.Button runBtn; private System.Windows.Forms.Button runBtn;
private System.Windows.Forms.CheckBox sasStart;
} }
} }

View File

@@ -16,7 +16,7 @@ namespace cmonitor.install.win
{ {
InitializeComponent(); InitializeComponent();
this.FormBorderStyle = FormBorderStyle.FixedSingle; this.FormBorderStyle = FormBorderStyle.FixedSingle;
this.MaximizeBox = false; this.MaximizeBox = false;
} }
@@ -127,23 +127,32 @@ namespace cmonitor.install.win
string paramStr = string.Join(" ", installParams); string paramStr = string.Join(" ", installParams);
bool installSas = sasService.Checked; bool installSas = sasService.Checked;
bool _sasStart = sasStart.Checked;
string filename = Process.GetCurrentProcess().MainModule.FileName; string filename = Process.GetCurrentProcess().MainModule.FileName;
string dir = Path.GetDirectoryName(filename); string dir = Path.GetDirectoryName(filename);
string exePath = Path.Combine(dir, "cmonitor.win.exe"); string exePath = Path.Combine(dir, "cmonitor.win.exe");
string sasPath = Path.Combine(dir, "cmonitor.sas.service.exe"); string sasPath = Path.Combine(dir, "cmonitor.sas.service.exe");
string sasIndexStr = sasIndex.Text;
Task.Run(() => Task.Run(() =>
{ {
if (installed == false) if (installed == false)
{ {
string str = CommandHelper.Windows(string.Empty, new string[] { string str = CommandHelper.Windows(string.Empty, new string[] {
$"schtasks.exe /create /tn \"cmonitorService\" /rl highest /sc ONSTART /delay 0000:30 /tr \"\"{exePath}\" {paramStr}\" " $"schtasks.exe /create /tn \"cmonitorService\" /rl highest /sc ONSTART /delay 0000:30 /tr \"\"{exePath}\" {paramStr}\" "
}); });
if (installSas) if (installSas)
{ {
string taskStr = $"sc create \"cmonitor.sas.service\" binpath=\"{sasPath} {shareKey} {shareLen} {sasIndexStr} \\\"{paramStr}\\\"\" start=AUTO";
if (_sasStart == false)
{
taskStr = $"sc create \"cmonitor.sas.service\" binpath=\"{sasPath} {shareKey} {shareLen} {sasIndexStr}\" start=AUTO";
}
str = CommandHelper.Windows(string.Empty, new string[] { str = CommandHelper.Windows(string.Empty, new string[] {
$"sc create \"cmonitor.sas.service\" binpath=\"{sasPath}\" start=AUTO", taskStr,
"net start cmonitor.sas.service", "net start cmonitor.sas.service",
}); });
} }
@@ -167,6 +176,7 @@ namespace cmonitor.install.win
CheckInstall(); CheckInstall();
}); });
} }
private bool CheckMode(List<string> installParams) private bool CheckMode(List<string> installParams)
{ {
if (modeClient.Checked == false && modeServer.Checked == false) if (modeClient.Checked == false && modeServer.Checked == false)
@@ -345,7 +355,7 @@ namespace cmonitor.install.win
else else
{ {
Run(); Run();
for (int i = 0; i < 15 && running==false; i++) for (int i = 0; i < 15 && running == false; i++)
{ {
CheckRunning(); CheckRunning();
System.Threading.Thread.Sleep(1000); System.Threading.Thread.Sleep(1000);
@@ -379,5 +389,18 @@ namespace cmonitor.install.win
running = Process.GetProcessesByName("cmonitor").Length > 0; running = Process.GetProcessesByName("cmonitor").Length > 0;
CheckLoading(loading); CheckLoading(loading);
} }
private void sasStart_CheckedChanged(object sender, EventArgs e)
{
if (sasStart.Checked)
{
sasService.Checked = true;
sasService.Enabled = false;
}
else
{
sasService.Enabled = true;
}
}
} }
} }

View File

@@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
@@ -14,6 +15,12 @@ namespace cmonitor.install.win
[STAThread] [STAThread]
static void Main() static void Main()
{ {
Mutex mutex = new Mutex(true, System.Diagnostics.Process.GetCurrentProcess().ProcessName, out bool isAppRunning);
if (isAppRunning == false)
{
Environment.Exit(1);
}
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm()); Application.Run(new MainForm());

View File

@@ -5,6 +5,8 @@ using System.Threading.Tasks;
using System.Threading; using System.Threading;
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Diagnostics;
using System.IO;
namespace cmonitor.sas.service namespace cmonitor.sas.service
{ {
@@ -22,6 +24,8 @@ namespace cmonitor.sas.service
int shareMLength = 10; int shareMLength = 10;
int shareItemMLength = 255; int shareItemMLength = 255;
int shareIndex = 3; int shareIndex = 3;
string mainArgs = string.Empty;
string mainExeName = "cmonitor";
byte[] keyBytes = Encoding.UTF8.GetBytes("cmonitor.sas.service"); byte[] keyBytes = Encoding.UTF8.GetBytes("cmonitor.sas.service");
MemoryMappedFile mmf2; MemoryMappedFile mmf2;
MemoryMappedViewAccessor accessor2; MemoryMappedViewAccessor accessor2;
@@ -36,6 +40,11 @@ namespace cmonitor.sas.service
shareMkey = args[0]; shareMkey = args[0];
shareMLength = int.Parse(args[1]); shareMLength = int.Parse(args[1]);
shareIndex = int.Parse(args[2]); shareIndex = int.Parse(args[2]);
if (args.Length >= 4)
{
mainArgs = args[3];
}
} }
mmf2 = MemoryMappedFile.CreateOrOpen($"Global\\{shareMkey}", shareMLength * shareItemMLength); mmf2 = MemoryMappedFile.CreateOrOpen($"Global\\{shareMkey}", shareMLength * shareItemMLength);
accessor2 = mmf2.CreateViewAccessor(); accessor2 = mmf2.CreateViewAccessor();
@@ -44,8 +53,8 @@ namespace cmonitor.sas.service
catch (Exception) catch (Exception)
{ {
} }
CheckMainProcess();
} }
protected override void OnStop() protected override void OnStop()
{ {
cancellationTokenSource?.Cancel(); cancellationTokenSource?.Cancel();
@@ -118,7 +127,6 @@ namespace cmonitor.sas.service
UpdatedState(index); UpdatedState(index);
} }
private void UpdatedState(int updatedOffset) private void UpdatedState(int updatedOffset)
{ {
accessor2.Write((shareMLength - 1) * shareItemMLength, (byte)1); accessor2.Write((shareMLength - 1) * shareItemMLength, (byte)1);
@@ -126,5 +134,85 @@ namespace cmonitor.sas.service
[DllImport("sas.dll")] [DllImport("sas.dll")]
public static extern void SendSAS(bool asUser); public static extern void SendSAS(bool asUser);
Process proc;
private void CheckMainProcess()
{
if (string.IsNullOrWhiteSpace(mainArgs))
{
return;
}
Task.Factory.StartNew(() =>
{
while (true)
{
try
{
if (Process.GetProcessesByName(mainExeName).Length <= 0)
{
KillExe();
OpenExe();
}
}
catch (Exception)
{
}
Thread.Sleep(30000);
}
}, TaskCreationOptions.LongRunning);
}
private bool OpenExe()
{
try
{
string filename = Process.GetCurrentProcess().MainModule.FileName;
string dir = Path.GetDirectoryName(filename);
string file = Path.Combine(dir, mainExeName);
ProcessStartInfo processStartInfo = new ProcessStartInfo()
{
WorkingDirectory = dir,
FileName = file,
CreateNoWindow = false,
ErrorDialog = false,
UseShellExecute = true,
WindowStyle = ProcessWindowStyle.Hidden,
Arguments = string.Join(" ", this.args),
Verb = "runas",
};
proc = Process.Start(processStartInfo);
return true;
}
catch (Exception)
{
try
{
proc.Kill();
proc.Dispose();
}
catch (Exception)
{
}
proc = null;
}
return false;
}
private void KillExe()
{
try
{
proc?.Close();
proc?.Dispose();
}
catch (Exception)
{
}
finally
{
proc = null;
}
}
} }
} }

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@@ -0,0 +1,50 @@
namespace cmonitor.share.receiver.win
{
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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.SuspendLayout();
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm";
this.Text = "屏幕共享";
this.Load += new System.EventHandler(this.OnLoad);
this.ResumeLayout(false);
}
#endregion
}
}

View File

@@ -0,0 +1,19 @@
using cmonitor.server.client.reports.screen;
using System;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace cmonitor.share.receiver.win
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
private void OnLoad(object sender, EventArgs e)
{
}
}
}

View File

@@ -0,0 +1,400 @@
<?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.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAAAAAAAEAIABdQAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAEAAAABAAgGAAAAXHKoZgAAQCRJ
REFUeNrtnXd8XMW5sJ/ZIq16lyzZsi1Z7sYFY9xxwwUINU7hkpBCQsKFG0joBGKZllySmwspBEJyk5BQ
EhIwfDHYuGKMK+7dlmXZkmVZVu9b5/tjJFuWzqrualfSPP6dn9Y7Z8+Zc3bnPe+88xbQaDQajUbT/xCB
7oDGx2RffCUu/pXN3hOAvNjatI+8+J5s/P+lVnlxn8uPr+kDaAEQzGQ3/hWEAjYkNiAMsDVuUQgSkEQD
4Y1bWIvXoUBI42YBrI1/QxpfAzgBB+BqfO1q/L8DsAP1QF3j1vx1FYJSJNVAQ2NbA9CAiQbM2JHAk4G+
kRpvaAEQKLIvvjIhMWPGCsTiIRlIBlIa/yYDiUA8ENtsi0MNcAGYGo8lmm3+QDbbADyNr+uBcqCi2VYG
lADFwHkExUiKMVGMoAInTkJwk4yHSuDhQH0R/RstAHqKZwCw4iYeSAASEAxCMgIYDmRxaVA3bTbAHOiu
dxM3l7SDpq0MyUkEJ4DjSAqAEkyUYqIccPJUoLvdP9ACwNc8i7qrLqxIwoAkYDQwBhgFDAEGAmlAJPo7
kEANUAicBU4DR4FDwBEkFxA0oKYm2gbhY/r7j883ZAPqSZ2KepKPAsYBVwAZQDQQgZp7a9rHBdQCVcAp
4ACCA0iOATnAOcCthUH30QKgKzwNgBkPscBQYCowBfWkz0LN1/W99S0SKEUJgKPADgTbgdMIKgA3Pwl0
F3sf+kfaUX4CCEwIBgETUIN+NupJH4myqmt6Dgdq6nAQ2ARsR7APOIvEo7WDjqEFQFtkA4JwYBCSq5HM
RzARyARiAt09zWVUAieBvcB6BDuBAiR1Whh4RwuA5mQDM4HPMeFk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fhP9TwA0
8SzwTeCPWJBkADcBXwCuRlUy1vQ96lCW/H8DHwCnUNF7/W7gN9F/BUBL/geoYgCCq1CCYBYwFO1d2Nup
BfKAzcBKJDuJpogHA92t4EALgOZkAzFALWbcpCOZA8xHLSOmobMV9xZcwFnUMt561Bw/H3AD/fZpb4QW
AG2RDQgigHRgKpIFKFfjTCAq0N3TXEY1cArJXgTrgB0I8pHU6gHvHS0AOsovAImJOoYgmQBMRzIbwSjU
NEEbEHsWB0q9PwJ8CmwD9iI5A3j6wxKeL9ACoLNkX3xlQRKHIANV4PQqYCQwDLW0qAOSfIsHlXEnFzgG
fI5gB5JTCCoAFxKt3ncSLQB8QTagAqsGoKYHw4ErUFWOMlGWhUi0DaGjuFAeeZVITiLYj2B/Y/z9SSRF
BKCUdl9ECwBfk43yKzNjxYMNldJ8FDAOldR0MDAIGIgSDP39O5BAJVDQuOWjnvCHgKNIShHUE44LF/BE
oLvbt+jvP76e4zkAzLiIQZKImiYMRE0bRqLSm8UDYc02G70/ZNuNCqypb7aVASeA4wiOIylAeeSVoISB
Wz/dewYtAAJJNqC+AwtmrEhi8ZCMIBlJMqpicjJKWMSj8iA2bXEoISG4ZG8QzTZ/IJttoOblEjWoy4GK
ZlsZakAXA+cRFCMpxkQxUIEbJwIXNBbJ1gQELQCCmWdR35Cb0MbphI1LmoENtRSZgMqIFN64hbV4HYZK
nGpF2SCsLTZQJasdqLm3s/Gvo3GzowZ4XePW/HUVglIk1ainfNOTvgETDZixI4EnA30jNd7QAqCvkX3x
lbj4VzZ7T6Ce2eKyfeTF92Tj/y+1yov7XH58jUaj0Wg0Gk2v5P8D5M/bzdE8cNIAAAAASUVORK5CYII=
</value>
</data>
</root>

View File

@@ -0,0 +1,26 @@
using System;
using System.Threading;
using System.Windows.Forms;
namespace cmonitor.share.receiver.win
{
internal static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
Mutex mutex = new Mutex(true, System.Diagnostics.Process.GetCurrentProcess().ProcessName, out bool isAppRunning);
if (isAppRunning == false)
{
Environment.Exit(1);
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("cmonitor.share.receiver.win")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("cmonitor.share.receiver.win")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("59fcffa4-aab7-423a-ae01-dcde47b2c9c1")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace cmonitor.share.receiver.win.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[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()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[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("cmonitor.share.receiver.win.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <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 cmonitor.share.receiver.win.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;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,306 @@
using cmonitor.server.client.reports.screen.winapis;
using cmonitor.server.client.reports.screen.winapiss;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Text;
using static cmonitor.server.client.reports.screen.winapis.ADVAPI32;
using static cmonitor.server.client.reports.screen.winapiss.User32;
namespace cmonitor.server.client.reports.screen
{
public class Win32Interop
{
private static IntPtr lastInputDesktop;
public static bool GetCurrentDesktop(out string desktopName)
{
var inputDesktop = OpenInputDesktop();
try
{
byte[] deskBytes = new byte[256];
if (!GetUserObjectInformationW(inputDesktop, UOI_NAME, deskBytes, 256, out uint lenNeeded))
{
desktopName = string.Empty;
return false;
}
desktopName = Encoding.Unicode.GetString(deskBytes.Take((int)lenNeeded).ToArray()).Replace("\0", "");
return true;
}
finally
{
CloseDesktop(inputDesktop);
}
}
public static List<WindowsSession> GetActiveSessions()
{
List<WindowsSession> sessions = new List<WindowsSession>();
uint consoleSessionId = Kernel32.WTSGetActiveConsoleSessionId();
sessions.Add(new WindowsSession()
{
Id = consoleSessionId,
Type = WindowsSessionType.Console,
Name = "Console",
Username = GetUsernameFromSessionId(consoleSessionId)
});
IntPtr ppSessionInfo = IntPtr.Zero;
int count = 0;
int enumSessionResult = WTSAPI32.WTSEnumerateSessions(WTSAPI32.WTS_CURRENT_SERVER_HANDLE, 0, 1, ref ppSessionInfo, ref count);
int dataSize = Marshal.SizeOf(typeof(WTSAPI32.WTS_SESSION_INFO));
IntPtr current = ppSessionInfo;
if (enumSessionResult != 0)
{
for (int i = 0; i < count; i++)
{
object wtsInfo = Marshal.PtrToStructure(current, typeof(WTSAPI32.WTS_SESSION_INFO));
if (wtsInfo is null)
{
continue;
}
WTSAPI32.WTS_SESSION_INFO sessionInfo = (WTSAPI32.WTS_SESSION_INFO)wtsInfo;
current += dataSize;
if (sessionInfo.State == WTSAPI32.WTS_CONNECTSTATE_CLASS.WTSActive && sessionInfo.SessionID != consoleSessionId)
{
sessions.Add(new WindowsSession()
{
Id = sessionInfo.SessionID,
Name = sessionInfo.pWinStationName,
Type = WindowsSessionType.RDP,
Username = GetUsernameFromSessionId(sessionInfo.SessionID)
});
}
}
}
return sessions;
}
public static string GetUsernameFromSessionId(uint sessionId)
{
var username = string.Empty;
if (WTSAPI32.WTSQuerySessionInformation(IntPtr.Zero, sessionId, WTSAPI32.WTS_INFO_CLASS.WTSUserName, out var buffer, out var strLen) && strLen > 1)
{
username = Marshal.PtrToStringAnsi(buffer);
WTSAPI32.WTSFreeMemory(buffer);
}
return username ?? string.Empty;
}
public static IntPtr OpenInputDesktop()
{
return User32.OpenInputDesktop(0, true, ACCESS_MASK.GENERIC_ALL);
}
public static bool SwitchToInputDesktop()
{
try
{
CloseDesktop(lastInputDesktop);
IntPtr inputDesktop = OpenInputDesktop();
if (inputDesktop == IntPtr.Zero)
{
return false;
}
bool result = SetThreadDesktop(inputDesktop);
result &= SwitchDesktop(inputDesktop);
lastInputDesktop = inputDesktop;
return result;
}
catch (Exception)
{
return false;
}
}
private static uint GetWinLogonPid(uint dwSessionId)
{
uint winlogonPid = 0;
Process[] processes = Process.GetProcessesByName("winlogon");
foreach (Process p in processes)
{
if ((uint)p.SessionId == dwSessionId)
{
winlogonPid = (uint)p.Id;
}
}
return winlogonPid;
}
private static uint GetDwSessionId(int targetSessionId, bool forceConsoleSession)
{
uint dwSessionId = Kernel32.WTSGetActiveConsoleSessionId();
if (forceConsoleSession == false)
{
List<WindowsSession> activeSessions = GetActiveSessions();
if (activeSessions.Any(x => x.Id == targetSessionId))
{
dwSessionId = (uint)targetSessionId;
}
else
{
dwSessionId = activeSessions.Last().Id;
}
}
return dwSessionId;
}
private static STARTUPINFO GetStartUpInfo(bool hiddenWindow, string desktopName, out uint dwCreationFlags)
{
STARTUPINFO si = new STARTUPINFO();
si.cb = Marshal.SizeOf(si);
si.lpDesktop = @"winsta0\" + desktopName;
if (hiddenWindow)
{
dwCreationFlags = NORMAL_PRIORITY_CLASS | CREATE_UNICODE_ENVIRONMENT | CREATE_NO_WINDOW;
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = 0;
}
else
{
dwCreationFlags = NORMAL_PRIORITY_CLASS | CREATE_UNICODE_ENVIRONMENT | CREATE_NEW_CONSOLE;
}
return si;
}
public static bool CreateInteractiveSystemProcess(string commandLine, int targetSessionId, bool forceConsoleSession, string desktopName, bool hiddenWindow, out PROCESS_INFORMATION procInfo)
{
IntPtr hPToken = IntPtr.Zero;
procInfo = new PROCESS_INFORMATION();
uint dwSessionId = GetDwSessionId(targetSessionId, forceConsoleSession);
uint winlogonPid = GetWinLogonPid(dwSessionId);
IntPtr hProcess = Kernel32.OpenProcess(MAXIMUM_ALLOWED, false, winlogonPid);
if (OpenProcessToken(hProcess, TOKEN_DUPLICATE, ref hPToken) == false)
{
Kernel32.CloseHandle(hProcess);
return false;
}
SECURITY_ATTRIBUTES sa = new SECURITY_ATTRIBUTES();
sa.Length = Marshal.SizeOf(sa);
if (DuplicateTokenEx(hPToken, MAXIMUM_ALLOWED, ref sa, SECURITY_IMPERSONATION_LEVEL.SecurityIdentification, TOKEN_TYPE.TokenPrimary, out IntPtr hUserTokenDup) == false)
{
Kernel32.CloseHandle(hProcess);
Kernel32.CloseHandle(hPToken);
return false;
}
STARTUPINFO si = GetStartUpInfo(hiddenWindow, desktopName, out uint dwCreationFlags);
bool result = CreateProcessAsUser(hUserTokenDup, null, commandLine, ref sa, ref sa, false, dwCreationFlags, IntPtr.Zero, null, ref si, out procInfo);
Kernel32.CloseHandle(hProcess);
Kernel32.CloseHandle(hPToken);
Kernel32.CloseHandle(hUserTokenDup);
return result;
}
public static string GetCommandLine()
{
IntPtr commandLinePtr = Kernel32.GetCommandLine();
return Marshal.PtrToStringAuto(commandLinePtr) ?? string.Empty;
}
public static void RelaunchElevated()
{
try
{
string commandLine = GetCommandLine();
bool result = CreateInteractiveSystemProcess($"{commandLine} --elevated", -1, false, "default", false, out PROCESS_INFORMATION procInfo);
uint code = Kernel32.GetLastError();
if (result)
{
Environment.Exit(0);
}
}
catch
{
}
}
private static string currentUsername = string.Empty;
public static string GetCurrentUserSid()
{
WindowsIdentity currentIdentity = WindowsIdentity.GetCurrent();
currentUsername = currentIdentity.Name;
if (IsSystemUser() == false)
{
return currentIdentity.User.Value;
}
IntPtr hToken;
int sessionId = (int)Kernel32.WTSGetActiveConsoleSessionId();
if (WTSAPI32.WTSQueryUserToken(sessionId, out hToken))
{
try
{
IntPtr tokenInformation;
int returnLength;
if (GetTokenInformation(hToken, TOKEN_INFORMATION_CLASS.TokenUser, IntPtr.Zero, 0, out returnLength) || returnLength == 0)
{
return string.Empty;
}
tokenInformation = Marshal.AllocHGlobal(returnLength);
try
{
if (GetTokenInformation(hToken, TOKEN_INFORMATION_CLASS.TokenUser, tokenInformation, returnLength, out returnLength) == false)
{
return string.Empty;
}
var user = (TOKEN_USER)Marshal.PtrToStructure(tokenInformation, typeof(TOKEN_USER));
string stringSid;
if (ConvertSidToStringSid(user.User.Sid, out stringSid))
{
return stringSid;
}
}
finally
{
Marshal.FreeHGlobal(tokenInformation);
}
}
finally
{
if (hToken != IntPtr.Zero)
{
Marshal.FreeHGlobal(hToken);
}
}
}
return string.Empty;
}
public static bool IsSystemUser()
{
return currentUsername == "NT AUTHORITY\\SYSTEM";
}
}
public enum WindowsSessionType
{
Console = 1,
RDP = 2
}
public class WindowsSession
{
public uint Id { get; set; }
public string Name { get; set; } = string.Empty;
public WindowsSessionType Type { get; set; }
public string Username { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 清单选项
如果想要更改 Windows 用户帐户控制级别,请使用
以下节点之一替换 requestedExecutionLevel 节点。
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
如果你的应用程序需要此虚拟化来实现向后兼容性,则移除此
元素。
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
Windows 版本的列表。取消评论适当的元素,
Windows 将自动选择最兼容的环境。 -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI无需
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
-->
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>

View File

@@ -0,0 +1,102 @@
<?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>{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>cmonitor.share.receiver.win</RootNamespace>
<AssemblyName>cmonitor.share.receiver.win</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</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>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>favicon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Win32Interop.cs" />
<Compile Include="winapis\ADVAPI32.cs" />
<Compile Include="winapis\GDI32.cs" />
<Compile Include="winapis\Kernel32.cs" />
<Compile Include="winapis\NetApi32.cs" />
<Compile Include="winapis\Powrprof.cs" />
<Compile Include="winapis\SECUR32.cs" />
<Compile Include="winapis\Shlwapi.cs" />
<Compile Include="winapis\User32.cs" />
<Compile Include="winapis\WTSAPI32.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="favicon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,381 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
namespace cmonitor.server.client.reports.screen.winapis
{
public static class ADVAPI32
{
#region Structs
public struct TOKEN_PRIVILEGES
{
public struct LUID
{
public uint LowPart;
public int HighPart;
}
[StructLayout(LayoutKind.Sequential, Pack = 4)]
public struct LUID_AND_ATTRIBUTES
{
public LUID Luid;
public uint Attributes;
}
public int PrivilegeCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = ANYSIZE_ARRAY)]
public LUID_AND_ATTRIBUTES[] Privileges;
}
public class USEROBJECTFLAGS
{
public int fInherit = 0;
public int fReserved = 0;
public int dwFlags = 0;
}
[StructLayout(LayoutKind.Sequential)]
public struct SECURITY_ATTRIBUTES
{
public int Length;
public IntPtr lpSecurityDescriptor;
public bool bInheritHandle;
}
[StructLayout(LayoutKind.Sequential)]
public struct PROCESS_INFORMATION
{
public IntPtr hProcess;
public IntPtr hThread;
public int dwProcessId;
public int dwThreadId;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct STARTUPINFO
{
public int cb;
public string lpReserved;
public string lpDesktop;
public string lpTitle;
public int dwX;
public int dwY;
public int dwXSize;
public int dwYSize;
public int dwXCountChars;
public int dwYCountChars;
public int dwFillAttribute;
public int dwFlags;
public short wShowWindow;
public short cbReserved2;
public IntPtr lpReserved2;
public IntPtr hStdInput;
public IntPtr hStdOutput;
public IntPtr hStdError;
}
#endregion
#region Enums
public enum TOKEN_INFORMATION_CLASS
{
/// <summary>
    /// The buffer receives a TOKEN_USER structure that contains the user account of the token.
    /// </summary>
TokenUser = 1,
/// <summary>
    /// The buffer receives a TOKEN_GROUPS structure that contains the group accounts associated with the token.
    /// </summary>
TokenGroups,
/// <summary>
    /// The buffer receives a TOKEN_PRIVILEGES structure that contains the privileges of the token.
    /// </summary>
TokenPrivileges,
/// <summary>
    /// The buffer receives a TOKEN_OWNER structure that contains the default owner security identifier (SID) for newly created objects.
    /// </summary>
TokenOwner,
/// <summary>
    /// The buffer receives a TOKEN_PRIMARY_GROUP structure that contains the default primary group SID for newly created objects.
    /// </summary>
TokenPrimaryGroup,
/// <summary>
    /// The buffer receives a TOKEN_DEFAULT_DACL structure that contains the default DACL for newly created objects.
    /// </summary>
TokenDefaultDacl,
/// <summary>
    /// The buffer receives a TOKEN_SOURCE structure that contains the source of the token. TOKEN_QUERY_SOURCE access is needed to retrieve this information.
    /// </summary>
TokenSource,
/// <summary>
    /// The buffer receives a TOKEN_TYPE value that indicates whether the token is a primary or impersonation token.
    /// </summary>
TokenType,
/// <summary>
    /// The buffer receives a SECURITY_IMPERSONATION_LEVEL value that indicates the impersonation level of the token. If the access token is not an impersonation token, the function fails.
    /// </summary>
TokenImpersonationLevel,
/// <summary>
    /// The buffer receives a TOKEN_STATISTICS structure that contains various token statistics.
    /// </summary>
TokenStatistics,
/// <summary>
    /// The buffer receives a TOKEN_GROUPS structure that contains the list of restricting SIDs in a restricted token.
    /// </summary>
TokenRestrictedSids,
/// <summary>
    /// The buffer receives a DWORD value that indicates the Terminal Services session identifier that is associated with the token.
    /// </summary>
TokenSessionId,
/// <summary>
    /// The buffer receives a TOKEN_GROUPS_AND_PRIVILEGES structure that contains the user SID, the group accounts, the restricted SIDs, and the authentication ID associated with the token.
    /// </summary>
TokenGroupsAndPrivileges,
/// <summary>
    /// Reserved.
    /// </summary>
TokenSessionReference,
/// <summary>
    /// The buffer receives a DWORD value that is nonzero if the token includes the SANDBOX_INERT flag.
    /// </summary>
TokenSandBoxInert,
/// <summary>
    /// Reserved.
    /// </summary>
TokenAuditPolicy,
/// <summary>
    /// The buffer receives a TOKEN_ORIGIN value.
    /// </summary>
TokenOrigin,
/// <summary>
    /// The buffer receives a TOKEN_ELEVATION_TYPE value that specifies the elevation level of the token.
    /// </summary>
TokenElevationType,
/// <summary>
    /// The buffer receives a TOKEN_LINKED_TOKEN structure that contains a handle to another token that is linked to this token.
    /// </summary>
TokenLinkedToken,
/// <summary>
    /// The buffer receives a TOKEN_ELEVATION structure that specifies whether the token is elevated.
    /// </summary>
TokenElevation,
/// <summary>
    /// The buffer receives a DWORD value that is nonzero if the token has ever been filtered.
    /// </summary>
TokenHasRestrictions,
/// <summary>
    /// The buffer receives a TOKEN_ACCESS_INFORMATION structure that specifies security information contained in the token.
    /// </summary>
TokenAccessInformation,
/// <summary>
    /// The buffer receives a DWORD value that is nonzero if virtualization is allowed for the token.
    /// </summary>
TokenVirtualizationAllowed,
/// <summary>
    /// The buffer receives a DWORD value that is nonzero if virtualization is enabled for the token.
    /// </summary>
TokenVirtualizationEnabled,
/// <summary>
    /// The buffer receives a TOKEN_MANDATORY_LABEL structure that specifies the token's integrity level.
    /// </summary>
TokenIntegrityLevel,
/// <summary>
    /// The buffer receives a DWORD value that is nonzero if the token has the UIAccess flag set.
    /// </summary>
TokenUIAccess,
/// <summary>
    /// The buffer receives a TOKEN_MANDATORY_POLICY structure that specifies the token's mandatory integrity policy.
    /// </summary>
TokenMandatoryPolicy,
/// <summary>
    /// The buffer receives the token's logon security identifier (SID).
    /// </summary>
TokenLogonSid,
/// <summary>
    /// The maximum value for this enumeration
    /// </summary>
MaxTokenInfoClass
}
public enum LOGON_TYPE
{
LOGON32_LOGON_INTERACTIVE = 2,
LOGON32_LOGON_NETWORK,
LOGON32_LOGON_BATCH,
LOGON32_LOGON_SERVICE,
LOGON32_LOGON_UNLOCK = 7,
LOGON32_LOGON_NETWORK_CLEARTEXT,
LOGON32_LOGON_NEW_CREDENTIALS
}
public enum LOGON_PROVIDER
{
LOGON32_PROVIDER_DEFAULT,
LOGON32_PROVIDER_WINNT35,
LOGON32_PROVIDER_WINNT40,
LOGON32_PROVIDER_WINNT50
}
[Flags]
public enum CreateProcessFlags
{
CREATE_BREAKAWAY_FROM_JOB = 0x01000000,
CREATE_DEFAULT_ERROR_MODE = 0x04000000,
CREATE_NEW_CONSOLE = 0x00000010,
CREATE_NEW_PROCESS_GROUP = 0x00000200,
CREATE_NO_WINDOW = 0x08000000,
CREATE_PROTECTED_PROCESS = 0x00040000,
CREATE_PRESERVE_CODE_AUTHZ_LEVEL = 0x02000000,
CREATE_SEPARATE_WOW_VDM = 0x00000800,
CREATE_SHARED_WOW_VDM = 0x00001000,
CREATE_SUSPENDED = 0x00000004,
CREATE_UNICODE_ENVIRONMENT = 0x00000400,
DEBUG_ONLY_THIS_PROCESS = 0x00000002,
DEBUG_PROCESS = 0x00000001,
DETACHED_PROCESS = 0x00000008,
EXTENDED_STARTUPINFO_PRESENT = 0x00080000,
INHERIT_PARENT_AFFINITY = 0x00010000
}
public enum TOKEN_TYPE : int
{
TokenPrimary = 1,
TokenImpersonation = 2
}
public enum SECURITY_IMPERSONATION_LEVEL : int
{
SecurityAnonymous = 0,
SecurityIdentification = 1,
SecurityImpersonation = 2,
SecurityDelegation = 3,
}
#endregion
#region Constants
public const int TOKEN_DUPLICATE = 0x0002;
public const uint MAXIMUM_ALLOWED = 0x2000000;
public const int CREATE_NEW_CONSOLE = 0x00000010;
public const int CREATE_NO_WINDOW = 0x08000000;
public const int CREATE_UNICODE_ENVIRONMENT = 0x00000400;
public const int STARTF_USESHOWWINDOW = 0x00000001;
public const int DETACHED_PROCESS = 0x00000008;
public const int TOKEN_ALL_ACCESS = 0x000f01ff;
public const int PROCESS_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFF;
public const int STANDARD_RIGHTS_REQUIRED = 0x000F0000;
public const int SYNCHRONIZE = 0x00100000;
public const int IDLE_PRIORITY_CLASS = 0x40;
public const int NORMAL_PRIORITY_CLASS = 0x20;
public const int HIGH_PRIORITY_CLASS = 0x80;
public const int REALTIME_PRIORITY_CLASS = 0x100;
public const uint SE_PRIVILEGE_ENABLED_BY_DEFAULT = 0x00000001;
public const uint SE_PRIVILEGE_ENABLED = 0x00000002;
public const uint SE_PRIVILEGE_REMOVED = 0x00000004;
public const uint SE_PRIVILEGE_USED_FOR_ACCESS = 0x80000000;
public const int ANYSIZE_ARRAY = 1;
public const int UOI_FLAGS = 1;
public const int UOI_NAME = 2;
public const int UOI_TYPE = 3;
public const int UOI_USER_SID = 4;
public const int UOI_HEAPSIZE = 5;
public const int UOI_IO = 6;
#endregion
#region DLL Imports
[DllImport("advapi32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool AdjustTokenPrivileges(IntPtr tokenHandle,
[MarshalAs(UnmanagedType.Bool)] bool disableAllPrivileges,
ref TOKEN_PRIVILEGES newState,
uint bufferLengthInBytes,
ref TOKEN_PRIVILEGES previousState,
out uint returnLengthInBytes);
[DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool CreateProcessAsUser(
IntPtr hToken,
string lpApplicationName,
string lpCommandLine,
ref SECURITY_ATTRIBUTES lpProcessAttributes,
ref SECURITY_ATTRIBUTES lpThreadAttributes,
bool bInheritHandles,
uint dwCreationFlags,
IntPtr lpEnvironment,
string lpCurrentDirectory,
ref STARTUPINFO lpStartupInfo,
out PROCESS_INFORMATION lpProcessInformation);
[DllImport("advapi32.dll", SetLastError = true)]
public static extern bool AllocateLocallyUniqueId(out IntPtr pLuid);
[DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = false)]
public static extern SECUR32.WinErrors LsaNtStatusToWinError(SECUR32.WinStatusCodes status);
[DllImport("advapi32.dll", SetLastError = true)]
public static extern bool GetTokenInformation(
IntPtr TokenHandle,
TOKEN_INFORMATION_CLASS TokenInformationClass,
IntPtr TokenInformation,
int TokenInformationLength,
out int ReturnLength);
[DllImport("advapi32.dll", SetLastError = true, BestFitMapping = false, ThrowOnUnmappableChar = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool LogonUser(
[MarshalAs(UnmanagedType.LPStr)] string pszUserName,
[MarshalAs(UnmanagedType.LPStr)] string pszDomain,
[MarshalAs(UnmanagedType.LPStr)] string pszPassword,
int dwLogonType,
int dwLogonProvider,
out IntPtr phToken);
[DllImport("advapi32", SetLastError = true), SuppressUnmanagedCodeSecurity]
public static extern bool OpenProcessToken(IntPtr ProcessHandle, int DesiredAccess, ref IntPtr TokenHandle);
[DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool DuplicateTokenEx(
IntPtr hExistingToken,
uint dwDesiredAccess,
ref SECURITY_ATTRIBUTES lpTokenAttributes,
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
TOKEN_TYPE TokenType,
out IntPtr phNewToken);
[DllImport("advapi32.dll", SetLastError = false)]
public static extern uint LsaNtStatusToWinError(uint status);
#endregion
[DllImport("advapi32", CharSet = CharSet.Auto, SetLastError = true), SuppressUnmanagedCodeSecurity]
public static extern bool ConvertSidToStringSid(IntPtr sid, out string stringSid);
[StructLayout(LayoutKind.Sequential)]
public struct TOKEN_USER
{
public SID_AND_ATTRIBUTES User;
}
[StructLayout(LayoutKind.Sequential)]
public struct SID_AND_ATTRIBUTES
{
public IntPtr Sid;
public int Attributes;
}
}
}

View File

@@ -0,0 +1,81 @@
using System;
using System.Runtime.InteropServices;
namespace cmonitor.server.client.reports.screen.winapis
{
public static class GDI32
{
#region Enums
/// <summary>
/// Specifies a raster-operation code. These codes define how the color data for the
/// source rectangle is to be combined with the color data for the destination
/// rectangle to achieve the final color.
/// </summary>
public enum TernaryRasterOperations : uint
{
/// <summary>dest = source</summary>
SRCCOPY = 0x00CC0020,
/// <summary>dest = source OR dest</summary>
SRCPAINT = 0x00EE0086,
/// <summary>dest = source AND dest</summary>
SRCAND = 0x008800C6,
/// <summary>dest = source XOR dest</summary>
SRCINVERT = 0x00660046,
/// <summary>dest = source AND (NOT dest)</summary>
SRCERASE = 0x00440328,
/// <summary>dest = (NOT source)</summary>
NOTSRCCOPY = 0x00330008,
/// <summary>dest = (NOT src) AND (NOT dest)</summary>
NOTSRCERASE = 0x001100A6,
/// <summary>dest = (source AND pattern)</summary>
MERGECOPY = 0x00C000CA,
/// <summary>dest = (NOT source) OR dest</summary>
MERGEPAINT = 0x00BB0226,
/// <summary>dest = pattern</summary>
PATCOPY = 0x00F00021,
/// <summary>dest = DPSnoo</summary>
PATPAINT = 0x00FB0A09,
/// <summary>dest = pattern XOR dest</summary>
PATINVERT = 0x005A0049,
/// <summary>dest = (NOT dest)</summary>
DSTINVERT = 0x00550009,
/// <summary>dest = BLACK</summary>
BLACKNESS = 0x00000042,
/// <summary>dest = WHITE</summary>
WHITENESS = 0x00FF0062,
/// <summary>
/// Capture window as seen on screen. This includes layered windows
/// such as WPF windows with AllowsTransparency="true"
/// </summary>
CAPTUREBLT = 0x40000000
}
#endregion
#region DLL Imports
[DllImport("gdi32.dll", EntryPoint = "BitBlt", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool BitBlt([In] IntPtr hdc, int nXDest, int nYDest, int nWidth, int nHeight, [In] IntPtr hdcSrc, int nXSrc, int nYSrc, TernaryRasterOperations dwRop);
[DllImport("gdi32.dll")]
public static extern IntPtr CreateDC(string lpszDriver, string lpszDevice, string lpszOutput, IntPtr lpInitData);
[DllImport("GDI32.dll")]
public static extern IntPtr CreateCompatibleBitmap(IntPtr hdc, int nWidth, int nHeight); [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("GDI32.dll")]
public static extern IntPtr GetDeviceCaps(IntPtr hdc, int nIndex);
[DllImport("GDI32.dll")]
public static extern IntPtr SelectObject(IntPtr hdc, IntPtr hgdiobj);
#endregion
}
}

View File

@@ -0,0 +1,93 @@
using System;
using System.Runtime.InteropServices;
namespace cmonitor.server.client.reports.screen.winapis
{
public static class Kernel32
{
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool CloseHandle(IntPtr hSnapshot);
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr GetCommandLine();
[DllImport("kernel32.dll")]
public static extern IntPtr GetConsoleWindow();
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool GlobalMemoryStatusEx([In, Out] MEMORYSTATUSEX lpBuffer);
[DllImport("kernel32.dll")]
public static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle, uint dwProcessId);
[DllImport("kernel32.dll")]
public static extern bool ProcessIdToSessionId(uint dwProcessId, ref uint pSessionId);
[DllImport("kernel32.dll")]
public static extern uint WTSGetActiveConsoleSessionId();
[DllImport("kernel32.dll")]
public static extern uint GetLastError();
/// <summary>
/// contains information about the current state of both physical and virtual memory, including extended memory
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public class MEMORYSTATUSEX
{
/// <summary>
/// Size of the structure, in bytes. You must set this member before calling GlobalMemoryStatusEx.
/// </summary>
public uint dwLength;
/// <summary>
/// Number between 0 and 100 that specifies the approximate percentage of physical memory that is in use (0 indicates no memory use and 100 indicates full memory use).
/// </summary>
public uint dwMemoryLoad;
/// <summary>
/// Total size of physical memory, in bytes.
/// </summary>
public ulong ullTotalPhys;
/// <summary>
/// Size of physical memory available, in bytes.
/// </summary>
public ulong ullAvailPhys;
/// <summary>
/// Size of the committed memory limit, in bytes. This is physical memory plus the size of the page file, minus a small overhead.
/// </summary>
public ulong ullTotalPageFile;
/// <summary>
/// Size of available memory to commit, in bytes. The limit is ullTotalPageFile.
/// </summary>
public ulong ullAvailPageFile;
/// <summary>
/// Total size of the user mode portion of the virtual address space of the calling process, in bytes.
/// </summary>
public ulong ullTotalVirtual;
/// <summary>
/// Size of unreserved and uncommitted memory in the user mode portion of the virtual address space of the calling process, in bytes.
/// </summary>
public ulong ullAvailVirtual;
/// <summary>
/// Size of unreserved and uncommitted memory in the extended portion of the virtual address space of the calling process, in bytes.
/// </summary>
public ulong ullAvailExtendedVirtual;
/// <summary>
/// Initializes a new instance of the <see cref="T:MEMORYSTATUSEX"/> class.
/// </summary>
public MEMORYSTATUSEX()
{
dwLength = (uint)Marshal.SizeOf(typeof(MEMORYSTATUSEX));
}
}
}
}

View File

@@ -0,0 +1,25 @@
using System.Runtime.InteropServices;
namespace cmonitor.server.client.reports.screen.winapis
{
public static class NetApi32
{
[DllImport("Netapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern uint NetUserChangePassword(
[MarshalAs(UnmanagedType.LPWStr)] string domainname,
[MarshalAs(UnmanagedType.LPWStr)] string username,
[MarshalAs(UnmanagedType.LPWStr)] string oldpassword,
[MarshalAs(UnmanagedType.LPWStr)] string newpassword
);
public static bool ChangePassword(
[MarshalAs(UnmanagedType.LPWStr)] string domainname,
[MarshalAs(UnmanagedType.LPWStr)] string username,
[MarshalAs(UnmanagedType.LPWStr)] string oldpassword,
[MarshalAs(UnmanagedType.LPWStr)] string newpassword
)
{
return NetUserChangePassword(domainname, username, oldpassword, newpassword) == 0;
}
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace cmonitor.server.client.reports.screen.winapis
{
internal class Powrprof
{
[DllImport("powrprof.dll")]
public static extern uint GetActivePwrScheme(out IntPtr pActivePolicy);
[DllImport("powrprof.dll", SetLastError = true)]
public static extern UInt32 PowerGetActiveScheme(IntPtr UserRootPowerKey, out IntPtr ActivePolicyGuid);
[DllImport("powrprof.dll")]
public static extern uint PowerWriteACValueIndex(IntPtr RootPowerKey, ref Guid SchemeGuid, ref Guid SubGroupOfPowerSettingsGuid,
ref Guid PowerSettingGuid, uint AcValueIndex);
public static Guid powerButtonGuid = new Guid("4f971e89-eebd-4455-a8de-9e59040e7347"); // 电源按钮设置的GUID
public static Guid sleepButtonGuid = new Guid("96996bc0-ad50-47ec-923b-6f418386bca1"); // 睡眠按钮设置的GUID
}
}

View File

@@ -0,0 +1,379 @@
using Microsoft.Win32.SafeHandles;
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
namespace cmonitor.server.client.reports.screen.winapis
{
public static class SECUR32
{
public enum WinStatusCodes : uint
{
STATUS_SUCCESS = 0
}
public enum WinErrors : uint
{
NO_ERROR = 0,
}
public enum WinLogonType
{
LOGON32_LOGON_INTERACTIVE = 2,
LOGON32_LOGON_NETWORK = 3,
LOGON32_LOGON_BATCH = 4,
LOGON32_LOGON_SERVICE = 5,
LOGON32_LOGON_UNLOCK = 7,
LOGON32_LOGON_NETWORK_CLEARTEXT = 8,
LOGON32_LOGON_NEW_CREDENTIALS = 9
}
// SECURITY_LOGON_TYPE
public enum SecurityLogonType
{
Interactive = 2, // Interactively logged on (locally or remotely)
Network, // Accessing system via network
Batch, // Started via a batch queue
Service, // Service started by service controller
Proxy, // Proxy logon
Unlock, // Unlock workstation
NetworkCleartext, // Network logon with cleartext credentials
NewCredentials, // Clone caller, new default credentials
RemoteInteractive, // Remote, yet interactive. Terminal server
CachedInteractive, // Try cached credentials without hitting the net.
CachedRemoteInteractive, // Same as RemoteInteractive, this is used internally for auditing purpose
CachedUnlock // Cached Unlock workstation
}
[StructLayout(LayoutKind.Sequential)]
public struct LSA_UNICODE_STRING
{
public UInt16 Length;
public UInt16 MaximumLength;
public IntPtr Buffer;
}
[StructLayout(LayoutKind.Sequential)]
public struct TOKEN_SOURCE
{
public TOKEN_SOURCE(string name)
{
SourceName = new byte[8];
System.Text.Encoding.GetEncoding(1252).GetBytes(name, 0, name.Length, SourceName, 0);
if (!ADVAPI32.AllocateLocallyUniqueId(out SourceIdentifier))
throw new System.ComponentModel.Win32Exception();
}
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] SourceName;
public IntPtr SourceIdentifier;
}
[StructLayout(LayoutKind.Sequential)]
public struct KERB_INTERACTIVE_LOGON
{
public KERB_LOGON_SUBMIT_TYPE MessageType;
public string LogonDomainName;
public string UserName;
public string Password;
}
public enum KERB_LOGON_SUBMIT_TYPE
{
KerbInteractiveLogon = 2,
KerbSmartCardLogon = 6,
KerbWorkstationUnlockLogon = 7,
KerbSmartCardUnlockLogon = 8,
KerbProxyLogon = 9,
KerbTicketLogon = 10,
KerbTicketUnlockLogon = 11,
KerbS4ULogon = 12,
KerbCertificateLogon = 13,
KerbCertificateS4ULogon = 14,
KerbCertificateUnlockLogon = 15
}
public enum TOKEN_INFORMATION_CLASS
{
/// <summary>
    /// The buffer receives a TOKEN_USER structure that contains the user account of the token.
    /// </summary>
TokenUser = 1,
/// <summary>
    /// The buffer receives a TOKEN_GROUPS structure that contains the group accounts associated with the token.
    /// </summary>
TokenGroups,
/// <summary>
    /// The buffer receives a TOKEN_PRIVILEGES structure that contains the privileges of the token.
    /// </summary>
TokenPrivileges,
/// <summary>
    /// The buffer receives a TOKEN_OWNER structure that contains the default owner security identifier (SID) for newly created objects.
    /// </summary>
TokenOwner,
/// <summary>
    /// The buffer receives a TOKEN_PRIMARY_GROUP structure that contains the default primary group SID for newly created objects.
    /// </summary>
TokenPrimaryGroup,
/// <summary>
    /// The buffer receives a TOKEN_DEFAULT_DACL structure that contains the default DACL for newly created objects.
    /// </summary>
TokenDefaultDacl,
/// <summary>
    /// The buffer receives a TOKEN_SOURCE structure that contains the source of the token. TOKEN_QUERY_SOURCE access is needed to retrieve this information.
    /// </summary>
TokenSource,
/// <summary>
    /// The buffer receives a TOKEN_TYPE value that indicates whether the token is a primary or impersonation token.
    /// </summary>
TokenType,
/// <summary>
    /// The buffer receives a SECURITY_IMPERSONATION_LEVEL value that indicates the impersonation level of the token. If the access token is not an impersonation token, the function fails.
    /// </summary>
TokenImpersonationLevel,
/// <summary>
    /// The buffer receives a TOKEN_STATISTICS structure that contains various token statistics.
    /// </summary>
TokenStatistics,
/// <summary>
    /// The buffer receives a TOKEN_GROUPS structure that contains the list of restricting SIDs in a restricted token.
    /// </summary>
TokenRestrictedSids,
/// <summary>
    /// The buffer receives a DWORD value that indicates the Terminal Services session identifier that is associated with the token.
    /// </summary>
TokenSessionId,
/// <summary>
    /// The buffer receives a TOKEN_GROUPS_AND_PRIVILEGES structure that contains the user SID, the group accounts, the restricted SIDs, and the authentication ID associated with the token.
    /// </summary>
TokenGroupsAndPrivileges,
/// <summary>
    /// Reserved.
    /// </summary>
TokenSessionReference,
/// <summary>
    /// The buffer receives a DWORD value that is nonzero if the token includes the SANDBOX_INERT flag.
    /// </summary>
TokenSandBoxInert,
/// <summary>
    /// Reserved.
    /// </summary>
TokenAuditPolicy,
/// <summary>
    /// The buffer receives a TOKEN_ORIGIN value.
    /// </summary>
TokenOrigin,
/// <summary>
    /// The buffer receives a TOKEN_ELEVATION_TYPE value that specifies the elevation level of the token.
    /// </summary>
TokenElevationType,
/// <summary>
    /// The buffer receives a TOKEN_LINKED_TOKEN structure that contains a handle to another token that is linked to this token.
    /// </summary>
TokenLinkedToken,
/// <summary>
    /// The buffer receives a TOKEN_ELEVATION structure that specifies whether the token is elevated.
    /// </summary>
TokenElevation,
/// <summary>
    /// The buffer receives a DWORD value that is nonzero if the token has ever been filtered.
    /// </summary>
TokenHasRestrictions,
/// <summary>
    /// The buffer receives a TOKEN_ACCESS_INFORMATION structure that specifies security information contained in the token.
    /// </summary>
TokenAccessInformation,
/// <summary>
    /// The buffer receives a DWORD value that is nonzero if virtualization is allowed for the token.
    /// </summary>
TokenVirtualizationAllowed,
/// <summary>
    /// The buffer receives a DWORD value that is nonzero if virtualization is enabled for the token.
    /// </summary>
TokenVirtualizationEnabled,
/// <summary>
    /// The buffer receives a TOKEN_MANDATORY_LABEL structure that specifies the token's integrity level.
    /// </summary>
TokenIntegrityLevel,
/// <summary>
    /// The buffer receives a DWORD value that is nonzero if the token has the UIAccess flag set.
    /// </summary>
TokenUIAccess,
/// <summary>
    /// The buffer receives a TOKEN_MANDATORY_POLICY structure that specifies the token's mandatory integrity policy.
    /// </summary>
TokenMandatoryPolicy,
/// <summary>
    /// The buffer receives the token's logon security identifier (SID).
    /// </summary>
TokenLogonSid,
/// <summary>
    /// The maximum value for this enumeration
    /// </summary>
MaxTokenInfoClass
}
[StructLayout(LayoutKind.Sequential)]
public struct QUOTA_LIMITS
{
readonly UInt32 PagedPoolLimit;
readonly UInt32 NonPagedPoolLimit;
readonly UInt32 MinimumWorkingSetSize;
readonly UInt32 MaximumWorkingSetSize;
readonly UInt32 PagefileLimit;
readonly Int64 TimeLimit;
}
[StructLayout(LayoutKind.Sequential)]
public struct LSA_STRING
{
public UInt16 Length;
public UInt16 MaximumLength;
public /*PCHAR*/ IntPtr Buffer;
}
[DllImport("secur32.dll", SetLastError = true)]
public static extern WinStatusCodes LsaLogonUser(
[In] IntPtr LsaHandle,
[In] ref LSA_STRING OriginName,
[In] SecurityLogonType LogonType,
[In] UInt32 AuthenticationPackage,
[In] IntPtr AuthenticationInformation,
[In] UInt32 AuthenticationInformationLength,
[In] /*PTOKEN_GROUPS*/ IntPtr LocalGroups,
[In] ref TOKEN_SOURCE SourceContext,
[Out] /*PVOID*/ out IntPtr ProfileBuffer,
[Out] out UInt32 ProfileBufferLength,
[Out] out Int64 LogonId,
[Out] out IntPtr Token,
[Out] out QUOTA_LIMITS Quotas,
[Out] out WinStatusCodes SubStatus
);
[DllImport("secur32.dll", SetLastError = true)]
public static extern WinStatusCodes LsaRegisterLogonProcess(
IntPtr LogonProcessName,
out IntPtr LsaHandle,
out ulong SecurityMode
);
[DllImport("secur32.dll", SetLastError = false)]
public static extern WinStatusCodes LsaLookupAuthenticationPackage([In] IntPtr LsaHandle, [In] ref LSA_STRING PackageName, [Out] out UInt32 AuthenticationPackage);
[DllImport("secur32.dll", CharSet = CharSet.Auto, SetLastError = true)]
[ResourceExposure(ResourceScope.None)]
internal static extern int LsaConnectUntrusted(
[In, Out] ref SafeLsaLogonProcessHandle LsaHandle);
[DllImport("secur32.dll", SetLastError = false)]
public static extern WinStatusCodes LsaConnectUntrusted([Out] out IntPtr LsaHandle);
[System.Security.SecurityCritical] // auto-generated
internal sealed class SafeLsaLogonProcessHandle : SafeHandleZeroOrMinusOneIsInvalid
{
private SafeLsaLogonProcessHandle() : base(true) { }
// 0 is an Invalid Handle
internal SafeLsaLogonProcessHandle(IntPtr handle) : base(true)
{
SetHandle(handle);
}
internal static SafeLsaLogonProcessHandle InvalidHandle
{
get { return new SafeLsaLogonProcessHandle(IntPtr.Zero); }
}
[System.Security.SecurityCritical]
protected override bool ReleaseHandle()
{
// LsaDeregisterLogonProcess returns an NTSTATUS
return LsaDeregisterLogonProcess(handle) >= 0;
}
}
[DllImport("secur32.dll", SetLastError = true)]
[ResourceExposure(ResourceScope.None)]
internal static extern int LsaDeregisterLogonProcess(IntPtr handle);
public static void CreateNewSession()
{
var kli = new SECUR32.KERB_INTERACTIVE_LOGON()
{
MessageType = SECUR32.KERB_LOGON_SUBMIT_TYPE.KerbInteractiveLogon,
UserName = "",
Password = ""
};
IntPtr kerbLogInfo;
SECUR32.LSA_STRING logonProc = new SECUR32.LSA_STRING
{
Buffer = Marshal.StringToHGlobalAuto("InstaLogon"),
Length = (ushort)Marshal.SizeOf(Marshal.StringToHGlobalAuto("InstaLogon")),
MaximumLength = (ushort)Marshal.SizeOf(Marshal.StringToHGlobalAuto("InstaLogon"))
};
SECUR32.LSA_STRING originName = new SECUR32.LSA_STRING
{
Buffer = Marshal.StringToHGlobalAuto("InstaLogon"),
Length = (ushort)Marshal.SizeOf(Marshal.StringToHGlobalAuto("InstaLogon")),
MaximumLength = (ushort)Marshal.SizeOf(Marshal.StringToHGlobalAuto("InstaLogon"))
};
SECUR32.LSA_STRING authPackage = new SECUR32.LSA_STRING
{
Buffer = Marshal.StringToHGlobalAuto("MICROSOFT_KERBEROS_NAME_A"),
Length = (ushort)Marshal.SizeOf(Marshal.StringToHGlobalAuto("MICROSOFT_KERBEROS_NAME_A")),
MaximumLength = (ushort)Marshal.SizeOf(Marshal.StringToHGlobalAuto("MICROSOFT_KERBEROS_NAME_A"))
};
IntPtr hLogonProc = Marshal.AllocHGlobal(Marshal.SizeOf(logonProc));
Marshal.StructureToPtr(logonProc, hLogonProc, false);
ADVAPI32.AllocateLocallyUniqueId(out IntPtr pluid);
LsaConnectUntrusted(out IntPtr lsaHan);
//SECUR32.LsaRegisterLogonProcess(hLogonProc, out lsaHan, out secMode);
SECUR32.LsaLookupAuthenticationPackage(lsaHan, ref authPackage, out uint authPackID);
kerbLogInfo = Marshal.AllocHGlobal(Marshal.SizeOf(kli));
Marshal.StructureToPtr(kli, kerbLogInfo, false);
var ts = new SECUR32.TOKEN_SOURCE("Insta");
SECUR32.LsaLogonUser(
lsaHan,
ref originName,
SECUR32.SecurityLogonType.Interactive,
authPackID,
kerbLogInfo,
(uint)Marshal.SizeOf(kerbLogInfo),
IntPtr.Zero,
ref ts,
out IntPtr profBuf,
out uint profBufLen,
out long logonID,
out IntPtr logonToken,
out QUOTA_LIMITS quotas,
out WinStatusCodes subStatus);
}
}
}

View File

@@ -0,0 +1,52 @@
using System.Runtime.InteropServices;
namespace cmonitor.server.client.reports.screen.winapis
{
// https://docs.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-isos
public class Shlwapi
{
[DllImport("shlwapi.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool IsOS(OsType osType);
}
public enum OsType
{
OS_WINDOWS = 0,
OS_NT = 1,
OS_WIN95ORGREATER = 2,
OS_NT4ORGREATER = 3,
OS_WIN98ORGREATER = 5,
OS_WIN98_GOLD = 6,
OS_WIN2000ORGREATER = 7,
OS_WIN2000PRO = 8,
OS_WIN2000SERVER = 9,
OS_WIN2000ADVSERVER = 10,
OS_WIN2000DATACENTER = 11,
OS_WIN2000TERMINAL = 12,
OS_EMBEDDED = 13,
OS_TERMINALCLIENT = 14,
OS_TERMINALREMOTEADMIN = 15,
OS_WIN95_GOLD = 16,
OS_MEORGREATER = 17,
OS_XPORGREATER = 18,
OS_HOME = 19,
OS_PROFESSIONAL = 20,
OS_DATACENTER = 21,
OS_ADVSERVER = 22,
OS_SERVER = 23,
OS_TERMINALSERVER = 24,
OS_PERSONALTERMINALSERVER = 25,
OS_FASTUSERSWITCHING = 26,
OS_WELCOMELOGONUI = 27,
OS_DOMAINMEMBER = 28,
OS_ANYSERVER = 29,
OS_WOW6432 = 30,
OS_WEBSERVER = 31,
OS_SMALLBUSINESSSERVER = 32,
OS_TABLETPC = 33,
OS_SERVERADMINUI = 34,
OS_MEDIACENTER = 35,
OS_APPLIANCE = 36,
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,84 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
namespace cmonitor.server.client.reports.screen.winapis
{
public static class WTSAPI32
{
public static IntPtr WTS_CURRENT_SERVER_HANDLE = IntPtr.Zero;
public enum WTS_CONNECTSTATE_CLASS
{
WTSActive,
WTSConnected,
WTSConnectQuery,
WTSShadow,
WTSDisconnected,
WTSIdle,
WTSListen,
WTSReset,
WTSDown,
WTSInit
}
public enum WTS_INFO_CLASS
{
WTSInitialProgram,
WTSApplicationName,
WTSWorkingDirectory,
WTSOEMId,
WTSSessionId,
WTSUserName,
WTSWinStationName,
WTSDomainName,
WTSConnectState,
WTSClientBuildNumber,
WTSClientName,
WTSClientDirectory,
WTSClientProductId,
WTSClientHardwareId,
WTSClientAddress,
WTSClientDisplay,
WTSClientProtocolType,
WTSIdleTime,
WTSLogonTime,
WTSIncomingBytes,
WTSOutgoingBytes,
WTSIncomingFrames,
WTSOutgoingFrames,
WTSClientInfo,
WTSSessionInfo
}
[DllImport("wtsapi32.dll", SetLastError = true)]
public static extern int WTSEnumerateSessions(
IntPtr hServer,
int Reserved,
int Version,
ref IntPtr ppSessionInfo,
ref int pCount);
[DllImport("wtsapi32.dll", ExactSpelling = true, SetLastError = false)]
public static extern void WTSFreeMemory(IntPtr memory);
[DllImport("Wtsapi32.dll")]
public static extern bool WTSQuerySessionInformation(IntPtr hServer, uint sessionId, WTS_INFO_CLASS wtsInfoClass, out IntPtr ppBuffer, out uint pBytesReturned);
[DllImport("wtsapi32.dll", SetLastError = true)]
static extern IntPtr WTSOpenServer(string pServerName);
[StructLayout(LayoutKind.Sequential)]
public struct WTS_SESSION_INFO
{
public uint SessionID;
[MarshalAs(UnmanagedType.LPStr)]
public string pWinStationName;
public WTS_CONNECTSTATE_CLASS State;
}
[DllImport("Wtsapi32.dll")]
public static extern bool WTSQueryUserToken(int sessionId, out IntPtr token);
}
}

View File

@@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cmonitor.sas.service", "cmo
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cmonitor.install.win", "cmonitor.install.win\cmonitor.install.win.csproj", "{2193D588-05D2-4FE3-BBE7-CC44D2C5D4CC}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cmonitor.install.win", "cmonitor.install.win\cmonitor.install.win.csproj", "{2193D588-05D2-4FE3-BBE7-CC44D2C5D4CC}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cmonitor.share.receiver.win", "cmonitor.share.receiver.win\cmonitor.share.receiver.win.csproj", "{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@@ -216,6 +218,24 @@ Global
{2193D588-05D2-4FE3-BBE7-CC44D2C5D4CC}.ReleaseLinux|x64.Build.0 = Release|Any CPU {2193D588-05D2-4FE3-BBE7-CC44D2C5D4CC}.ReleaseLinux|x64.Build.0 = Release|Any CPU
{2193D588-05D2-4FE3-BBE7-CC44D2C5D4CC}.ReleaseLinux|x86.ActiveCfg = Release|Any CPU {2193D588-05D2-4FE3-BBE7-CC44D2C5D4CC}.ReleaseLinux|x86.ActiveCfg = Release|Any CPU
{2193D588-05D2-4FE3-BBE7-CC44D2C5D4CC}.ReleaseLinux|x86.Build.0 = Release|Any CPU {2193D588-05D2-4FE3-BBE7-CC44D2C5D4CC}.ReleaseLinux|x86.Build.0 = Release|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.Debug|x64.ActiveCfg = Debug|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.Debug|x64.Build.0 = Debug|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.Debug|x86.ActiveCfg = Debug|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.Debug|x86.Build.0 = Debug|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.Release|Any CPU.Build.0 = Release|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.Release|x64.ActiveCfg = Release|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.Release|x64.Build.0 = Release|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.Release|x86.ActiveCfg = Release|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.Release|x86.Build.0 = Release|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.ReleaseLinux|Any CPU.ActiveCfg = Release|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.ReleaseLinux|Any CPU.Build.0 = Release|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.ReleaseLinux|x64.ActiveCfg = Release|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.ReleaseLinux|x64.Build.0 = Release|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.ReleaseLinux|x86.ActiveCfg = Release|Any CPU
{59FCFFA4-AAB7-423A-AE01-DCDE47B2C9C1}.ReleaseLinux|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-col :span="6" class="time"> <el-col :span="6" class="time">
<span>fps : {{data.Report.fps}} {{data.Report.ping}}ms</span> <span>fps:{{data.Report.fps}}{{data.Report.ping}}ms</span>
</el-col> </el-col>
</template> </template>

View File

@@ -1,6 +1,6 @@
namespace cmonitor.win namespace cmonitor.win
{ {
partial class Form1 partial class MainForm
{ {
/// <summary> /// <summary>
/// 必需的设计器变量。 /// 必需的设计器变量。
@@ -30,13 +30,13 @@
{ {
this.SuspendLayout(); this.SuspendLayout();
// //
// Form1 // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(0, 0); this.ClientSize = new System.Drawing.Size(0, 0);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Form1"; this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OnClose); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OnClose);
this.Load += new System.EventHandler(this.OnLoad); this.Load += new System.EventHandler(this.OnLoad);

View File

@@ -5,7 +5,7 @@ using System.Windows.Forms;
namespace cmonitor.win namespace cmonitor.win
{ {
public partial class Form1 : Form public partial class MainForm : Form
{ {
private Process proc; private Process proc;
private string[] args; private string[] args;
@@ -21,7 +21,7 @@ namespace cmonitor.win
return cp; return cp;
} }
} }
public Form1(string[] args) public MainForm(string[] args)
{ {
this.args = args; this.args = args;
InitializeComponent(); InitializeComponent();

View File

@@ -23,7 +23,7 @@ namespace cmonitor.win
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(args)); Application.Run(new MainForm(args));
} }
} }
} }

View File

@@ -65,16 +65,16 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Form1.cs"> <Compile Include="MainForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Form1.Designer.cs"> <Compile Include="MainForm.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx"> <EmbeddedResource Include="MainForm.resx">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>

View File

@@ -44,6 +44,13 @@ namespace cmonitor
{ {
static async Task Main(string[] args) static async Task Main(string[] args)
{ {
//单服务
Mutex mutex = new Mutex(true, System.Diagnostics.Process.GetCurrentProcess().ProcessName, out bool isAppRunning);
if (isAppRunning == false)
{
Environment.Exit(1);
}
//日志输出 //日志输出
LoggerConsole(); LoggerConsole();
@@ -60,12 +67,7 @@ namespace cmonitor
Config config = new Config(); Config config = new Config();
InitConfig(config, dic); InitConfig(config, dic);
//单服务
Mutex mutex = new Mutex(true, System.Diagnostics.Process.GetCurrentProcess().ProcessName, out bool isAppRunning);
if (isAppRunning == false)
{
Environment.Exit(1);
}
//全局异常 //全局异常
AppDomain.CurrentDomain.UnhandledException += (a, b) => AppDomain.CurrentDomain.UnhandledException += (a, b) =>
{ {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=0"><link rel="icon" href="/favicon.ico"><title>cmonitor.web</title><script defer="defer" src="/js/chunk-vendors.93db0d1d.js"></script><script defer="defer" src="/js/app.457c686d.js"></script><link href="/css/chunk-vendors.faad7142.css" rel="stylesheet"><link href="/css/app.9c6b579f.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but cmonitor.web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html> <!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=0"><link rel="icon" href="/favicon.ico"><title>cmonitor.web</title><script defer="defer" src="/js/chunk-vendors.93db0d1d.js"></script><script defer="defer" src="/js/app.d66ed62e.js"></script><link href="/css/chunk-vendors.faad7142.css" rel="stylesheet"><link href="/css/app.9c6b579f.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but cmonitor.web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -34,7 +34,7 @@ namespace cmonitor.server.api.services
_ = messengerSender.SendOnly(new MessageRequestWrap _ = messengerSender.SendOnly(new MessageRequestWrap
{ {
Connection = cache.Connection, Connection = cache.Connection,
MessengerId = (ushort)ScreenMessengerIds.Full, MessengerId = (ushort)ScreenMessengerIds.CaptureFull,
Timeout = 1000, Timeout = 1000,
Payload= bytes Payload= bytes
}).ContinueWith((result) => }).ContinueWith((result) =>
@@ -54,7 +54,7 @@ namespace cmonitor.server.api.services
_ = messengerSender.SendOnly(new MessageRequestWrap _ = messengerSender.SendOnly(new MessageRequestWrap
{ {
Connection = cache.Connection, Connection = cache.Connection,
MessengerId = (ushort)ScreenMessengerIds.Clip, MessengerId = (ushort)ScreenMessengerIds.CaptureClip,
Timeout = 1000, Timeout = 1000,
Payload = MemoryPackSerializer.Serialize(screenClipParamInfo.Clip) Payload = MemoryPackSerializer.Serialize(screenClipParamInfo.Clip)
}); });
@@ -77,7 +77,7 @@ namespace cmonitor.server.api.services
_ = messengerSender.SendOnly(new MessageRequestWrap _ = messengerSender.SendOnly(new MessageRequestWrap
{ {
Connection = cache.Connection, Connection = cache.Connection,
MessengerId = (ushort)ScreenMessengerIds.Region, MessengerId = (ushort)ScreenMessengerIds.CaptureRegion,
Timeout = 1000, Timeout = 1000,
}).ContinueWith((result) => }).ContinueWith((result) =>
{ {

View File

@@ -101,8 +101,8 @@ namespace cmonitor.server.client
} }
} }
private ScreenShareState _screenShareState; private ScreenShareStates _screenShareState;
public ScreenShareState ScreenShareState public ScreenShareStates ScreenShareState
{ {
get => _screenShareState; set get => _screenShareState; set
{ {
@@ -111,6 +111,17 @@ namespace cmonitor.server.client
} }
} }
private string _userSid = string.Empty;
public string UserSid
{
get => _userSid; set
{
_userSid = value;
updated = true;
}
}
public void Save() public void Save()
{ {
configDataProvider.Save(this).Wait(); configDataProvider.Save(this).Wait();

View File

@@ -58,7 +58,7 @@ namespace cmonitor.server.client.reports.llock
if (open) if (open)
{ {
CommandHelper.Windows(string.Empty, new string[] { CommandHelper.Windows(string.Empty, new string[] {
$"start llock.win.exe {config.ShareMemoryKey} {config.ShareMemoryLength * Config.ShareMemoryItemLength} {Config.ShareMemoryLLockIndex}" $"start llock.win.exe {config.ShareMemoryKey} {config.ShareMemoryLength} {Config.ShareMemoryLLockIndex}"
}); });
} }
}); });

View File

@@ -4,6 +4,7 @@ using cmonitor.server.service.messengers.screen;
using MemoryPack; using MemoryPack;
using cmonitor.server.client.reports.screen.helpers; using cmonitor.server.client.reports.screen.helpers;
using cmonitor.server.client.reports.screen.winapiss; using cmonitor.server.client.reports.screen.winapiss;
using System.IO.MemoryMappedFiles;
namespace cmonitor.server.client.reports.screen namespace cmonitor.server.client.reports.screen
{ {
@@ -31,19 +32,11 @@ namespace cmonitor.server.client.reports.screen
this.clientConfig = clientConfig; this.clientConfig = clientConfig;
if (config.IsCLient) if (config.IsCLient)
{ {
ScreenCaptureTask();
dxgiDesktop = new DxgiDesktop(0, config); dxgiDesktop = new DxgiDesktop(0, config);
gdiDesktop = new GdiDesktop(config); gdiDesktop = new GdiDesktop(config);
InitSise(); CaptureTask();
} DisplaysInit();
} ScreenShareInit();
private void InitSise()
{
displays = DisplaysEnumerationHelper.GetDisplays();
if (DisplayHelper.GetSystemScale(out _, out _, out int w, out int h))
{
report.W = w;
report.H = h;
} }
} }
@@ -66,7 +59,18 @@ namespace cmonitor.server.client.reports.screen
} }
return null; return null;
} }
public void MonitorState(bool onState)
private void DisplaysInit()
{
displays = DisplaysEnumerationHelper.GetDisplays();
if (DisplayHelper.GetSystemScale(out _, out _, out int w, out int h))
{
report.W = w;
report.H = h;
}
}
public void DisplayState(bool onState)
{ {
if (onState) if (onState)
{ {
@@ -80,33 +84,55 @@ namespace cmonitor.server.client.reports.screen
} }
public void ShareState(ScreenShareState screenShareState) MemoryMappedFile mmf;
MemoryMappedViewAccessor accessor;
byte[] shareScreenBytes = new byte[1 * 1024 * 1024];
private void ScreenShareInit()
{
if (OperatingSystem.IsWindows())
{
mmf = MemoryMappedFile.CreateOrOpen($"{config.ShareMemoryKey}/screen", shareScreenBytes.Length);
accessor = mmf.CreateViewAccessor();
}
}
public void ScreenShareState(ScreenShareStates screenShareState)
{ {
clientConfig.ScreenShareState = screenShareState; clientConfig.ScreenShareState = screenShareState;
} }
public void ScreenShare(Memory<byte> data)
{
if (data.Length > 0 && data.Length <= shareScreenBytes.Length && accessor != null)
{
data.CopyTo(shareScreenBytes);
accessor.WriteArray(0, shareScreenBytes, 0, data.Length);
}
}
private ScreenReportType screenReportType = ScreenReportType.Full; private ScreenReportType screenReportType = ScreenReportType.Full;
private ScreenReportFullType screenReportFullType = ScreenReportFullType.Full | ScreenReportFullType.Trim; private ScreenReportFullType screenReportFullType = ScreenReportFullType.Full | ScreenReportFullType.Trim;
private long ticks = 0; private long ticks = 0;
public void Full(ScreenReportFullType screenReportFullType) public void CaptureFull(ScreenReportFullType screenReportFullType)
{ {
ticks = DateTime.UtcNow.Ticks; ticks = DateTime.UtcNow.Ticks;
screenReportType = ScreenReportType.Full; screenReportType = ScreenReportType.Full;
this.screenReportFullType |= screenReportFullType; this.screenReportFullType |= screenReportFullType;
} }
public void Clip(ScreenClipInfo screenClipInfo) public void CaptureClip(ScreenClipInfo screenClipInfo)
{ {
ticks = DateTime.UtcNow.Ticks; ticks = DateTime.UtcNow.Ticks;
screenReportType = ScreenReportType.Full; screenReportType = ScreenReportType.Full;
gdiDesktop.Clip(screenClipInfo); gdiDesktop.Clip(screenClipInfo);
} }
public void Region() public void CaptureRegion()
{ {
ticks = DateTime.UtcNow.Ticks; ticks = DateTime.UtcNow.Ticks;
screenReportType = ScreenReportType.Region; screenReportType = ScreenReportType.Region;
} }
private void ScreenCaptureTask()
private Memory<byte> fullImageMemory = Helper.EmptyArray;
private void CaptureTask()
{ {
if (OperatingSystem.IsWindows() == false) if (OperatingSystem.IsWindows() == false)
{ {
@@ -118,14 +144,14 @@ namespace cmonitor.server.client.reports.screen
{ {
int delayms = 0; int delayms = 0;
bool connected = clientSignInState.Connected == true; bool connected = clientSignInState.Connected == true;
bool shareState = (clientConfig.ScreenShareState & ScreenShareState.Sender) == ScreenShareState.Sender; bool shareState = (clientConfig.ScreenShareState & ScreenShareStates.Sender) == ScreenShareStates.Sender;
bool time = (DateTime.UtcNow.Ticks - ticks) / TimeSpan.TicksPerMillisecond < 1000; bool time = (DateTime.UtcNow.Ticks - ticks) / TimeSpan.TicksPerMillisecond < 1000;
if (connected && (shareState || time)) if (connected && (shareState || time))
{ {
try try
{ {
long start = DateTime.UtcNow.Ticks; long start = DateTime.UtcNow.Ticks;
await ScreenCapture(); await CaptureFrame();
delayms = (int)((DateTime.UtcNow.Ticks - start) / TimeSpan.TicksPerMillisecond); delayms = (int)((DateTime.UtcNow.Ticks - start) / TimeSpan.TicksPerMillisecond);
} }
catch (Exception ex) catch (Exception ex)
@@ -145,13 +171,12 @@ namespace cmonitor.server.client.reports.screen
} }
}, TaskCreationOptions.LongRunning); }, TaskCreationOptions.LongRunning);
} }
private Memory<byte> fullImageMemory = Helper.EmptyArray; private async Task CaptureFrame()
private async Task ScreenCapture()
{ {
DesktopFrame frame = GetFrame(); DesktopFrame frame = CaptureGetFrame();
await SendFrame(frame); await CaptureSendFrame(frame);
} }
private DesktopFrame GetFrame() private DesktopFrame CaptureGetFrame()
{ {
DesktopFrame frame = null; DesktopFrame frame = null;
@@ -188,7 +213,7 @@ namespace cmonitor.server.client.reports.screen
return frame; return frame;
} }
private async Task SendFrame(DesktopFrame frame) private async Task CaptureSendFrame(DesktopFrame frame)
{ {
if (frame == null) if (frame == null)
{ {
@@ -200,7 +225,7 @@ namespace cmonitor.server.client.reports.screen
await messengerSender.SendOnly(new MessageRequestWrap await messengerSender.SendOnly(new MessageRequestWrap
{ {
Connection = clientSignInState.Connection, Connection = clientSignInState.Connection,
MessengerId = (ushort)ScreenMessengerIds.FullReport, MessengerId = (ushort)ScreenMessengerIds.CaptureFullReport,
Payload = frame.FullImage, Payload = frame.FullImage,
}); });
} }
@@ -209,7 +234,7 @@ namespace cmonitor.server.client.reports.screen
await messengerSender.SendOnly(new MessageRequestWrap await messengerSender.SendOnly(new MessageRequestWrap
{ {
Connection = clientSignInState.Connection, Connection = clientSignInState.Connection,
MessengerId = (ushort)ScreenMessengerIds.RegionReport, MessengerId = (ushort)ScreenMessengerIds.CaptureRegionReport,
Payload = frame.RegionImage, Payload = frame.RegionImage,
}); });
} }
@@ -218,7 +243,7 @@ namespace cmonitor.server.client.reports.screen
await messengerSender.SendOnly(new MessageRequestWrap await messengerSender.SendOnly(new MessageRequestWrap
{ {
Connection = clientSignInState.Connection, Connection = clientSignInState.Connection,
MessengerId = (ushort)ScreenMessengerIds.Rectangles, MessengerId = (ushort)ScreenMessengerIds.CaptureRectangles,
Payload = MemoryPackSerializer.Serialize(frame.UpdatedRegions), Payload = MemoryPackSerializer.Serialize(frame.UpdatedRegions),
}); });
} }
@@ -273,7 +298,7 @@ namespace cmonitor.server.client.reports.screen
public int H { get; set; } public int H { get; set; }
} }
public enum ScreenShareState : byte public enum ScreenShareStates : byte
{ {
None = 0, None = 0,
Sender = 1, Sender = 1,

View File

@@ -1,6 +1,7 @@
using cmonitor.server.client.reports.screen.winapis; using cmonitor.server.client.reports.screen.winapis;
using cmonitor.server.client.reports.screen.winapiss; using cmonitor.server.client.reports.screen.winapiss;
using common.libs; using common.libs;
using Microsoft.Win32;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
@@ -322,6 +323,71 @@ namespace cmonitor.server.client.reports.screen
} }
return string.Empty; return string.Empty;
} }
public static string GetDefaultUserSid()
{
if (OperatingSystem.IsWindows() == false)
{
return string.Empty;
}
List<string> registrySids = Registry.Users.GetSubKeyNames().ToList();
List<string> sids = new List<string>();
int resumeHandle = 0;
int result = NetApi32.NetUserEnum(null, 0, 2, out IntPtr bufPtr, -1, out int entriesRead, out int totalEntries, ref resumeHandle);
if (result == 0)
{
try
{
for (int i = 0; i < entriesRead; i++)
{
USER_INFO_0 userInfo = (USER_INFO_0)Marshal.PtrToStructure(bufPtr + (Marshal.SizeOf(typeof(USER_INFO_0)) * i), typeof(USER_INFO_0));
int cbSid = 0;
int cchReferencedDomainName = 0;
int peUse;
StringBuilder referencedDomainName = new StringBuilder();
IntPtr pSid = IntPtr.Zero;
bool bSuccess = LookupAccountName(null, userInfo.usri0_name, pSid, ref cbSid, referencedDomainName, ref cchReferencedDomainName, out peUse);
if (!bSuccess && cbSid > 0)
{
pSid = Marshal.AllocHGlobal(cbSid);
referencedDomainName.EnsureCapacity(cchReferencedDomainName);
bSuccess = LookupAccountName(null, userInfo.usri0_name, pSid, ref cbSid, referencedDomainName, ref cchReferencedDomainName, out peUse);
}
if (bSuccess)
{
if (ConvertSidToStringSid(pSid, out string stringSid))
{
if (registrySids.Contains(stringSid))
{
sids.Add(stringSid);
}
}
}
if (pSid != IntPtr.Zero)
{
Marshal.FreeHGlobal(pSid);
}
}
}
catch (Exception)
{
}
finally
{
NetApi32.NetApiBufferFree(bufPtr);
}
}
if (sids.Count == 1)
{
return sids[0];
}
return string.Empty;
}
public static bool IsSystemUser() public static bool IsSystemUser()
{ {
return currentUsername == "NT AUTHORITY\\SYSTEM"; return currentUsername == "NT AUTHORITY\\SYSTEM";
@@ -351,4 +417,9 @@ namespace cmonitor.server.client.reports.screen
} }
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct USER_INFO_0
{
public string usri0_name;
}
} }

View File

@@ -1,6 +1,7 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security; using System.Security;
using System.Text;
namespace cmonitor.server.client.reports.screen.winapis; namespace cmonitor.server.client.reports.screen.winapis;
@@ -377,4 +378,15 @@ public static class ADVAPI32
public IntPtr Sid; public IntPtr Sid;
public int Attributes; public int Attributes;
} }
[DllImport("Advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern bool LookupAccountName(
string lpSystemName,
string lpAccountName,
IntPtr Sid,
ref int cbSid,
StringBuilder ReferencedDomainName,
ref int cchReferencedDomainName,
out int peUse
);
} }

View File

@@ -1,4 +1,5 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text;
namespace cmonitor.server.client.reports.screen.winapis namespace cmonitor.server.client.reports.screen.winapis
{ {
@@ -21,5 +22,20 @@ namespace cmonitor.server.client.reports.screen.winapis
{ {
return NetUserChangePassword(domainname, username, oldpassword, newpassword) == 0; return NetUserChangePassword(domainname, username, oldpassword, newpassword) == 0;
} }
[DllImport("Netapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern int NetUserEnum(
StringBuilder servername,
int level,
int filter,
out IntPtr bufptr,
int prefmaxlen,
out int entriesread,
out int totalentries,
ref int resume_handle
);
[DllImport("Netapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern int NetApiBufferFree(IntPtr Buffer);
} }
} }

View File

@@ -1,6 +1,5 @@
using cmonitor.server.client.reports.screen; using cmonitor.server.client.reports.screen;
using cmonitor.server.client.reports.screen.winapis; using cmonitor.server.client.reports.screen.winapis;
using cmonitor.server.client.reports.share;
using common.libs; using common.libs;
using MemoryPack; using MemoryPack;
using Microsoft.Win32; using Microsoft.Win32;
@@ -12,21 +11,17 @@ namespace cmonitor.server.client.reports.system
public string Name => "System"; public string Name => "System";
private readonly SystemReportInfo systemReportInfo = new SystemReportInfo(); private readonly SystemReportInfo systemReportInfo = new SystemReportInfo();
private readonly RegistryOptionHelper registryOptionHelper = new RegistryOptionHelper(); private readonly RegistryOptionHelper registryOptionHelper;
private readonly RegistryCplHelper registryCplHelper = new RegistryCplHelper();
private double lastCpu; private double lastCpu;
private double lastMemory; private double lastMemory;
private ReportDriveInfo[] drives; private ReportDriveInfo[] drives;
private Dictionary<string, RegistryOptionHelper.RegistryOptionKeyInfo> registryKeys; private Dictionary<string, RegistryOptionHelper.RegistryOptionKeyInfo> registryKeys;
private readonly ShareReport shareReport; public SystemReport(ClientConfig clientConfig)
private readonly Config config;
public SystemReport(ShareReport shareReport, Config config)
{ {
this.shareReport = shareReport; registryOptionHelper = new RegistryOptionHelper(clientConfig);
this.config = config;
drives = WindowsDrive.GetAllDrives(); drives = WindowsDrive.GetAllDrives();
registryKeys = registryOptionHelper.GetKeys(); registryKeys = registryOptionHelper.GetKeys();
ReportTask(); ReportTask();
@@ -109,29 +104,6 @@ namespace cmonitor.server.client.reports.system
} }
}, TaskCreationOptions.LongRunning); }, TaskCreationOptions.LongRunning);
/*
ShareItemInfo shareItemInfo = new ShareItemInfo
{
Index = config.ShareMemoryLength - 1,
Key = "System"
};
long lastTime = 0;
Task.Factory.StartNew(() =>
{
while (true)
{
long time = (long)(DateTime.UtcNow.Subtract(startTime)).TotalMilliseconds;
if (time - lastTime >= 300)
{
shareItemInfo.Value = time.ToString();
shareReport.Update(shareItemInfo);
lastTime = time;
}
Thread.Sleep(100);
}
}, TaskCreationOptions.LongRunning);
*/
} }
} }
@@ -163,14 +135,19 @@ namespace cmonitor.server.client.reports.system
public sealed class RegistryOptionHelper public sealed class RegistryOptionHelper
{ {
private string currentUserSid = string.Empty; private string currentUserSid = string.Empty;
private readonly ClientConfig clientConfig;
char[] values; char[] values;
public RegistryOptionHelper() public RegistryOptionHelper(ClientConfig clientConfig)
{ {
this.clientConfig = clientConfig;
values = string.Empty.PadLeft(Infos.Length, '0').ToCharArray(); values = string.Empty.PadLeft(Infos.Length, '0').ToCharArray();
currentUserSid = Win32Interop.GetCurrentUserSid(); GetSid();
} }
public string GetValues() public string GetValues()
{ {
GetSid();
if (OperatingSystem.IsWindows()) if (OperatingSystem.IsWindows())
{ {
for (int i = 0; i < Infos.Length; i++) for (int i = 0; i < Infos.Length; i++)
@@ -197,6 +174,10 @@ namespace cmonitor.server.client.reports.system
} }
public bool UpdateValue(string name, bool value) public bool UpdateValue(string name, bool value)
{ {
if (string.IsNullOrWhiteSpace(currentUserSid))
{
return false;
}
RegistryOptionInfo info = Infos.FirstOrDefault(c => c.Key == name); RegistryOptionInfo info = Infos.FirstOrDefault(c => c.Key == name);
if (info == null) return false; if (info == null) return false;
@@ -223,7 +204,23 @@ namespace cmonitor.server.client.reports.system
} }
return string.Empty; return string.Empty;
} }
private void GetSid()
{
if (string.IsNullOrWhiteSpace(currentUserSid))
{
currentUserSid = clientConfig.UserSid;
}
if (string.IsNullOrWhiteSpace(currentUserSid))
{
currentUserSid = Win32Interop.GetCurrentUserSid();
clientConfig.UserSid = currentUserSid;
}
if (string.IsNullOrWhiteSpace(currentUserSid))
{
currentUserSid = Win32Interop.GetDefaultUserSid();
clientConfig.UserSid = currentUserSid;
}
}
public Dictionary<string, RegistryOptionKeyInfo> GetKeys() public Dictionary<string, RegistryOptionKeyInfo> GetKeys()
{ {
@@ -396,7 +393,7 @@ namespace cmonitor.server.client.reports.system
Key="USBSTOR", Key="USBSTOR",
Desc="U盘", Desc="U盘",
Paths = new RegistryOptionPathInfo[]{ Paths = new RegistryOptionPathInfo[]{
new RegistryOptionPathInfo{ Path="HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR", Key="USBSTOR", DisallowValue="4", AllowValue="3" } new RegistryOptionPathInfo{ Path="HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR", Key="Start", DisallowValue="4", AllowValue="3" }
} }
} }
}; };
@@ -423,166 +420,4 @@ namespace cmonitor.server.client.reports.system
} }
public sealed class RegistryCplHelper
{
private string currentUserSid = string.Empty;
private char[] values;
private string valuesPath = string.Empty;//"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\DisallowCpl";
private string switchPath = string.Empty;//"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer";
public RegistryCplHelper()
{
values = string.Empty.PadLeft(Infos.Length, '0').ToCharArray();
currentUserSid = Win32Interop.GetCurrentUserSid();
SwitchOn();
}
public string GetValues()
{
if (OperatingSystem.IsWindows())
{
RegistryKey key = GetRegistryValuesKey(valuesPath);
if (key != null)
{
for (int i = 0; i < Infos.Length; i++)
{
RegistryCplInfo item = Infos[i];
object value = key.GetValue(item.Key);
values[i] = (value == null ? '0' : '1');
}
}
}
return new string(values);
}
public bool UpdateValue(string name, bool value)
{
RegistryCplInfo info = Infos.FirstOrDefault(c => c.Key == name);
if (info == null) return false;
if (OperatingSystem.IsWindows())
{
RegistryKey key = GetRegistryValuesKey(valuesPath);
if (key == null)
{
return false;
}
if (value)
{
key.SetValue(info.Key, info.Key, RegistryValueKind.String);
}
else
{
key.DeleteValue(info.Key);
}
key.Close();
return true;
}
return false;
}
private RegistryKey GetRegistryValuesKey(string path)
{
if (OperatingSystem.IsWindows())
{
if (!string.IsNullOrWhiteSpace(currentUserSid))
{
Registry.Users.OpenSubKey(currentUserSid, true);
}
}
return null;
}
private void SwitchOn()
{
if (OperatingSystem.IsWindows())
{
RegistryKey key = GetRegistryValuesKey(switchPath);
if (key != null)
{
key.SetValue("DisallowCpl", 1, RegistryValueKind.DWord);
key.Close();
}
}
}
public Dictionary<string, RegistryCplKeyInfo> GetKeys()
{
Dictionary<string, RegistryCplKeyInfo> keys = new Dictionary<string, RegistryCplKeyInfo>();
for (int i = 0; i < Infos.Length; i++)
{
RegistryCplInfo item = Infos[i];
keys[item.Key] = new RegistryCplKeyInfo { Desc = item.Desc, Index = (ushort)i };
}
return keys;
}
//Desc为空则不显示
private RegistryCplInfo[] Infos = new RegistryCplInfo[] {
/*
new RegistryCplInfo{ Key="Microsoft.ActionCenter", Desc="操作中心" },
new RegistryCplInfo{ Key="Microsoft.AdministrativeTools", Desc="管理工具" },
new RegistryCplInfo{ Key="Microsoft.AutoPlay", Desc="自动播放" },
new RegistryCplInfo{ Key="Microsoft.BiometricDevices", Desc="生物识别设备" },
new RegistryCplInfo{ Key="Microsoft.BitLockerDriveEncryption", Desc="BitLocker 驱动器加密" },
new RegistryCplInfo{ Key="Microsoft.ColorManagement", Desc="颜色管理" },
new RegistryCplInfo{ Key="Microsoft.CredentialManager", Desc="凭据管理器" },
new RegistryCplInfo{ Key="Microsoft.DateAndTime", Desc="日期和时间" },
new RegistryCplInfo{ Key="Microsoft.DefaultPrograms", Desc="默认程序" },
new RegistryCplInfo{ Key="Microsoft.DeviceManager", Desc="设备管理器" },
new RegistryCplInfo{ Key="Microsoft.DevicesAndPrinters", Desc="设备和打印机" },
new RegistryCplInfo{ Key="Microsoft.Display", Desc="显示" },
new RegistryCplInfo{ Key="Microsoft.EaseOfAccessCenter", Desc="轻松访问中心" },
new RegistryCplInfo{ Key="Microsoft.ParentalControls", Desc="家庭安全" },
new RegistryCplInfo{ Key="Microsoft.FileHistory", Desc="文件历史记录" },
new RegistryCplInfo{ Key="Microsoft.FolderOptions", Desc="文件夹选项" },
new RegistryCplInfo{ Key="Microsoft.Fonts", Desc="字体" },
new RegistryCplInfo{ Key="Microsoft.HomeGroup", Desc="家庭组" },
new RegistryCplInfo{ Key="Microsoft.IndexingOptions", Desc="索引选项" },
new RegistryCplInfo{ Key="Microsoft.Infrared", Desc="红外线" },
new RegistryCplInfo{ Key="Microsoft.InternetOptions", Desc="Internet 选项" },
new RegistryCplInfo{ Key="Microsoft.iSCSIInitiator", Desc="iSCSI 发起程序" },
new RegistryCplInfo{ Key="Microsoft.iSNSServer", Desc="iSNS 服务器" },
new RegistryCplInfo{ Key="Microsoft.Keyboard", Desc="键盘" },
new RegistryCplInfo{ Key="Microsoft.LocationSettings", Desc="位置设置" },
new RegistryCplInfo{ Key="Microsoft.Mouse", Desc="鼠标" },
new RegistryCplInfo{ Key="Microsoft.NetworkAndSharingCenter", Desc="网络和共享中心" },
new RegistryCplInfo{ Key="Microsoft.NotificationAreaIcons", Desc="通知区域图标" },
new RegistryCplInfo{ Key="Microsoft.PenAndTouch", Desc="触控笔和触控" },
new RegistryCplInfo{ Key="Microsoft.Personalization", Desc="个性化" },
new RegistryCplInfo{ Key="Microsoft.PowerOptions", Desc="电源选项" },
new RegistryCplInfo{ Key="Microsoft.ProgramsAndFeatures", Desc="程序和功能" },
new RegistryCplInfo{ Key="Microsoft.Recovery", Desc="恢复" },
new RegistryCplInfo{ Key="Microsoft.RegionAndLanguage", Desc="区域" },
new RegistryCplInfo{ Key="Microsoft.RemoteAppAndDesktopConnections", Desc="桌面连接" },
new RegistryCplInfo{ Key="Microsoft.Sound", Desc="声音" },
new RegistryCplInfo{ Key="Microsoft.SpeechRecognition", Desc="语音识别" },
new RegistryCplInfo{ Key="Microsoft.StorageSpaces", Desc="存储空间" },
new RegistryCplInfo{ Key="Microsoft.SyncCenter", Desc="同步中心" },
new RegistryCplInfo{ Key="Microsoft.System", Desc="系统" },
new RegistryCplInfo{ Key="Microsoft.Taskbar", Desc="任务栏和导航" },
new RegistryCplInfo{ Key="Microsoft.Troubleshooting", Desc="疑难解答" },
new RegistryCplInfo{ Key="Microsoft.TSAppInstall", Desc="TSAppInstall" },
new RegistryCplInfo{ Key="Microsoft.UserAccounts", Desc="用户帐户" },
new RegistryCplInfo{ Key="Microsoft.WindowsAnytimeUpgrade", Desc="Windows Anytime Upgrade" },
new RegistryCplInfo{ Key="Microsoft.WindowsDefender", Desc="Windows Defender" },
new RegistryCplInfo{ Key="Microsoft.WindowsFirewall", Desc="Windows 防火墙" },
new RegistryCplInfo{ Key="Microsoft.MobilityCenter", Desc="Windows 移动中心" },
new RegistryCplInfo{ Key="Microsoft.PortableWorkspaceCreator", Desc="Windows To Go" },
new RegistryCplInfo{ Key="Microsoft.WindowsUpdate", Desc="Windows 更新" },
new RegistryCplInfo{ Key="Microsoft.WorkFolders", Desc="工作文件夹" },
*/
};
sealed class RegistryCplInfo
{
public string Key { get; set; } = string.Empty;
public string Desc { get; set; } = string.Empty;
}
public sealed class RegistryCplKeyInfo
{
public string Desc { get; set; }
public ushort Index { get; set; }
}
}
} }

View File

@@ -54,7 +54,7 @@ namespace cmonitor.server.client.reports.llock
if (open) if (open)
{ {
CommandHelper.Windows(string.Empty, new string[] { CommandHelper.Windows(string.Empty, new string[] {
$"start wallpaper.win.exe \"{url}\" {config.ShareMemoryKey} {config.ShareMemoryLength* Config.ShareMemoryItemLength} {Config.ShareMemoryKeyBoardIndex} {Config.ShareMemoryWallpaperIndex}" $"start wallpaper.win.exe \"{url}\" {config.ShareMemoryKey} {config.ShareMemoryLength} {Config.ShareMemoryKeyBoardIndex} {Config.ShareMemoryWallpaperIndex}"
}); });
} }
}); });

View File

@@ -1,5 +1,4 @@
using cmonitor.server.api; using cmonitor.server.api;
using cmonitor.server.client.reports;
using cmonitor.server.client.reports.screen; using cmonitor.server.client.reports.screen;
using cmonitor.server.service.messengers.sign; using cmonitor.server.service.messengers.sign;
using MemoryPack; using MemoryPack;
@@ -21,19 +20,19 @@ namespace cmonitor.server.service.messengers.screen
this.signCaching = signCaching; this.signCaching = signCaching;
} }
[MessengerId((ushort)ScreenMessengerIds.Full)] [MessengerId((ushort)ScreenMessengerIds.CaptureFull)]
public void Full(IConnection connection) public void CaptureFull(IConnection connection)
{ {
ScreenReportFullType reportType = ScreenReportFullType.Trim; ScreenReportFullType reportType = ScreenReportFullType.Trim;
if (connection.ReceiveRequestWrap.Payload.Length > 0) if (connection.ReceiveRequestWrap.Payload.Length > 0)
{ {
reportType = (ScreenReportFullType)connection.ReceiveRequestWrap.Payload.Span[0]; reportType = (ScreenReportFullType)connection.ReceiveRequestWrap.Payload.Span[0];
} }
screenReport.Full(reportType); screenReport.CaptureFull(reportType);
} }
[MessengerId((ushort)ScreenMessengerIds.FullReport)] [MessengerId((ushort)ScreenMessengerIds.CaptureFullReport)]
public void FullReport(IConnection connection) public void CaptureFullReport(IConnection connection)
{ {
if (signCaching.Get(connection.Name, out SignCacheInfo cache)) if (signCaching.Get(connection.Name, out SignCacheInfo cache))
{ {
@@ -49,48 +48,53 @@ namespace cmonitor.server.service.messengers.screen
} }
} }
[MessengerId((ushort)ScreenMessengerIds.Share)] [MessengerId((ushort)ScreenMessengerIds.CaptureClip)]
public void Share(IConnection connection) public void CaptureClip(IConnection connection)
{ {
screenReport.CaptureClip(MemoryPackSerializer.Deserialize<ScreenClipInfo>(connection.ReceiveRequestWrap.Payload.Span));
} }
[MessengerId((ushort)ScreenMessengerIds.Clip)] [MessengerId((ushort)ScreenMessengerIds.CaptureRegion)]
public void Clip(IConnection connection) public void CaptureRegion(IConnection connection)
{ {
screenReport.Clip(MemoryPackSerializer.Deserialize<ScreenClipInfo>(connection.ReceiveRequestWrap.Payload.Span)); screenReport.CaptureRegion();
} }
[MessengerId((ushort)ScreenMessengerIds.CaptureRegionReport)]
public void CaptureRegionReport(IConnection connection)
[MessengerId((ushort)ScreenMessengerIds.Region)]
public void Region(IConnection connection)
{
screenReport.Region();
}
[MessengerId((ushort)ScreenMessengerIds.RegionReport)]
public void RegionReport(IConnection connection)
{ {
clientServer.Notify("/notify/report/screen/region", connection.Name, connection.ReceiveRequestWrap.Payload); clientServer.Notify("/notify/report/screen/region", connection.Name, connection.ReceiveRequestWrap.Payload);
} }
[MessengerId((ushort)ScreenMessengerIds.CaptureRectangles)]
[MessengerId((ushort)ScreenMessengerIds.Rectangles)] public void CaptureRectangles(IConnection connection)
public void Rectangles(IConnection connection)
{ {
Rectangle[] rectangles = MemoryPackSerializer.Deserialize<Rectangle[]>(connection.ReceiveRequestWrap.Payload.Span); Rectangle[] rectangles = MemoryPackSerializer.Deserialize<Rectangle[]>(connection.ReceiveRequestWrap.Payload.Span);
clientServer.Notify("/notify/report/screen/rectangles", new { Name = connection.Name, Rectangles = rectangles }); clientServer.Notify("/notify/report/screen/rectangles", new { Name = connection.Name, Rectangles = rectangles });
} }
[MessengerId((ushort)ScreenMessengerIds.MonitorState)] [MessengerId((ushort)ScreenMessengerIds.DisplayState)]
public void MonitorState(IConnection connection) public void DisplayState(IConnection connection)
{ {
if (connection.ReceiveRequestWrap.Payload.Length == 1) if (connection.ReceiveRequestWrap.Payload.Length == 1)
{ {
byte state = connection.ReceiveRequestWrap.Payload.Span[0]; byte state = connection.ReceiveRequestWrap.Payload.Span[0];
screenReport.MonitorState(state == 1); screenReport.DisplayState(state == 1);
} }
} }
[MessengerId((ushort)ScreenMessengerIds.ScreenShare)]
public void ScreenShare(IConnection connection)
{
screenReport.ScreenShare(connection.ReceiveRequestWrap.Payload);
}
[MessengerId((ushort)ScreenMessengerIds.ScreenShareState)]
public void ScreenShareState(IConnection connection)
{
screenReport.ScreenShareState((ScreenShareStates)connection.ReceiveRequestWrap.Payload.Span[0]);
}
} }
} }

View File

@@ -2,20 +2,20 @@
{ {
public enum ScreenMessengerIds : ushort public enum ScreenMessengerIds : ushort
{ {
Full = 800, CaptureFull = 800,
FullReport = 801, CaptureFullReport = 801,
Clip = 802, CaptureClip = 802,
Region = 803, CaptureRegion = 803,
RegionReport = 804, CaptureRegionReport = 804,
Rectangles = 805, CaptureRectangles = 805,
MonitorState = 806, DisplayState = 806,
ShareState = 807, ScreenShareState = 807,
Share = 808, ScreenShare = 808,
None = 899 None = 899
} }

View File

@@ -5,19 +5,11 @@ namespace llock.win
{ {
public sealed class CommandHelper public sealed class CommandHelper
{ {
public static string Windows(string arg, string[] commands) public static void Windows(string arg, string[] commands)
{ {
return Execute("cmd.exe", arg, commands); Execute("cmd.exe", arg, commands);
} }
public static string Linux(string arg, string[] commands) public static void Execute(string fileName, string arg, string[] commands)
{
return Execute("/bin/bash", arg, commands);
}
public static string Osx(string arg, string[] commands)
{
return Execute("/bin/bash", arg, commands);
}
public static Process Execute(string fileName, string arg)
{ {
Process proc = new Process(); Process proc = new Process();
proc.StartInfo.CreateNoWindow = true; proc.StartInfo.CreateNoWindow = true;
@@ -28,23 +20,7 @@ namespace llock.win
proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.Arguments = arg; proc.StartInfo.Arguments = arg;
proc.StartInfo.Verb = "runas"; proc.StartInfo.Verb = "runas";
proc.Start(); proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
//Process proc = Process.Start(fileName, arg);
return proc;
}
public static string Execute(string fileName, string arg, string[] commands)
{
Process proc = new Process();
//proc.StartInfo.WorkingDirectory = Path.GetFullPath(Path.Join("./"));
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.FileName = fileName;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.RedirectStandardInput = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.Arguments = arg;
proc.StartInfo.Verb = "runas";
proc.Start(); proc.Start();
if (commands.Length > 0) if (commands.Length > 0)
@@ -58,13 +34,6 @@ namespace llock.win
proc.StandardInput.AutoFlush = true; proc.StandardInput.AutoFlush = true;
proc.StandardInput.WriteLine("exit"); proc.StandardInput.WriteLine("exit");
proc.StandardInput.Close(); proc.StandardInput.Close();
string output = proc.StandardOutput.ReadToEnd();
string error = proc.StandardError.ReadToEnd();
proc.WaitForExit();
proc.Close();
proc.Dispose();
return output;
} }
} }
} }

View File

@@ -1,6 +1,6 @@
namespace llock.win namespace llock.win
{ {
partial class Form1 partial class MainForm
{ {
/// <summary> /// <summary>
/// 必需的设计器变量。 /// 必需的设计器变量。
@@ -30,6 +30,7 @@
{ {
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnClear = new System.Windows.Forms.Button(); this.btnClear = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.btn0 = new System.Windows.Forms.Button(); this.btn0 = new System.Windows.Forms.Button();
this.btn9 = new System.Windows.Forms.Button(); this.btn9 = new System.Windows.Forms.Button();
this.btn8 = new System.Windows.Forms.Button(); this.btn8 = new System.Windows.Forms.Button();
@@ -40,7 +41,6 @@
this.btn3 = new System.Windows.Forms.Button(); this.btn3 = new System.Windows.Forms.Button();
this.btn2 = new System.Windows.Forms.Button(); this.btn2 = new System.Windows.Forms.Button();
this.btn1 = new System.Windows.Forms.Button(); this.btn1 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
@@ -76,6 +76,16 @@
this.btnClear.Text = "清除"; this.btnClear.Text = "清除";
this.btnClear.UseVisualStyleBackColor = true; this.btnClear.UseVisualStyleBackColor = true;
// //
// button1
//
this.button1.Location = new System.Drawing.Point(130, 145);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(50, 23);
this.button1.TabIndex = 1;
this.button1.Text = "解锁";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// btn0 // btn0
// //
this.btn0.Location = new System.Drawing.Point(74, 145); this.btn0.Location = new System.Drawing.Point(74, 145);
@@ -166,16 +176,6 @@
this.btn1.Text = "1"; this.btn1.Text = "1";
this.btn1.UseVisualStyleBackColor = true; this.btn1.UseVisualStyleBackColor = true;
// //
// button1
//
this.button1.Location = new System.Drawing.Point(130, 145);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(50, 23);
this.button1.TabIndex = 1;
this.button1.Text = "解锁";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1 // textBox1
// //
this.textBox1.Location = new System.Drawing.Point(18, 28); this.textBox1.Location = new System.Drawing.Point(18, 28);
@@ -192,7 +192,7 @@
this.ClientSize = new System.Drawing.Size(800, 450); this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Name = "Form1"; this.Name = "Form1";
this.Text = "Form1"; this.Text = "MainForm";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OnClose); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OnClose);
this.Load += new System.EventHandler(this.OnLoad); this.Load += new System.EventHandler(this.OnLoad);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);

View File

@@ -9,7 +9,7 @@ using System.Windows.Forms;
namespace llock.win namespace llock.win
{ {
public partial class Form1 : Form public partial class MainForm : Form
{ {
Hook hook = new Hook(); Hook hook = new Hook();
private string shareMkey; private string shareMkey;
@@ -30,7 +30,7 @@ namespace llock.win
} }
} }
public Form1(string shareMkey, int shareMLength, int shareIndex) public MainForm(string shareMkey, int shareMLength, int shareIndex)
{ {
this.shareMkey = shareMkey; this.shareMkey = shareMkey;
this.shareMLength = shareMLength; this.shareMLength = shareMLength;
@@ -273,20 +273,6 @@ namespace llock.win
catch (Exception) catch (Exception)
{ {
} }
/*
Guid activePolicyGuid;
IntPtr ptr;
if (PowerGetActiveScheme(IntPtr.Zero, out ptr) == 0)
{
activePolicyGuid = (Guid)Marshal.PtrToStructure(ptr, typeof(Guid));
if (ptr != IntPtr.Zero)
{
Marshal.FreeHGlobal(ptr);
}
uint resultPowerButton = PowerWriteACValueIndex(IntPtr.Zero, ref activePolicyGuid, ref powerButtonGuid, ref powerButtonGuid, 0);
uint resultSleepButton = PowerWriteACValueIndex(IntPtr.Zero, ref activePolicyGuid, ref sleepButtonGuid, ref sleepButtonGuid, 0);
}
*/
Task.Run(() => Task.Run(() =>
{ {
CommandHelper.Windows(string.Empty, new string[] { "gpupdate /force" }); CommandHelper.Windows(string.Empty, new string[] { "gpupdate /force" });
@@ -296,14 +282,11 @@ namespace llock.win
} }
public void Close() public void Close()
{ {
bool retKeyboard = true;
if (hHook != 0) if (hHook != 0)
{ {
retKeyboard = UnhookWindowsHookEx(hHook); UnhookWindowsHookEx(hHook);
hHook = 0; hHook = 0;
} }
//如果去掉钩子失败.
//if (!retKeyboard) throw new Exception("UnhookWindowsHookEx failed.");
try try
{ {
foreach (string user in Registry.Users.GetSubKeyNames()) foreach (string user in Registry.Users.GetSubKeyNames())
@@ -350,37 +333,10 @@ namespace llock.win
if (nCode >= 0) if (nCode >= 0)
{ {
return 1; return 1;
/*
KeyBoardHookStruct kbh = (KeyBoardHookStruct)Marshal.PtrToStructure(lParam, typeof(KeyBoardHookStruct));
bool res = (kbh.vkCode >= (int)Keys.D0 && kbh.vkCode <= (int)Keys.D9)
|| (kbh.vkCode >= (int)Keys.NumPad0 && kbh.vkCode <= (int)Keys.NumPad9)
|| (kbh.vkCode >= (int)Keys.A && kbh.vkCode <= (int)Keys.Z);
if (res == false)
{
return 1;
}
*/
} }
return CallNextHookEx(hHook, nCode, wParam, lParam); return CallNextHookEx(hHook, nCode, wParam, lParam);
} }
[DllImport("powrprof.dll")]
public static extern uint GetActivePwrScheme(out IntPtr pActivePolicy);
[DllImport("powrprof.dll", SetLastError = true)]
public static extern UInt32 PowerGetActiveScheme(IntPtr UserRootPowerKey, out IntPtr ActivePolicyGuid);
[DllImport("powrprof.dll")]
public static extern uint PowerWriteACValueIndex(IntPtr RootPowerKey, ref Guid SchemeGuid, ref Guid SubGroupOfPowerSettingsGuid,
ref Guid PowerSettingGuid, uint AcValueIndex);
Guid powerButtonGuid = new Guid("4f971e89-eebd-4455-a8de-9e59040e7347"); // 电源按钮设置的GUID
Guid sleepButtonGuid = new Guid("96996bc0-ad50-47ec-923b-6f418386bca1"); // 睡眠按钮设置的GUID
#region IDisposable #region IDisposable
public void Dispose() public void Dispose()
{ {

View File

@@ -24,7 +24,7 @@ namespace llock.win
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(shareMkey, shareMLength, shareIndex)); Application.Run(new MainForm(shareMkey, shareMLength, shareIndex));
} }
} }
} }

View File

@@ -81,16 +81,16 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CommandHelper.cs" /> <Compile Include="CommandHelper.cs" />
<Compile Include="Form1.cs"> <Compile Include="MainForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Form1.Designer.cs"> <Compile Include="MainForm.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx"> <EmbeddedResource Include="MainForm.resx">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>

View File

@@ -1,6 +1,6 @@
namespace message.win namespace message.win
{ {
partial class Form1 partial class MainForm
{ {
/// <summary> /// <summary>
/// 必需的设计器变量。 /// 必需的设计器变量。
@@ -28,7 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
@@ -40,10 +40,9 @@
// //
this.label1.Font = new System.Drawing.Font("宋体", 36F); this.label1.Font = new System.Drawing.Font("宋体", 36F);
this.label1.ForeColor = System.Drawing.Color.Red; this.label1.ForeColor = System.Drawing.Color.Red;
this.label1.Location = new System.Drawing.Point(24, 8); this.label1.Location = new System.Drawing.Point(12, 4);
this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(720, 176); this.label1.Size = new System.Drawing.Size(360, 88);
this.label1.TabIndex = 0; this.label1.TabIndex = 0;
this.label1.Text = "提醒 消息"; this.label1.Text = "提醒 消息";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -51,10 +50,9 @@
// label2 // label2
// //
this.label2.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label2.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(38, 200); this.label2.Location = new System.Drawing.Point(19, 100);
this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(700, 216); this.label2.Size = new System.Drawing.Size(350, 108);
this.label2.TabIndex = 1; this.label2.TabIndex = 1;
this.label2.Text = "上课时间,请注意课堂纪律"; this.label2.Text = "上课时间,请注意课堂纪律";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -62,10 +60,9 @@
// label3 // label3
// //
this.label3.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label3.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(24, 426); this.label3.Location = new System.Drawing.Point(12, 213);
this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(720, 68); this.label3.Size = new System.Drawing.Size(360, 34);
this.label3.TabIndex = 2; this.label3.TabIndex = 2;
this.label3.Text = "10"; this.label3.Text = "10";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -74,26 +71,27 @@
// //
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.InitialImage = null; this.pictureBox1.InitialImage = null;
this.pictureBox1.Location = new System.Drawing.Point(252, -49); this.pictureBox1.Location = new System.Drawing.Point(126, -24);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(260, 233); this.pictureBox1.Size = new System.Drawing.Size(130, 116);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 3; this.pictureBox1.TabIndex = 3;
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
// //
// Form1 // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White; this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(768, 512); this.ClientSize = new System.Drawing.Size(384, 256);
this.Controls.Add(this.pictureBox1); this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.label3); this.Controls.Add(this.label3);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Form1"; this.Name = "MainForm";
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "提醒消息"; this.Text = "提醒消息";

View File

@@ -5,7 +5,7 @@ using System.Windows.Forms;
namespace message.win namespace message.win
{ {
public partial class Form1 : Form public partial class MainForm : Form
{ {
private readonly int times = 10; private readonly int times = 10;
@@ -22,7 +22,7 @@ namespace message.win
} }
} }
public Form1(string msg, int times) public MainForm(string msg, int times)
{ {
InitializeComponent(); InitializeComponent();
ShowInTaskbar = false; ShowInTaskbar = false;

View File

@@ -828,6 +828,285 @@
4cRggQuMgAd4zwjcgCENngQsECIq4hquQSMeTMLQ3LNZ3a3MUiUCRTjx3PglTzDk4lEEwwYYwBaQYCKi 4cRggQuMgAd4zwjcgCENngQsECIq4hquQSMeTMLQ3LNZ3a3MUiUCRTjx3PglTzDk4lEEwwYYwBaQYCKi
IhxFnSOkmSuKUAT2ihTO4k/UIs+VgP9RHEH4IjAKIwL2Bcx5ggkUANUljylAoYXIIjMCBTJUYeo0lc89 IhxFnSOkmSuKUAT2ihTO4k/UIs+VgP9RHEH4IjAKIwL2Bcx5ggkUANUljylAoYXIIjMCBTJUYeo0lc89
2zScAAT8Im6cATzGozzOGSM91qM93iMZlA3MwQADdCPnPGGvTKCGBAQAOw== 2zScAAT8Im6cATzGozzOGSM91qM93iMZlA3MwQADdCPnPGGvTKCGBAQAOw==
</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAAAAAAAEAIABdQAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAEAAAABA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RDQgigHRgKpIFKFfjTCAq0N3TXEY1cArJXgTrgB0I8pHU6gHvHS0AOsovAImJOoYgmQBMRzIbwSjU
NEEbEHsWB0q9PwJ8CmwD9iI5A3j6wxKeL9ACoLNkX3xlQRKHIANV4PQqYCQwDLW0qAOSfIsHlXEnFzgG
fI5gB5JTCCoAFxKt3ncSLQB8QTagAqsGoKYHw4ErUFWOMlGWhUi0DaGjuFAeeZVITiLYj2B/Y/z9SSRF
BKCUdl9ECwBfk43yKzNjxYMNldJ8FDAOldR0MDAIGIgSDP39O5BAJVDQuOWjnvCHgKNIShHUE44LF/BE
oLvbt+jvP76e4zkAzLiIQZKImiYMRE0bRqLSm8UDYc02G70/ZNuNCqypb7aVASeA4wiOIylAeeSVoISB
Wz/dewYtAAJJNqC+AwtmrEhi8ZCMIBlJMqpicjJKWMSj8iA2bXEoISG4ZG8QzTZ/IJttoOblEjWoy4GK
ZlsZakAXA+cRFCMpxkQxUIEbJwIXNBbJ1gQELQCCmWdR35Cb0MbphI1LmoENtRSZgMqIFN64hbV4HYZK
nGpF2SCsLTZQJasdqLm3s/Gvo3GzowZ4XePW/HUVglIk1ainfNOTvgETDZixI4EnA30jNd7QAqCvkX3x
lbj4VzZ7T6Ce2eKyfeTF92Tj/y+1yov7XH58jUaj0Wg0Gk2v5P8D5M/bzdE8cNIAAAAASUVORK5CYII=
</value> </value>
</data> </data>
</root> </root>

View File

@@ -1,4 +1,5 @@
using System; using System;
using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
namespace message.win namespace message.win
@@ -11,6 +12,12 @@ namespace message.win
[STAThread] [STAThread]
static void Main(string[] args) static void Main(string[] args)
{ {
Mutex mutex = new Mutex(true, System.Diagnostics.Process.GetCurrentProcess().ProcessName, out bool isAppRunning);
if (isAppRunning == false)
{
Environment.Exit(1);
}
AppDomain.CurrentDomain.UnhandledException += (a, b) => AppDomain.CurrentDomain.UnhandledException += (a, b) =>
{ {
}; };
@@ -33,7 +40,7 @@ namespace message.win
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(msg, times)); Application.Run(new MainForm(msg, times));
} }
} }
} }

View File

@@ -78,16 +78,16 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Form1.cs"> <Compile Include="MainForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Form1.Designer.cs"> <Compile Include="MainForm.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx"> <EmbeddedResource Include="MainForm.resx">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>

View File

@@ -1,6 +1,6 @@
namespace notify.win namespace notify.win
{ {
partial class Form1 partial class MainForm
{ {
/// <summary> /// <summary>
/// 必需的设计器变量。 /// 必需的设计器变量。
@@ -268,7 +268,7 @@
this.star31.TabIndex = 14; this.star31.TabIndex = 14;
this.star31.TabStop = false; this.star31.TabStop = false;
// //
// Form1 // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
@@ -295,7 +295,7 @@
this.Controls.Add(this.pictureBox1); this.Controls.Add(this.pictureBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Margin = new System.Windows.Forms.Padding(2); this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "Form1"; this.Name = "MainForm";
this.Text = "广播"; this.Text = "广播";
this.Load += new System.EventHandler(this.OnLoad); this.Load += new System.EventHandler(this.OnLoad);
((System.ComponentModel.ISupportInitialize)(this.star15)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.star15)).EndInit();

View File

@@ -6,7 +6,7 @@ using System.Windows.Forms;
namespace notify.win namespace notify.win
{ {
public partial class Form1 : Form public partial class MainForm : Form
{ {
protected override bool ShowWithoutActivation => true; protected override bool ShowWithoutActivation => true;
@@ -28,7 +28,7 @@ namespace notify.win
private int star1; private int star1;
private int star2; private int star2;
private int star3; private int star3;
public Form1(int speed, string msg, int star1, int star2, int star3) public MainForm(int speed, string msg, int star1, int star2, int star3)
{ {
this.speed = speed; this.speed = speed;
this.msg = msg; this.msg = msg;

View File

@@ -28,7 +28,7 @@ namespace notify.win
star3 = int.Parse(args[4]); star3 = int.Parse(args[4]);
} }
Application.Run(new Form1(speed,msg, star1, star2, star3)); Application.Run(new MainForm(speed,msg, star1, star2, star3));
} }
} }
} }

View File

@@ -49,16 +49,16 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Form1.cs"> <Compile Include="MainForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Form1.Designer.cs"> <Compile Include="MainForm.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx"> <EmbeddedResource Include="MainForm.resx">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>

View File

@@ -1,6 +1,6 @@
namespace wallpaper.win namespace wallpaper.win
{ {
partial class Form1 partial class MainForm
{ {
/// <summary> /// <summary>
/// 必需的设计器变量。 /// 必需的设计器变量。
@@ -41,13 +41,13 @@
this.pictureBox1.TabIndex = 0; this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
// //
// Form1 // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450); this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.pictureBox1); this.Controls.Add(this.pictureBox1);
this.Name = "Form1"; this.Name = "MainForm";
this.Text = "壁纸"; this.Text = "壁纸";
this.Load += new System.EventHandler(this.OnLoad); this.Load += new System.EventHandler(this.OnLoad);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();

View File

@@ -1,16 +1,16 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.IO.MemoryMappedFiles; using System.IO.MemoryMappedFiles;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
namespace wallpaper.win namespace wallpaper.win
{ {
public partial class Form1 : Form public partial class MainForm : Form
{ {
private IntPtr programIntPtr = IntPtr.Zero; private IntPtr programIntPtr = IntPtr.Zero;
@@ -35,7 +35,8 @@ namespace wallpaper.win
return cp; return cp;
} }
} }
public Form1(string imgUrl, string shareMkey, int shareMLength, int shareKeyBoardIndex, int shareWallpaperIndex)
public MainForm(string imgUrl, string shareMkey, int shareMLength, int shareKeyBoardIndex, int shareWallpaperIndex)
{ {
this.imgUrl = imgUrl; this.imgUrl = imgUrl;
this.shareMkey = shareMkey; this.shareMkey = shareMkey;
@@ -52,6 +53,32 @@ namespace wallpaper.win
} }
private void OnLoad(object sender, EventArgs e)
{
pictureBox1.LoadCompleted += PictureBox1_LoadCompleted;
pictureBox1.ImageLocation = imgUrl;
this.Dock = DockStyle.Fill;
this.ShowInTaskbar = false;
this.FormBorderStyle = FormBorderStyle.None;
Rectangle bound = Screen.PrimaryScreen.Bounds;
this.Width = bound.Width;
this.Height = bound.Height;
this.Left = 0;
this.Top = 0;
Find();
Init();
this.WindowState = FormWindowState.Maximized;
WatchParent();
WatchMemory();
hook.Start();
}
private void Find() private void Find()
{ {
// 通过类名查找一个窗口,返回窗口句柄。 // 通过类名查找一个窗口,返回窗口句柄。
@@ -59,16 +86,15 @@ namespace wallpaper.win
} }
private void Init() private void Init()
{ {
// 窗口句柄有效 // 窗口句柄有效
if (programIntPtr != IntPtr.Zero) if (programIntPtr != IntPtr.Zero)
{ {
IntPtr result = IntPtr.Zero; IntPtr result = IntPtr.Zero;
                // 向 Program Manager 窗口发送 0x52c 的一个消息超时设置为0x3e81秒 // 向 Program Manager 窗口发送 0x52c 的一个消息超时设置为0x3e81秒
                Win32.SendMessageTimeout(programIntPtr, 0x52c, IntPtr.Zero, IntPtr.Zero, 0, 0x3e8, result); Win32.SendMessageTimeout(programIntPtr, 0x52c, IntPtr.Zero, IntPtr.Zero, 0, 0x3e8, result);
                // 遍历顶级窗口 // 遍历顶级窗口
                Win32.EnumWindows((hwnd, lParam) => Win32.EnumWindows((hwnd, lParam) =>
{ {
                    // 找到包含 SHELLDLL_DefView 这个窗口句柄的 WorkerW                     // 找到包含 SHELLDLL_DefView 这个窗口句柄的 WorkerW
                    if (Win32.FindWindowEx(hwnd, IntPtr.Zero, "SHELLDLL_DefView", null) != IntPtr.Zero)                     if (Win32.FindWindowEx(hwnd, IntPtr.Zero, "SHELLDLL_DefView", null) != IntPtr.Zero)
@@ -86,30 +112,8 @@ namespace wallpaper.win
Win32.SetParent(this.Handle, programIntPtr); Win32.SetParent(this.Handle, programIntPtr);
} }
} }
private void WatchParent()
MemoryMappedFile mmf2;
MemoryMappedViewAccessor accessor2;
byte[] keyBytes = Encoding.UTF8.GetBytes("KeyBoard");
byte[] wallpaperBytes = Encoding.UTF8.GetBytes("Wallpaper");
DateTime startTime = new DateTime(1970, 1, 1);
byte[] emptyArray = new byte[0];
private void OnLoad(object sender, EventArgs e)
{ {
pictureBox1.LoadCompleted += PictureBox1_LoadCompleted;
pictureBox1.ImageLocation = imgUrl;
this.Dock = DockStyle.Fill;
this.ShowInTaskbar = false;
this.FormBorderStyle = FormBorderStyle.None;
hook.Start();
Find();
Init();
this.WindowState = FormWindowState.Maximized;
IntPtr oldprogramIntPtr = programIntPtr; IntPtr oldprogramIntPtr = programIntPtr;
new Thread(() => new Thread(() =>
{ {
@@ -123,11 +127,49 @@ namespace wallpaper.win
Application.Restart(); Application.Restart();
Process.GetCurrentProcess().Kill(); Process.GetCurrentProcess().Kill();
} }
bool hasChild = false;
Win32.EnumChildWindows(programIntPtr, (IntPtr hwnd, IntPtr lParam) =>
{
hasChild |= hwnd == this.Handle;
return true;
}, IntPtr.Zero);
if (hasChild == false)
{
Init();
}
Thread.Sleep(1000); Thread.Sleep(1000);
} }
}).Start(); }).Start();
}
private void PictureBox1_LoadCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
if (e.Error != null)
{
pictureBox1.ImageLocation = "./bg.jpg";
try
{
string filename = Process.GetCurrentProcess().MainModule.FileName;
string dir = Path.GetDirectoryName(filename);
string file = Path.Combine(dir, "bg.jpg");
Win32.SystemParametersInfo(Win32.SPI_SETDESKWALLPAPER, 0, file, Win32.SPIF_UPDATEINIFILE | Win32.SPIF_SENDCHANGE);
}
catch (Exception)
{
}
}
}
MemoryMappedFile mmf2;
MemoryMappedViewAccessor accessor2;
byte[] keyBytes = Encoding.UTF8.GetBytes("KeyBoard");
byte[] wallpaperBytes = Encoding.UTF8.GetBytes("Wallpaper");
DateTime startTime = new DateTime(1970, 1, 1);
byte[] emptyArray = new byte[0];
private void WatchMemory()
{
mmf2 = MemoryMappedFile.CreateOrOpen($"{this.shareMkey}", this.shareMLength * shareItemMLength); mmf2 = MemoryMappedFile.CreateOrOpen($"{this.shareMkey}", this.shareMLength * shareItemMLength);
accessor2 = mmf2.CreateViewAccessor(); accessor2 = mmf2.CreateViewAccessor();
WriteKeyBoard("init"); WriteKeyBoard("init");
@@ -166,15 +208,6 @@ namespace wallpaper.win
} }
}).Start(); }).Start();
} }
private void PictureBox1_LoadCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
if (e.Error != null)
{
pictureBox1.ImageLocation = "./bg.jpg";
}
}
private void WriteKeyBoard(string value) private void WriteKeyBoard(string value)
{ {
WriteMemory(this.shareKeyBoardIndex, keyBytes, Encoding.UTF8.GetBytes(value)); WriteMemory(this.shareKeyBoardIndex, keyBytes, Encoding.UTF8.GetBytes(value));
@@ -223,7 +256,6 @@ namespace wallpaper.win
accessor2.Write((shareMLength - 1) * shareItemMLength, (byte)1); accessor2.Write((shareMLength - 1) * shareItemMLength, (byte)1);
} }
private bool ReadCloseMemory(int index) private bool ReadCloseMemory(int index)
{ {
int keyIndex = index * shareItemMLength; int keyIndex = index * shareItemMLength;
@@ -248,6 +280,11 @@ namespace wallpaper.win
public static class Win32 public static class Win32
{ {
[DllImport("user32.dll")]
public static extern bool EnumChildWindows(IntPtr hWndParent, EnumChildCallback lpEnumFunc, IntPtr lParam);
public delegate bool EnumChildCallback(IntPtr hwnd, IntPtr lParam);
[DllImport("user32.dll")] [DllImport("user32.dll")]
public static extern IntPtr FindWindow(string className, string winName); public static extern IntPtr FindWindow(string className, string winName);
@@ -266,6 +303,13 @@ namespace wallpaper.win
[DllImport("user32.dll")] [DllImport("user32.dll")]
public static extern IntPtr SetParent(IntPtr hwnd, IntPtr parentHwnd); public static extern IntPtr SetParent(IntPtr hwnd, IntPtr parentHwnd);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
public const int SPI_SETDESKWALLPAPER = 20;
public const int SPIF_UPDATEINIFILE = 0x01;
public const int SPIF_SENDCHANGE = 0x02;
} }
@@ -329,11 +373,19 @@ namespace wallpaper.win
public static DateTime DateTime = DateTime.Now; public static DateTime DateTime = DateTime.Now;
public static int KeyBoardHookProc(int nCode, int wParam, IntPtr lParam) public static int KeyBoardHookProc(int nCode, int wParam, IntPtr lParam)
{ {
if (nCode >= 0) if (nCode >= 0)
{ {
KeyBoardHookStruct kbh = (KeyBoardHookStruct)Marshal.PtrToStructure(lParam, typeof(KeyBoardHookStruct)); KeyBoardHookStruct kbh = (KeyBoardHookStruct)Marshal.PtrToStructure(lParam, typeof(KeyBoardHookStruct));
CurrentKeys = (Keys)kbh.vkCode; CurrentKeys = (Keys)kbh.vkCode;
DateTime = DateTime.Now; DateTime = DateTime.Now;
/*
if ((Control.ModifierKeys & Keys.LWin) == Keys.LWin && (Keys)kbh.vkCode == Keys.Tab)
{
return 1;
}
*/
} }
return CallNextHookEx(hHook, nCode, wParam, lParam); return CallNextHookEx(hHook, nCode, wParam, lParam);
} }

View File

@@ -33,7 +33,7 @@ namespace wallpaper.win
} }
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(imgUrl, shareMkey, shareMLength, shareKeyBoardIndex, shareWallpaperIndex)); Application.Run(new MainForm(imgUrl, shareMkey, shareMLength, shareKeyBoardIndex, shareWallpaperIndex));
} }
} }
} }

View File

@@ -76,16 +76,16 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Form1.cs"> <Compile Include="MainForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Form1.Designer.cs"> <Compile Include="MainForm.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx"> <EmbeddedResource Include="MainForm.resx">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.