A: 添加任务栏窗口界面 (TaskbarWindow.xaml) 以显示实时网络流量;新增工具类 TaskbarHelper 获取任务栏位置
A: README 更新,详述功能清单及说明 A: 添加图片资源(img.png, img_1.png, img_2.png, img_3.png) D: 移除 MainWindow.xaml.cs 中无用引用
This commit is contained in:
1 parent
0feeb00fae
commit
42464d9408
9 files changed
+100
-11
No files matched your search
@@ -0,0 +1,35 @@
|
||||
namespace Shell.Utils;
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public static class TaskbarHelper
|
||||
{
|
||||
[DllImport("shell32.dll", SetLastError = true)]
|
||||
static extern UInt32 SHAppBarMessage(UInt32 dwMessage, ref APPBARDATA pData);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct APPBARDATA
|
||||
{
|
||||
public UInt32 cbSize;
|
||||
public IntPtr hWnd;
|
||||
public UInt32 uCallbackMessage;
|
||||
public UInt32 uEdge;
|
||||
public RECT rc;
|
||||
public Int32 lParam;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct RECT
|
||||
{
|
||||
public int left, top, right, bottom;
|
||||
}
|
||||
|
||||
public static RECT GetTaskbarPosition()
|
||||
{
|
||||
APPBARDATA data = new APPBARDATA();
|
||||
data.cbSize = (UInt32)Marshal.SizeOf(typeof(APPBARDATA));
|
||||
SHAppBarMessage(0x00000005, ref data); // ABM_GETTASKBARPOS
|
||||
return data.rc;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user