RyLiveTools/Source/Content/CustomWindow.cs
如果当时 0ec1400de9 ### 2024-04-12更新
------
####  V1.0.2404.1201
- 新增支持手动运行规则。
- 规则播放时间间隔不再针对全局声效,而只针对当前规则声效。
- 修复规则中播放文件夹可能导致无法执行的BUG。
- 修复规则不勾选礼物和点赞,则无法执行的BUG。
2024-04-13 10:13:30 +08:00

34 lines
1010 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Interop;
using System.Windows;
namespace LiveTools
{
public class CustomWindow : Window
{
public CustomWindow()
{
WindowStyle = WindowStyle.None;
}
protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
WindowInteropHelper helper = new WindowInteropHelper(this);
SetWindowLong(helper.Handle, GWL_STYLE, GetWindowLong(helper.Handle, GWL_STYLE) & ~WS_SYSMENU);
}
internal const int GWL_STYLE = -16;
internal const int WS_SYSMENU = 0x80000;
[DllImport("user32.dll")]
internal static extern int GetWindowLong(IntPtr hwnd, int index);
[DllImport("user32.dll")]
internal static extern int SetWindowLong(IntPtr hwnd, int index, int newStyle);
}
}