🔀 禁用窗口最大化
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
|
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
|
||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
|
ResizeMode="NoResize"
|
||||||
AllowsTransparency="True"
|
AllowsTransparency="True"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
KeyDown="OnKeyDown"
|
KeyDown="OnKeyDown"
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
AllowsTransparency="True"
|
AllowsTransparency="True"
|
||||||
Background="Black"
|
Background="Black"
|
||||||
|
ResizeMode="NoResize"
|
||||||
PreviewMouseMove="Window_PreviewMouseMove"
|
PreviewMouseMove="Window_PreviewMouseMove"
|
||||||
MouseLeftButtonDown="Window_MouseLeftButtonDown"
|
MouseLeftButtonDown="Window_MouseLeftButtonDown"
|
||||||
MouseRightButtonDown="Window_MouseRightButtonDown"
|
MouseRightButtonDown="Window_MouseRightButtonDown"
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
Width="510"
|
Width="510"
|
||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
Title=""
|
Title=""
|
||||||
|
ResizeMode="NoResize"
|
||||||
AllowsTransparency="True"
|
AllowsTransparency="True"
|
||||||
Background="Transparent" ShowInTaskbar="False"
|
Background="Transparent" ShowInTaskbar="False"
|
||||||
Focusable="True"
|
Focusable="True"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
Height="550"
|
Height="550"
|
||||||
Width="1000"
|
Width="1000"
|
||||||
Title="Task"
|
Title="Task"
|
||||||
|
ResizeMode="NoResize"
|
||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
AllowsTransparency="True"
|
AllowsTransparency="True"
|
||||||
Background="Transparent" ShowInTaskbar="False"
|
Background="Transparent" ShowInTaskbar="False"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
AllowsTransparency="True"
|
AllowsTransparency="True"
|
||||||
Title=""
|
Title=""
|
||||||
|
ResizeMode="NoResize"
|
||||||
Background="Transparent" ShowInTaskbar="False"
|
Background="Transparent" ShowInTaskbar="False"
|
||||||
Focusable="True"
|
Focusable="True"
|
||||||
KeyDown="OnKeyDown">
|
KeyDown="OnKeyDown">
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
MouseEnter="MainWindow_MouseEnter"
|
MouseEnter="MainWindow_MouseEnter"
|
||||||
GotFocus="Window_GotFocus"
|
GotFocus="Window_GotFocus"
|
||||||
Loaded="Window_Loaded"
|
Loaded="Window_Loaded"
|
||||||
|
SourceInitialized="Window_SourceInitialized"
|
||||||
Topmost="{Binding AppConfig.AlwaysTopmost}"
|
Topmost="{Binding AppConfig.AlwaysTopmost}"
|
||||||
>
|
>
|
||||||
|
|
||||||
@@ -42,7 +43,7 @@
|
|||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
<WindowChrome.WindowChrome>
|
<WindowChrome.WindowChrome>
|
||||||
<WindowChrome CaptionHeight="0" CornerRadius="30" ResizeBorderThickness="15"/>
|
<WindowChrome CaptionHeight="0" CornerRadius="30" ResizeBorderThickness="23"/>
|
||||||
</WindowChrome.WindowChrome>
|
</WindowChrome.WindowChrome>
|
||||||
|
|
||||||
<Window.InputBindings>
|
<Window.InputBindings>
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ namespace GeekDesk
|
|||||||
public static int colorPickerHotKeyId = -1;
|
public static int colorPickerHotKeyId = -1;
|
||||||
public static MainWindow mainWindow;
|
public static MainWindow mainWindow;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static bool dataFileExist = true;
|
private static bool dataFileExist = true;
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
@@ -57,6 +59,7 @@ namespace GeekDesk
|
|||||||
//加载数据
|
//加载数据
|
||||||
LoadData();
|
LoadData();
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
//用于其他类访问
|
//用于其他类访问
|
||||||
mainWindow = this;
|
mainWindow = this;
|
||||||
|
|
||||||
@@ -72,10 +75,13 @@ namespace GeekDesk
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Window_SourceInitialized(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//禁用窗口最大化
|
||||||
|
WindowUtil.DisableMaxWindow(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 搜索快捷键按下
|
/// 搜索快捷键按下
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"title": "GeekDesk版本更新",
|
"title": "GeekDesk版本更新",
|
||||||
"subTitle": "V2.5.14",
|
"subTitle": "V2.5.14",
|
||||||
"msgTitle": "本次更新内容如下",
|
"msgTitle": "本次更新内容如下",
|
||||||
"msg": "['好久不见, 别来无恙, 辞职回老家了, 突然换了新环境有点不适应, 目前还处于工作中的迷茫期, 祝我们大家都前程似锦吧', '另外GeekDesk准备冲击一下Gitee GVP, 希望大家能给我点一下码云(Gitee)和GitHub的star❤❤❤', '之后我会抽时间编写一下开发者文档, 方便大家更清楚的了解项目结构, 从而有更多的人参与进来开发(一直没有编写是因为太懒了), 不多说了, 看下这次更新内容吧', '集成Everything搜索,设置-->其它-->勾选Everything插件开启', '增加了关联文件夹功能, 右键点击左侧栏-->新建关联菜单', '增加强制置顶开关,设置-->显示设置-->勾选/取消 置于顶层', '右侧栏图标列表增加了自适应列宽, 不会出现图标显示一半的情况了', '简单添加了新手引导提示', '加密菜单bug修复 By @1062406901', '多显示器拾色器bug修复 By @1062406901', '拖动图标到菜单的异常修复 By @Hsxxxxxx', '优化部分UI', '其它bug修复及功能优化']",
|
"msg": "['好久不见, 别来无恙, 辞职回老家了, 突然换了新环境有点不适应, 目前还处于工作中的迷茫期, 祝我们大家全都前程似锦', 'GeekDesk准备冲击一下Gitee GVP, 希望大家能给我点一下码云(Gitee)和GitHub的star❤❤❤', '之后我会抽时间编写一下开发者文档, 方便大家更清楚的了解项目结构, 从而有更多的人参与进来开发(一直没有编写是因为太懒了), 不多说了, 看下这次更新内容吧', '集成Everything搜索,设置-->其它-->勾选Everything插件开启', '增加了关联文件夹功能, 右键点击左侧栏-->新建关联菜单', '增加强制置顶开关,设置-->显示设置-->勾选/取消 置于顶层', '右侧栏图标列表增加了自适应列宽, 不会出现图标显示一半的情况了', '简单添加了新手引导提示', '加密菜单bug修复 By @1062406901', '多显示器拾色器bug修复 By @1062406901', '拖动图标到菜单的异常修复 By @Hsxxxxxx', '优化部分UI', '其它bug修复及功能优化']",
|
||||||
"githubUrl": "https://github.com/BookerLiu/GeekDesk/releases",
|
"githubUrl": "https://github.com/BookerLiu/GeekDesk/releases",
|
||||||
"giteeUrl": "https://gitee.com/BookerLiu/GeekDesk/releases",
|
"giteeUrl": "https://gitee.com/BookerLiu/GeekDesk/releases",
|
||||||
"statisticUrl": "http://43.138.23.39:8989/bookerService/geekDeskController/userCountStatistic",
|
"statisticUrl": "http://43.138.23.39:8989/bookerService/geekDeskController/userCountStatistic",
|
||||||
|
|||||||
@@ -63,6 +63,21 @@ namespace GeekDesk.Util
|
|||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count);
|
static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count);
|
||||||
|
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
|
||||||
|
|
||||||
|
|
||||||
|
private const int GWL_STYLE = -16;
|
||||||
|
private const int WS_MAXIMIZEBOX = 0x10000;
|
||||||
|
public static void DisableMaxWindow(Window window)
|
||||||
|
{
|
||||||
|
var hwnd = new WindowInteropHelper(window).Handle;
|
||||||
|
var value = GetWindowLong(hwnd, GWL_STYLE);
|
||||||
|
SetWindowLong(hwnd, GWL_STYLE, (int)(value & ~WS_MAXIMIZEBOX));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void SetOwner(Window window, Window parentWindow)
|
public static void SetOwner(Window window, Window parentWindow)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user