跳到主要内容

github/tai

公开

Tai · Windows 软件与网站使用时长统计。上游 Planshit/Tai 的源码镜像,非灵栈原创;MIT 许可。来源:https://github.com/Planshit/Tai 。本次为手动同步,暂不提供安装包。

浏览文件

WindowInfo.cs

54 行 · 1.4 KB历史下载
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6
7namespace Core.Models.AppObserver
8{
9 /// <summary>
10 /// 窗口信息
11 /// </summary>
12 public class WindowInfo
13 {
14 /// <summary>
15 /// 窗口类名
16 /// </summary>
17 public string ClassName { get; }
18 /// <summary>
19 /// 窗口标题
20 /// </summary>
21 public string Title { get; }
22 /// <summary>
23 /// 窗口句柄
24 /// </summary>
25 public IntPtr Handle { get; }
26 /// <summary>
27 /// 窗口宽度
28 /// </summary>
29 public int Width { get; }
30 /// <summary>
31 /// 窗口高度
32 /// </summary>
33 public int Height { get; }
34 public int X { get; }
35 public int Y { get; }
36
37 public WindowInfo(string className_, string title_, IntPtr handle_, int width_, int height_, int x_, int y_)
38 {
39 ClassName = className_;
40 Title = title_;
41 Handle = handle_;
42 Width = width_;
43 Height = height_;
44 X = x_;
45 Y = y_;
46 }
47
48 public override string ToString()
49 {
50 return $"ClassName:{ClassName},Title:{Title},Handle:{Handle},Width:{Width},Height:{Height},X:{X},Y:{Y}";
51 }
52 public static WindowInfo Empty = new WindowInfo(string.Empty, string.Empty, IntPtr.Zero, 0, 0, 0, 0);
53 }
54}