@@ -28,7 +28,7 @@
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<appSettings>
|
||||
<add key="Version" value="2.3.20" />
|
||||
<add key="Version" value="2.3.21" />
|
||||
<add key="GitHubUrl" value="https://github.com/Demo-Liu/GeekDesk" />
|
||||
<add key="GiteeUrl" value="https://gitee.com/demo_liu/GeekDesk/tree/master" />
|
||||
<add key="GitHubUpdateUrl" value="https://demo-liu.github.io/GeekDesk/Update.json" />
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</hc:UniformSpacingPanel>
|
||||
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
|
||||
<CheckBox Content="鼠标中间呼出" Checked="MouseMiddle_Changed" IsChecked="{Binding MouseMiddleShow}">
|
||||
<CheckBox Content="鼠标中间呼出" Checked="MouseMiddle_Changed" Unchecked="MouseMiddle_Changed" IsChecked="{Binding MouseMiddleShow}">
|
||||
<CheckBox.Background>
|
||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||
<GradientStop Color="#FF9EA3A6"/>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using GeekDesk.Constant;
|
||||
using GeekDesk.Control.Windows;
|
||||
using GeekDesk.Thread;
|
||||
using GeekDesk.Util;
|
||||
using GeekDesk.ViewModel;
|
||||
using HandyControl.Data;
|
||||
@@ -280,12 +281,14 @@ namespace GeekDesk.Control.UserControls.Config
|
||||
/// <param name="e"></param>
|
||||
private void MouseMiddle_Changed(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void HookListener_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
|
||||
if (appConfig.MouseMiddleShow)
|
||||
{
|
||||
Console.WriteLine(e.KeyChar);
|
||||
MouseHookThread.MiddleHook();
|
||||
} else
|
||||
{
|
||||
MouseHookThread.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<SolidColorBrush Opacity="0"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
||||
<EventSetter Event="MouseLeftButtonDown" Handler="MenuClick"/>
|
||||
<EventSetter Event="MouseRightButtonDown" Handler="MenuClick"/>
|
||||
<Style.Triggers>
|
||||
|
||||
@@ -28,11 +28,11 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
||||
if (appData.AppConfig.SelectedMenuIndex >= appData.MenuList.Count || appData.AppConfig.SelectedMenuIndex == -1)
|
||||
{
|
||||
appData.AppConfig.SelectedMenuIcons = appData.MenuList[0].IconList;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
appData.AppConfig.SelectedMenuIcons = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DelegateCommand<int[]> _swap;
|
||||
@@ -208,7 +208,8 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
||||
if (MenuListBox.SelectedIndex == -1)
|
||||
{
|
||||
appData.AppConfig.SelectedMenuIcons = appData.MenuList[appData.MenuList.Count - 1].IconList;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
appData.AppConfig.SelectedMenuIcons = appData.MenuList[MenuListBox.SelectedIndex].IconList;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<Setter Property="Source" Value="{Binding BitmapImage}"/>
|
||||
</Style>
|
||||
<Style x:Key="MyListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
||||
|
||||
@@ -5,25 +5,16 @@ using GeekDesk.Util;
|
||||
using GeekDesk.ViewModel;
|
||||
using HandyControl.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace GeekDesk.Control.UserControls.PannelCard
|
||||
{
|
||||
@@ -190,8 +181,11 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
||||
string path = (string)obj;
|
||||
|
||||
//string base64 = ImageUtil.FileImageToBase64(path, ImageFormat.Png);
|
||||
|
||||
string ext = System.IO.Path.GetExtension(path).ToLower();
|
||||
string ext = "";
|
||||
if (!ImageUtil.IsSystemItem(path))
|
||||
{
|
||||
ext = System.IO.Path.GetExtension(path).ToLower();
|
||||
}
|
||||
|
||||
if (".lnk".Equals(ext))
|
||||
{
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
AllowsTransparency="True"
|
||||
Background="#00FFFFFF" ShowInTaskbar="False"
|
||||
BorderThickness="0"
|
||||
Focusable="True"
|
||||
KeyDown="OnKeyDown"
|
||||
>
|
||||
|
||||
<Grid Margin="30">
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using GeekDesk.Constant;
|
||||
using GeekDesk.Control.UserControls;
|
||||
using GeekDesk.Control.UserControls.Config;
|
||||
using GeekDesk.Interface;
|
||||
using GeekDesk.Util;
|
||||
using GeekDesk.ViewModel;
|
||||
using HandyControl.Controls;
|
||||
@@ -15,7 +16,7 @@ namespace GeekDesk.Control.Windows
|
||||
/// <summary>
|
||||
/// ConfigDialog.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ConfigWindow
|
||||
public partial class ConfigWindow : IWindowCommon
|
||||
{
|
||||
private static readonly AboutControl about = new AboutControl();
|
||||
private static readonly ThemeControl theme = new ThemeControl();
|
||||
@@ -87,6 +88,15 @@ namespace GeekDesk.Control.Windows
|
||||
window = new ConfigWindow(appConfig, mainWindow);
|
||||
}
|
||||
window.Show();
|
||||
Keyboard.Focus(window);
|
||||
}
|
||||
|
||||
public void OnKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Escape)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent" ShowInTaskbar="False"
|
||||
BorderThickness="0"
|
||||
Focusable="True"
|
||||
KeyDown="OnKeyDown"
|
||||
>
|
||||
|
||||
<Window.Resources>
|
||||
@@ -39,7 +41,7 @@
|
||||
<DropShadowEffect BlurRadius="30" Direction="-90" Color="Gray"
|
||||
RenderingBias="Quality" ShadowDepth="2"/>
|
||||
</Grid.Effect>
|
||||
<Border MouseDown="DragMove" Style="{StaticResource BorderBG}">
|
||||
<Border MouseDown="DragMove" Style="{StaticResource BorderBG}" hc:Dialog.Token="IconUrlDialog">
|
||||
<!--<Border.Background>
|
||||
--><!--<SolidColorBrush Color="AliceBlue" Opacity="0.9"/>--><!--
|
||||
<LinearGradientBrush Opacity="0.97">
|
||||
@@ -47,6 +49,7 @@
|
||||
<GradientStop Color="#97D282" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>-->
|
||||
<hc:DialogContainer>
|
||||
<Grid MouseDown="DragMove">
|
||||
<TextBox x:Name="CheckSettingUrl" Visibility="Collapsed" Text="{Binding IsSettingUrl}" TextChanged="CheckSettingUrl_TextChanged"/>
|
||||
<hc:TabControl x:Name="MyTabControl"
|
||||
@@ -76,6 +79,7 @@
|
||||
<Button Content="自定义设置" Click="CustomButton_Click" IsEnabled="False" Name="CustomButton" Style="{StaticResource Btn1}" Margin="447,397.5,71,22.5"/>
|
||||
<Button Content="确定" Click="Confirm_Click" Style="{StaticResource Btn1}" Margin="534,397.5,20,22.5" />
|
||||
</Grid>
|
||||
</hc:DialogContainer>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using GeekDesk.Control.Other;
|
||||
using GeekDesk.Interface;
|
||||
using GeekDesk.Util;
|
||||
using GeekDesk.ViewModel;
|
||||
|
||||
@@ -17,7 +18,7 @@ namespace GeekDesk.Control.Windows
|
||||
/// <summary>
|
||||
/// IconfontWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class IconfontWindow : Window
|
||||
public partial class IconfontWindow : Window, IWindowCommon
|
||||
{
|
||||
private static AppConfig appConfig = MainWindow.appData.AppConfig;
|
||||
private static MenuInfo menuInfo;
|
||||
@@ -71,7 +72,7 @@ namespace GeekDesk.Control.Windows
|
||||
{
|
||||
LoadingEle.Visibility = Visibility.Visible;
|
||||
CustomIcon.Visibility = Visibility.Collapsed;
|
||||
HandyControl.Controls.Dialog.Show(new CustomIconUrlDialog(appConfig));
|
||||
HandyControl.Controls.Dialog.Show(new CustomIconUrlDialog(appConfig), "IconUrlDialog");
|
||||
} else
|
||||
{
|
||||
if (customIcons == null)
|
||||
@@ -132,6 +133,7 @@ namespace GeekDesk.Control.Windows
|
||||
window = new IconfontWindow(listInfo, menuInfo);
|
||||
}
|
||||
window.Show();
|
||||
Keyboard.Focus(window);
|
||||
ShowWindowFollowMouse.Show(window, MousePosition.LEFT_CENTER, 0, 0, false);
|
||||
}
|
||||
|
||||
@@ -172,6 +174,13 @@ namespace GeekDesk.Control.Windows
|
||||
}
|
||||
}
|
||||
|
||||
public void OnKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Escape)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public class IconfontViewModel : INotifyPropertyChanged
|
||||
{
|
||||
|
||||
@@ -11,8 +11,11 @@
|
||||
Height="450"
|
||||
Width="510"
|
||||
WindowStyle="None"
|
||||
Title=""
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent" ShowInTaskbar="False"
|
||||
Focusable="True"
|
||||
KeyDown="OnKeyDown"
|
||||
>
|
||||
<Window.Resources>
|
||||
<cvt:TodoTaskExecConvert x:Key="TodoTaskExecConvert"/>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using GeekDesk.Constant;
|
||||
using GeekDesk.Interface;
|
||||
using GeekDesk.Util;
|
||||
using GeekDesk.ViewModel;
|
||||
using HandyControl.Controls;
|
||||
@@ -22,7 +23,7 @@ namespace GeekDesk.Control.Windows
|
||||
/// <summary>
|
||||
/// BacklogInfoWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ToDoInfoWindow
|
||||
public partial class ToDoInfoWindow : IWindowCommon
|
||||
{
|
||||
|
||||
private static int windowType = -1;
|
||||
@@ -207,6 +208,7 @@ namespace GeekDesk.Control.Windows
|
||||
{
|
||||
window = new ToDoInfoWindow();
|
||||
window.Show();
|
||||
Keyboard.Focus(window);
|
||||
}
|
||||
window.Visibility = Visibility.Collapsed;
|
||||
windowType = NEW_TODO;
|
||||
@@ -222,6 +224,7 @@ namespace GeekDesk.Control.Windows
|
||||
}
|
||||
windowType = DETAIL_TODO;
|
||||
window2.Show();
|
||||
Keyboard.Focus(window2);
|
||||
}
|
||||
|
||||
private void ExecType_Checked(object sender, RoutedEventArgs e)
|
||||
@@ -239,5 +242,13 @@ namespace GeekDesk.Control.Windows
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Escape)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent" ShowInTaskbar="False"
|
||||
Focusable="True"
|
||||
KeyDown="OnKeyDown"
|
||||
>
|
||||
|
||||
<Grid Margin="50">
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using GeekDesk.Control.UserControls.Backlog;
|
||||
using GeekDesk.Interface;
|
||||
using GeekDesk.ViewModel;
|
||||
using HandyControl.Controls;
|
||||
using System;
|
||||
@@ -21,7 +22,7 @@ namespace GeekDesk.Control.Windows
|
||||
/// <summary>
|
||||
/// BacklogWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ToDoWindow
|
||||
public partial class ToDoWindow : IWindowCommon
|
||||
{
|
||||
private static TodoControl backlog = new TodoControl();
|
||||
private AppData appData = MainWindow.appData;
|
||||
@@ -94,8 +95,15 @@ namespace GeekDesk.Control.Windows
|
||||
window = new ToDoWindow();
|
||||
}
|
||||
window.Show();
|
||||
Keyboard.Focus(window);
|
||||
}
|
||||
|
||||
|
||||
public void OnKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Escape)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,10 @@
|
||||
Height="460" Width="610"
|
||||
WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent" ShowInTaskbar="False">
|
||||
Title=""
|
||||
Background="Transparent" ShowInTaskbar="False"
|
||||
Focusable="True"
|
||||
KeyDown="OnKeyDown">
|
||||
<Grid Margin="20">
|
||||
<Grid.Effect>
|
||||
<DropShadowEffect BlurRadius="30" Direction="-90" Color="Gray"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using GeekDesk.Constant;
|
||||
using GeekDesk.Interface;
|
||||
using GeekDesk.Util;
|
||||
using GeekDesk.ViewModel;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -23,7 +24,7 @@ namespace GeekDesk.Control.Windows
|
||||
/// <summary>
|
||||
/// UpdateWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class UpdateWindow : Window
|
||||
public partial class UpdateWindow : Window, IWindowCommon
|
||||
{
|
||||
private static AppConfig appConfig = MainWindow.appData.AppConfig;
|
||||
private static string githubUrl = "";
|
||||
@@ -103,6 +104,15 @@ namespace GeekDesk.Control.Windows
|
||||
window = new UpdateWindow(jo);
|
||||
}
|
||||
window.Show();
|
||||
Keyboard.Focus(window);
|
||||
}
|
||||
|
||||
public void OnKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Escape)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,6 +189,7 @@
|
||||
<Compile Include="DraggAnimatedPanel\DraggAnimatedPanel.cs" />
|
||||
<Compile Include="DraggAnimatedPanel\DraggAnimatedPanel.Drag.cs" />
|
||||
<Compile Include="Converts\HideTypeConvert.cs" />
|
||||
<Compile Include="Interface\IWindowCommon.cs" />
|
||||
<Compile Include="Task\ToDoTask.cs" />
|
||||
<Compile Include="Thread\MouseHookThread.cs" />
|
||||
<Compile Include="Thread\DispatcherBuild.cs" />
|
||||
|
||||
15
Interface/IWindowCommon.cs
Normal file
15
Interface/IWindowCommon.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace GeekDesk.Interface
|
||||
{
|
||||
public interface IWindowCommon
|
||||
{
|
||||
void OnKeyDown(object sender, KeyEventArgs e);
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
xmlns:cvt="clr-namespace:GeekDesk.Converts"
|
||||
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
|
||||
x:Name="window"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:AppData}"
|
||||
Title="GeekDesk"
|
||||
d:DesignHeight="500" d:DesignWidth="700"
|
||||
WindowStyle="None"
|
||||
@@ -19,6 +19,8 @@
|
||||
Opacity="0"
|
||||
Deactivated="Window_Deactivated"
|
||||
SizeChanged="Window_SizeChanged"
|
||||
KeyDown="OnKeyDown"
|
||||
Focusable="True"
|
||||
>
|
||||
<WindowChrome.WindowChrome>
|
||||
<WindowChrome CaptionHeight="0" ResizeBorderThickness="15"/>
|
||||
@@ -92,6 +94,7 @@
|
||||
Click="ConfigButtonClick"
|
||||
Initialized="SettingButton_Initialized"
|
||||
x:Name="SettingButton"
|
||||
FocusVisualStyle="{x:Null}"
|
||||
>
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu x:Name="SettingMenus" Width="130">
|
||||
@@ -107,6 +110,7 @@
|
||||
hc:IconElement.Width="18"
|
||||
HorizontalAlignment="Right"
|
||||
Click="CloseButtonClick"
|
||||
FocusVisualStyle="{x:Null}"
|
||||
/>
|
||||
</hc:UniformSpacingPanel>
|
||||
|
||||
@@ -114,6 +118,7 @@
|
||||
|
||||
|
||||
<uc:LeftCardControl Grid.Row="1" Grid.Column="0"/>
|
||||
|
||||
<!--分割线-->
|
||||
<GridSplitter Opacity="0" Grid.Row="1" Grid.Column="0" Width="1" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
|
||||
|
||||
@@ -124,7 +129,7 @@
|
||||
<hc:NotifyIcon.ContextMenu>
|
||||
<ContextMenu Width="130">
|
||||
<MenuItem Header="打开面板" Click="ShowApp"/>
|
||||
<MenuItem Header="关闭托盘图标" Click="CloseBarIcon"/>
|
||||
<MenuItem Header="关闭图标" Click="CloseBarIcon"/>
|
||||
<MenuItem Header="待办" Click="BacklogMenuClick"/>
|
||||
<MenuItem Header="程序目录" Click="OpenThisDir"/>
|
||||
<MenuItem Header="设置" Click="ConfigApp"/>
|
||||
|
||||
@@ -3,6 +3,7 @@ using GeekDesk.Constant;
|
||||
using GeekDesk.Control;
|
||||
using GeekDesk.Control.UserControls.Config;
|
||||
using GeekDesk.Control.Windows;
|
||||
using GeekDesk.Interface;
|
||||
using GeekDesk.Task;
|
||||
using GeekDesk.Thread;
|
||||
using GeekDesk.Util;
|
||||
@@ -29,13 +30,10 @@ namespace GeekDesk
|
||||
/// MainWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
///
|
||||
public partial class MainWindow : Window
|
||||
public partial class MainWindow : Window, IWindowCommon
|
||||
{
|
||||
|
||||
//public IKeyboardMouseEvents m_GlobalHook = Hook.GlobalEvents();
|
||||
|
||||
public static AppData appData = CommonCode.GetAppDataByFile();
|
||||
//public static ToDoInfoWindow toDoInfoWindow = (ToDoInfoWindow)ToDoInfoWindow.GetThis();
|
||||
public static ToDoInfoWindow toDoInfoWindow;
|
||||
public static int hotKeyId = -1;
|
||||
public static int toDoHotKeyId = -1;
|
||||
@@ -95,6 +93,7 @@ namespace GeekDesk
|
||||
ShowApp();
|
||||
}
|
||||
|
||||
//给任务栏图标一个名字
|
||||
BarIcon.Text = Constants.MY_NAME;
|
||||
|
||||
//注册热键
|
||||
@@ -108,36 +107,15 @@ namespace GeekDesk
|
||||
}
|
||||
|
||||
//注册鼠标中键监听事件
|
||||
//m_GlobalHook.MouseUpExt += M_GlobalHook_MouseUpExt;
|
||||
if (appData.AppConfig.MouseMiddleShow)
|
||||
{
|
||||
MouseHookThread.MiddleHook();
|
||||
}
|
||||
|
||||
//更新线程开启 检测更新
|
||||
UpdateThread.Update();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标中键呼出
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
//private void M_GlobalHook_MouseUpExt(object sender, System.Windows.Forms.MouseEventArgs e)
|
||||
//{
|
||||
// if (appData.AppConfig.MouseMiddleShow && e.Button == System.Windows.Forms.MouseButtons.Middle)
|
||||
// {
|
||||
// if (MotionControl.hotkeyFinished)
|
||||
// {
|
||||
// if (mainWindow.Visibility == Visibility.Collapsed || mainWindow.Opacity == 0)
|
||||
// {
|
||||
// ShowApp();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// HideApp();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 注册当前窗口的热键
|
||||
/// </summary>
|
||||
@@ -283,10 +261,6 @@ namespace GeekDesk
|
||||
/// <param name="e"></param>
|
||||
private void DragMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
//if (e.LeftButton == MouseButtonState.Pressed)
|
||||
//{
|
||||
// this.DragMove();
|
||||
//}
|
||||
|
||||
if (e.LeftButton == MouseButtonState.Pressed)
|
||||
{
|
||||
@@ -303,7 +277,6 @@ namespace GeekDesk
|
||||
(When clicking the drag area, make the window follow) */
|
||||
DragMove();
|
||||
|
||||
|
||||
if (this.ResizeMode != windowMode)
|
||||
{
|
||||
this.ResizeMode = windowMode;
|
||||
@@ -426,6 +399,10 @@ namespace GeekDesk
|
||||
/// <param name="e"></param>
|
||||
private void ExitApp(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (appData.AppConfig.MouseMiddleShow)
|
||||
{
|
||||
MouseHookThread.Dispose();
|
||||
}
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
|
||||
@@ -506,10 +483,13 @@ namespace GeekDesk
|
||||
/// <param name="e"></param>
|
||||
private void ReStartApp(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MouseHookThread.Dispose();
|
||||
|
||||
Process p = new Process();
|
||||
p.StartInfo.FileName = Constants.APP_DIR + Constants.MY_NAME + ".exe";
|
||||
p.StartInfo.WorkingDirectory = Constants.APP_DIR;
|
||||
p.Start();
|
||||
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
|
||||
@@ -522,6 +502,15 @@ namespace GeekDesk
|
||||
{
|
||||
appData.AppConfig.ShowBarIcon = false;
|
||||
}
|
||||
|
||||
|
||||
public void OnKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Escape)
|
||||
{
|
||||
HideApp();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -49,5 +49,5 @@ using System.Windows;
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.3.2.0")]
|
||||
[assembly: AssemblyFileVersion("2.3.2.0")]
|
||||
[assembly: AssemblyVersion("2.3.2.1")]
|
||||
[assembly: AssemblyFileVersion("2.3.2.1")]
|
||||
|
||||
@@ -15,19 +15,28 @@ namespace GeekDesk.Thread
|
||||
public class MouseHookThread
|
||||
{
|
||||
private static AppConfig appConfig = MainWindow.appData.AppConfig;
|
||||
public static IKeyboardMouseEvents m_GlobalHook = Hook.GlobalEvents();
|
||||
private static IKeyboardMouseEvents m_GlobalHook = Hook.GlobalEvents();
|
||||
private static Dispatcher dispatcher;
|
||||
|
||||
|
||||
|
||||
public static void MiddleHook()
|
||||
{
|
||||
//使用dispatcher来单独监听UI线程 防止程序卡顿
|
||||
Dispatcher dispatcher = DispatcherBuild.Build();
|
||||
dispatcher = DispatcherBuild.Build();
|
||||
dispatcher.Invoke((Action)(() =>
|
||||
{
|
||||
m_GlobalHook.MouseDownExt += M_GlobalHook_MouseDownExt;
|
||||
}));
|
||||
}
|
||||
|
||||
public static void Dispose()
|
||||
{
|
||||
m_GlobalHook.MouseDownExt -= M_GlobalHook_MouseDownExt;
|
||||
m_GlobalHook.Dispose();
|
||||
dispatcher.InvokeShutdown();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标中键呼出
|
||||
/// </summary>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"title": "<22>汾<EFBFBD><E6B1BE><EFBFBD><EFBFBD>",
|
||||
"subTitle": "V2.3.20 <20><>ʽ<EFBFBD><CABD>",
|
||||
"title": "GeekDesk<EFBFBD>汾<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"subTitle": "V2.3.21",
|
||||
"msgTitle": "<22><><EFBFBD>θ<EFBFBD><CEB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"msg": "['һ<EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><EFBFBD><DEB8><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>bug<75><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2>ֹ<EFBFBD><D6B9><EFBFBD>','<27><EFBFBD><DEB8><EFBFBD><DEB7>IJ˵<C4B2>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>bug','<27><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״bug','<27><EFBFBD><DEB8>ȼ<EFBFBD><C8BC><EFBFBD>֧<EFBFBD><D6A7>Alt<6C><74>bug','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD>깦<EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>star<EFBFBD><EFBFBD>']",
|
||||
"msg": "['<EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD>ڿ<EFBFBD>Esc<EFBFBD>˳<EFBFBD>','<27><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>BUG,<2C><><EFBFBD><EFBFBD>û<EFBFBD><C3BB>D<EFBFBD>̵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ','<27><EFBFBD><DEB8><EFBFBD>֪<EFBFBD><D6AA><EFBFBD><EFBFBD>']",
|
||||
"githubUrl": "https://github.com/Demo-Liu/GeekDesk/releases",
|
||||
"giteeUrl": "https://gitee.com/demo_liu/GeekDesk/releases",
|
||||
"version": "2.3.20"
|
||||
"version": "2.3.21"
|
||||
}
|
||||
@@ -74,7 +74,6 @@ namespace GeekDesk.Util
|
||||
myEncoderParameters.Param[0] = myEncoderParameter;
|
||||
|
||||
bmp.Save(strm, myImageCodecInfo, myEncoderParameters);
|
||||
bmp.Save("d:\\test.png", myImageCodecInfo, myEncoderParameters);
|
||||
BitmapImage bmpImage = new BitmapImage();
|
||||
bmpImage.BeginInit();
|
||||
strm.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
@@ -13,6 +14,7 @@ namespace GeekDesk.Util
|
||||
{
|
||||
class ImageUtil
|
||||
{
|
||||
private static readonly string SYSTEM_ITEM = "::{.*}";
|
||||
|
||||
/// <summary>
|
||||
/// 图片数组转 BitmapImage
|
||||
@@ -84,7 +86,7 @@ namespace GeekDesk.Util
|
||||
/// <returns></returns>
|
||||
public static BitmapImage GetBitmapIconByPath(string filePath)
|
||||
{
|
||||
if (File.Exists(filePath))
|
||||
if (File.Exists(filePath) || IsSystemItem(filePath))
|
||||
{
|
||||
if (IsImage(filePath)) {
|
||||
//图片
|
||||
@@ -334,5 +336,15 @@ namespace GeekDesk.Util
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 判断是否为系统项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool IsSystemItem(string path)
|
||||
{
|
||||
return Regex.IsMatch(path, SYSTEM_ITEM);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user