A: README 更新,详述功能清单及说明 A: 添加图片资源(img.png, img_1.png, img_2.png, img_3.png) D: 移除 MainWindow.xaml.cs 中无用引用
36 lines
895 B
C#
36 lines
895 B
C#
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;
|
|
}
|
|
}
|