diff --git a/README.md b/README.md
index 1d84448c..b644e505 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,7 @@
+
## Backers
@@ -51,6 +52,7 @@
+
## Special thanks to
@@ -96,6 +98,18 @@ Step 4:enjoy coding
## Latest examples
+### GlowWindow
+
+
+
+### FlowDocumentScrollViewerStyle
+
+
+
+### PinBox
+
+
+
### Effects

@@ -104,6 +118,8 @@ Step 4:enjoy coding

+## History publication
+
### Drawer

@@ -116,8 +132,6 @@ Step 4:enjoy coding

-## History publication
-
### GeometryAnimation

diff --git a/doc/source/handycontrol/attach/panelElement/index.md b/doc/source/handycontrol/attach/panelElement/index.md
index ca12ad62..9267ff42 100644
--- a/doc/source/handycontrol/attach/panelElement/index.md
+++ b/doc/source/handycontrol/attach/panelElement/index.md
@@ -1,5 +1,19 @@
---
-title: 建设中
+title: PanelElement 面板元素
---
-建设中
\ No newline at end of file
+# 属性
+
+| 名称 | 用途 |
+|-|-|
+| FluidMoveBehavior | 设置面板的流体移动方式 |
+
+# 使用案例
+
+## FluidMoveBehavior 设置面板的流体移动方式
+
+```xml
+
+```
+
+当向面板容器中添加或移除元素时,就可以看到流体移动的动画效果。
\ No newline at end of file
diff --git a/doc/source/handycontrol/attach/rectangleAttach/index.md b/doc/source/handycontrol/attach/rectangleAttach/index.md
new file mode 100644
index 00000000..4999a04b
--- /dev/null
+++ b/doc/source/handycontrol/attach/rectangleAttach/index.md
@@ -0,0 +1,19 @@
+---
+title: RectangleAttach Rectangle专用
+---
+
+# 属性
+
+| 名称 | 用途 |
+|-|-|
+| CornerRadius | 设置Rectangle圆角值 |
+
+# 使用案例
+
+## CornerRadius 设置Rectangle圆角值
+
+```xml
+
+```
+
+
\ No newline at end of file
diff --git a/doc/source/handycontrol/attach/textBlockAttach/index.md b/doc/source/handycontrol/attach/textBlockAttach/index.md
index 7abd42f4..bf355d3f 100644
--- a/doc/source/handycontrol/attach/textBlockAttach/index.md
+++ b/doc/source/handycontrol/attach/textBlockAttach/index.md
@@ -1,3 +1,21 @@
---
-title: TextBlockAttach
+title: TextBlockAttach 文本块专用
---
+
+# 属性
+
+| 名称 | 用途 |
+|-|-|
+| AutoTooltip | 设置是否自动显示工具提示 |
+
+# 使用案例
+
+## AutoTooltip 设置是否自动显示工具提示
+
+```xml
+
+
+
+```
+
+
\ No newline at end of file
diff --git a/doc/source/handycontrol/basic_xaml/converters/index.md b/doc/source/handycontrol/basic_xaml/converters/index.md
index 33f62bde..6d256584 100644
--- a/doc/source/handycontrol/basic_xaml/converters/index.md
+++ b/doc/source/handycontrol/basic_xaml/converters/index.md
@@ -50,6 +50,14 @@ title: 转换器
该转换器需要提供一个字符串作为参数,该字符串的一般形式为:`[0/1],[0/1],[0/1],[0/1]`,4个以逗号分隔的值分别对应`CornerRadius`的`Left`、`Top`,`Right`,`Bottom`属性,当值为1则返回对应属性的值,否则返回0。
+# Double2GridLengthConverter
+
+该转换器会将`double`值转换为`GridLength`。
+
+# DoubleMinConverter(内部使用)
+
+可以向该转换器提供一个字符串作为最小值(如果不提供,则最小值默认为0),当传入的值小于最小值时,返回最小值,否则返回传入的值。
+
# Int2StrConverter
该转换器需要提供一个字符串作为参数,该字符串的一般形式为:`[字符串0];[字符串1];...[字符串n]`,转换器会将一个整型的值作为索引,来获取指定位置的字符串并返回。
diff --git a/doc/source/handycontrol/basic_xaml/sizes/index.md b/doc/source/handycontrol/basic_xaml/sizes/index.md
index e8b38ee2..2fbb6e0f 100644
--- a/doc/source/handycontrol/basic_xaml/sizes/index.md
+++ b/doc/source/handycontrol/basic_xaml/sizes/index.md
@@ -5,7 +5,7 @@ title: 尺寸
| 名称 | 类型 | 值 | 描述 |
|-|-|
| DefaultControlHeight | System.Double | 30 | 默认控件高度 |
-| DefaultControlPadding | System.Windows.Thickness | 12,6 | 默认控件内边距 |
+| DefaultControlPadding | System.Windows.Thickness | 10,6 | 默认控件内边距 |
| DefaultInputPadding | System.Windows.Thickness | 8,6 |默认输入控件内边距 |
| DefaultCornerRadius | System.Windows.CornerRadius | 4 | 默认圆角 |
diff --git a/doc/source/handycontrol/extend_controls/numericUpDown/index.md b/doc/source/handycontrol/extend_controls/numericUpDown/index.md
index ca12ad62..ad0773ae 100644
--- a/doc/source/handycontrol/extend_controls/numericUpDown/index.md
+++ b/doc/source/handycontrol/extend_controls/numericUpDown/index.md
@@ -1,5 +1,105 @@
---
-title: 建设中
+title: NumericUpDown 数值选择控件
---
-建设中
\ No newline at end of file
+NumericUpDown 控件看起来像一对用户可以单击来调整值的箭头按钮和TextBox的组合,该控件显示并设置数值(Value)。 用户可以通过单击向上和向下箭头,或通过在控件的TextBox部分中键入一个数字来改变Value。
+
+``` CS
+[TemplatePart(Name = ElementTextBox, Type = typeof(DatePickerTextBox))]
+public class DatePicker : System.Windows.Controls.DatePicker, IDataInput
+```
+
+# 创建NumericUpDown并设置Value
+
+``` XML
+
+```
+
+``` CS
+var numericUpDown = new NumericUpDown();
+numericUpDown.Value = 100;
+```
+
+生成的NumericUpDown如下图所示:
+
+
+
+
+# 设置DecimalPlaces
+
+如果需要改变Value显示的小数位数,可以改变DecimalPlaces。DecimalPlaces是一个 **int?** 类型,当它为null时不限制显示的小数位数,否则显示的小数位数为DecimalPlaces的Value。
+
+``` XML
+
+```
+
+``` CS
+numericUpDown.Value = 10.12345;
+numericUpDown.DecimalPlaces = 2;
+```
+
+
+
+# 设置Increment
+
+可以通设置Increment改变单击一下按钮时增加或减少的数量。
+
+``` XML
+
+```
+
+``` CS
+numericUpDown.Increment = 10;
+```
+
+# 设置上限和下限
+
+可以通设置Maximum和Minimum限制Value的上限和下限。
+
+``` XML
+
+```
+
+``` CS
+numericUpDown.Minimum = 10;
+numericUpDown.Maximum = 1000;
+```
+
+# 设置标题和占位符文本
+
+你可以将 Header(标题)和 Placeholder(占位符)添加到NumericUpDown,以向用户指示其用途。要使用这两个附加属性,需要先应用 **NumericUpDownPlus** 样式。
+
+``` XML
+
+```
+
+
+
+# 属性
+
+| 属性 | 描述 |
+| ---------------- | ------------------ |
+| Value | 获取或设置当前值 |
+| Maximum | 获取或设置最大允许值 |
+| Minimum | 获取或设置最小允许值 |
+| Increment | 获取或设置单击向上或向下按钮时,数字显示框(也称作 up-down 控件)递增或递减的值。 |
+| DecimalPlaces |获取或设置NumericUpDown中要显示的十进制位数。 此属性不会影响 Value 属性。 |
+| VerifyFunc | 获取或设置数据验证委托 |
+| IsError | 获取或设置数据是否错误 |
+| ErrorStr | 获取或设置错误提示 |
+| TextType | 获取或设置文本类型 |
+| ShowClearButton | 获取或设置是否显示清除按钮 |
+
+# 方法
+
+| 方法 | 描述 |
+| ---------------- | ------------------ |
+| VerifyData() | 验证数据 |
+
+# 事件
+
+| 事件 | 描述 |
+| ---------------- | ------------------ |
+| ValueChanged | 在以某种方式更改 Value 属性后发生。 |
diff --git a/doc/source/handycontrol/extend_controls/timePicker/index.md b/doc/source/handycontrol/extend_controls/timePicker/index.md
index 9012c589..5c65e872 100644
--- a/doc/source/handycontrol/extend_controls/timePicker/index.md
+++ b/doc/source/handycontrol/extend_controls/timePicker/index.md
@@ -12,7 +12,7 @@ TimePicker 控件允许用户通过在文本框中键入时间或使用下拉的
public class TimePicker : Control, IDataInput
```
-# 创建DatePicker
+# 创建TimePicker
``` XML
@@ -32,7 +32,7 @@ var timePicker = new TimePicker();
可以通过文本框输入时间,或者点击文本框右边的按钮打开下拉的时钟控件选择时间。
-
+
也可以在XAML钟或代码中这样设置日期。
@@ -56,7 +56,7 @@ timePicker.SelectedTime = DateTime.Now;
```
-
+
# 设置标题和占位符文本
diff --git a/doc/source/handycontrol/native_controls/radioButton/index.md b/doc/source/handycontrol/native_controls/radioButton/index.md
index ca12ad62..0773732f 100644
--- a/doc/source/handycontrol/native_controls/radioButton/index.md
+++ b/doc/source/handycontrol/native_controls/radioButton/index.md
@@ -1,5 +1,115 @@
---
-title: 建设中
+title: RadioButton 单选按钮
---
-建设中
\ No newline at end of file
+# RadioButtonBaseStyle
+
+单选按钮默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
+
+案例:
+
+```xml
+
+
+
+
+
+
+```
+
+效果:
+
+
+
+# RadioButtonIcon:RadioButtonBaseStyle
+
+带图标样式,可只显示图标也可图文显示
+
+案例:
+
+```xml
+
+
+
+
+
+
+```
+
+效果:
+
+
+
+# RadioGroupItemBaseStyle
+
+`ButtonGroup`控件中的子集`RadioButton`样式基类,不建议直接使用,常作为`ButtonGroup`中`Item`样式基类,同时与`ButtonGroup`控件配套使用
+
+案例:
+
+```xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+效果:
+
+
+
+# RadioGroup关联样式
+
+| 样式Key | 用途 | 基类样式 |
+| ----------------------------- | ------------------------------------ | ----------------------- |
+| RadioGroupItemDefault | RadioGroupItem默认样式 | RadioGroupItemBaseStyle |
+| RadioGroupItemHorizontalFirst | RadioGroupItem水平头样式(从左至右) | RadioGroupItemBaseStyle |
+| RadioGroupItemHorizontalLast | RadioGroupItem水平尾样式(从左至右) | RadioGroupItemBaseStyle |
+| RadioGroupItemSingle | RadioGroupItem单项样式 | RadioGroupItemBaseStyle |
+| RadioGroupItemVerticalFirst | RadioGroupItem垂直头样式(从上至下) | RadioGroupItemBaseStyle |
+| RadioGroupItemVerticalLast | RadioGroupItem垂直尾样式(从上至下) | RadioGroupItemBaseStyle |
+
+案例:
+
+单个`RadioButton`样式:
+
+```xml
+
+```
+
+效果:
+
+
+
+多个`RadioButton`垂直样式:
+
+```xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+效果:
+
+
\ No newline at end of file
diff --git a/doc/source/handycontrol/native_controls/richTextBox/index.md b/doc/source/handycontrol/native_controls/richTextBox/index.md
index ca12ad62..3e33e5e1 100644
--- a/doc/source/handycontrol/native_controls/richTextBox/index.md
+++ b/doc/source/handycontrol/native_controls/richTextBox/index.md
@@ -1,5 +1,21 @@
---
-title: 建设中
+title: RichTextBox 富文本框
---
-建设中
\ No newline at end of file
+# TextBoxBaseBaseStyle
+
+基础文本控件默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
+
+# RichTextBoxBaseStyle : TextBoxBaseBaseStyle
+
+富文本框默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
+
+案例:
+
+```xml
+
+```
+
+效果:
+
+
\ No newline at end of file
diff --git a/doc/source/handycontrol/native_controls/scrollViewer/index.md b/doc/source/handycontrol/native_controls/scrollViewer/index.md
index ca12ad62..8d39838d 100644
--- a/doc/source/handycontrol/native_controls/scrollViewer/index.md
+++ b/doc/source/handycontrol/native_controls/scrollViewer/index.md
@@ -1,5 +1,42 @@
---
-title: 建设中
+title: ScrollViewer 滚动视图
---
-建设中
\ No newline at end of file
+# ScrollViewerNativeBaseStyle
+
+原生滚动视图默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
+
+案例:
+
+```xml
+
+
+
+
+
+```
+
+效果:
+
+
+
+# ScrollViewerUpDown
+
+显示上下按钮的滚动视图样式
+
+案例:
+
+```xml
+
+
+
+
+
+
+
+
+```
+
+效果:
+
+
\ No newline at end of file
diff --git a/doc/source/handycontrol/native_controls/slider/index.md b/doc/source/handycontrol/native_controls/slider/index.md
index ca12ad62..3ffd997e 100644
--- a/doc/source/handycontrol/native_controls/slider/index.md
+++ b/doc/source/handycontrol/native_controls/slider/index.md
@@ -1,5 +1,17 @@
---
-title: 建设中
+title: Slider 滑块
---
-建设中
\ No newline at end of file
+# SliderBaseStyle
+
+滑块默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
+
+案例:
+
+```xml
+
+```
+
+效果:
+
+
\ No newline at end of file
diff --git a/doc/source/handycontrol/native_controls/tabControl/index.md b/doc/source/handycontrol/native_controls/tabControl/index.md
index ca12ad62..1c2ac558 100644
--- a/doc/source/handycontrol/native_controls/tabControl/index.md
+++ b/doc/source/handycontrol/native_controls/tabControl/index.md
@@ -1,5 +1,93 @@
---
-title: 建设中
+title: TabControl 选项卡控件
---
-建设中
\ No newline at end of file
+# TabControlBaseStyle
+
+选项卡控件默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
+
+案例:
+
+ ```xml
+
+
+
+
+
+
+
+
+ ```
+
+效果:
+
+
+
+# TabControlInLine : TabControlBaseStyle
+
+单行填充选项卡样式
+
+案例:
+
+```xml
+
+
+
+
+
+
+
+
+```
+
+效果:
+
+
+
+# TabControlCapsule
+
+胶囊状选项卡样式
+
+案例:
+
+```xml
+
+
+
+
+
+
+
+
+```
+
+效果:
+
+
+
+# TabControlCapsuleSolid : TabControlCapsule
+
+胶囊状(实心)选项卡样式
+
+案例:
+
+```xml
+
+
+
+
+
+
+
+
+```
+
+效果:
+
+
+
+# 温馨提示
+
+可以使用属性`TabStripPlacement`设定头部标题的位置,效果如下:
+
+
\ No newline at end of file
diff --git a/doc/source/handycontrol/tnx/index.md b/doc/source/handycontrol/tnx/index.md
index 7e1b38aa..565cb3ca 100644
--- a/doc/source/handycontrol/tnx/index.md
+++ b/doc/source/handycontrol/tnx/index.md
@@ -12,4 +12,4 @@ title: 鸣谢
# 感谢以下捐赠者
-












\ No newline at end of file
+












\ No newline at end of file
diff --git a/doc/themes/next/_config.yml b/doc/themes/next/_config.yml
index d74c3c3a..8c006f62 100644
--- a/doc/themes/next/_config.yml
+++ b/doc/themes/next/_config.yml
@@ -158,7 +158,7 @@ baidu_push: false
# External url should start with http:// or https://
menu:
主页: / ||
- HandyControl:
+ HandyControl - 2.4.0:
default: /handycontrol/ ||
鸣谢: /tnx/ ||
快速开始: /quick_start/ ||
@@ -187,7 +187,9 @@ menu:
LinkElement : /linkElement/ ||
PanelElement 面板元素: /panelElement/ ||
PasswordBoxAttach 密码框专用: /passwordBoxAttach/ ||
+ RectangleAttach Rectangle专用: /rectangleAttach/ ||
StatusSwitchElement 可切换状态的元素: /statusSwitchElement/ ||
+ TextBlockAttach 文本块专用: /textBlockAttach/ ||
TipElement 提示元素: /tipElement/ ||
TitleElement 标题元素: /titleElement/ ||
VisualElement 可视化元素: /visualElement/ ||
@@ -900,7 +902,7 @@ needmoreshare2:
# localhost_ignored: true
# CNZZ count
-#cnzz_siteid:
+cnzz_siteid: 1278600916
# Application Insights
# See: https://azure.microsoft.com/en-us/services/application-insights
diff --git a/doc/themes/next/layout/_third-party/analytics/cnzz-analytics.swig b/doc/themes/next/layout/_third-party/analytics/cnzz-analytics.swig
index 9693cda2..f9519141 100644
--- a/doc/themes/next/layout/_third-party/analytics/cnzz-analytics.swig
+++ b/doc/themes/next/layout/_third-party/analytics/cnzz-analytics.swig
@@ -1,5 +1,3 @@
{% if theme.cnzz_siteid %}
-
-
-
+
{% endif %}
diff --git a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
index b3c41945..dc1bfbd0 100644
--- a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
+++ b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
@@ -457,6 +457,12 @@
Resources\Img\LeftMainContent\Ellipsis_16x.png
+
+ Resources\Img\LeftMainContent\WPFFlowDocument_16x.png
+
+
+ Resources\Img\LeftMainContent\OutlinedRectangleTool_16x.png
+
@@ -477,6 +483,11 @@
Lang.Designer.cs
+
+
+ Properties\App.config
+
+
Data\MessageToken.tt
diff --git a/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj b/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
index 600b0889..4f61f64f 100644
--- a/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
+++ b/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
@@ -68,4 +68,54 @@
Resources\Effects\GrayScaleEffect.ps
+
+
+ Resources\Images\GlowWindow\bottom.png
+
+
+ Resources\Images\GlowWindow\bottomleft.png
+
+
+ Resources\Images\GlowWindow\bottomright.png
+
+
+ Resources\Images\GlowWindow\cornerbottomleft.png
+
+
+ Resources\Images\GlowWindow\cornerbottomright.png
+
+
+ Resources\Images\GlowWindow\cornertopleft.png
+
+
+ Resources\Images\GlowWindow\cornertopright.png
+
+
+ Resources\Images\GlowWindow\left.png
+
+
+ Resources\Images\GlowWindow\leftbottom.png
+
+
+ Resources\Images\GlowWindow\lefttop.png
+
+
+ Resources\Images\GlowWindow\right.png
+
+
+ Resources\Images\GlowWindow\rightbottom.png
+
+
+ Resources\Images\GlowWindow\righttop.png
+
+
+ Resources\Images\GlowWindow\top.png
+
+
+ Resources\Images\GlowWindow\topleft.png
+
+
+ Resources\Images\GlowWindow\topright.png
+
+
\ No newline at end of file
diff --git a/src/Core_30/HandyControl_Core_30/Themes/Styles/MessageBox.xaml b/src/Core_30/HandyControl_Core_30/Themes/Styles/MessageBox.xaml
index 0cd58286..6eae7d67 100644
--- a/src/Core_30/HandyControl_Core_30/Themes/Styles/MessageBox.xaml
+++ b/src/Core_30/HandyControl_Core_30/Themes/Styles/MessageBox.xaml
@@ -73,7 +73,7 @@
-
+
diff --git a/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml b/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml
index f0c9acdb..15e08920 100644
--- a/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml
+++ b/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml
@@ -48,18 +48,15 @@
-
-
+
+
-
-
+
+
-
-
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml
index 2615146f..c8e06311 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml
@@ -16,7 +16,7 @@
-
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml.cs
index affe29d0..10a70ab1 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml.cs
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml.cs
@@ -1,10 +1,27 @@
-namespace HandyControlDemo.UserControl
+using System.Windows.Controls;
+using HandyControl.Tools;
+
+namespace HandyControlDemo.UserControl
{
public partial class ChatBox
{
+ private ScrollViewer _scrollViewer;
+
public ChatBox()
{
InitializeComponent();
+
+ ListBoxChat.ItemContainerGenerator.ItemsChanged += ItemContainerGenerator_ItemsChanged;
+ }
+
+ private void ItemContainerGenerator_ItemsChanged(object sender, System.Windows.Controls.Primitives.ItemsChangedEventArgs e)
+ {
+ if (_scrollViewer == null)
+ {
+ _scrollViewer = VisualHelper.GetChild(ListBoxChat);
+ }
+
+ _scrollViewer?.ScrollToBottom();
}
}
}
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml
index 5036e772..7ac08446 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml
@@ -7,7 +7,7 @@
-
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PasswordBoxDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PasswordBoxDemoCtl.xaml
index 172bc51d..d6781b14 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PasswordBoxDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PasswordBoxDemoCtl.xaml
@@ -13,8 +13,7 @@
-
-
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml
index 77c4a6f4..728c99a3 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml
@@ -1,7 +1,12 @@
-
+
+
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs
index dc8f65fd..02c0ca3a 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs
@@ -1,4 +1,7 @@
-namespace HandyControlDemo.UserControl
+using System.Windows;
+using HandyControl.Controls;
+
+namespace HandyControlDemo.UserControl
{
public partial class PinBoxDemoCtl
{
@@ -6,5 +9,13 @@
{
InitializeComponent();
}
+
+ private void PinBox_OnCompleted(object sender, RoutedEventArgs e)
+ {
+ if (e.OriginalSource is PinBox pinBox)
+ {
+ Growl.Info(pinBox.Password);
+ }
+ }
}
}
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PoptipDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PoptipDemoCtl.xaml
index 8d247656..43d45e3e 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PoptipDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PoptipDemoCtl.xaml
@@ -8,14 +8,14 @@
-
-
+
+
@@ -44,7 +44,7 @@
-
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/OverView.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Main/OverView.xaml
index 2b00d656..7284de08 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/OverView.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/OverView.xaml
@@ -7,7 +7,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/SliderDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/SliderDemoCtl.xaml
index 06347065..1094c1f5 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/SliderDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/SliderDemoCtl.xaml
@@ -9,15 +9,15 @@
-
-
+
+
-
-
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Tools/GeometryAnimationDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Tools/GeometryAnimationDemoCtl.xaml
index ede0f570..bce845a2 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Tools/GeometryAnimationDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Tools/GeometryAnimationDemoCtl.xaml
@@ -27,7 +27,10 @@
-
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/Window/AboutWindow.xaml b/src/Shared/HandyControlDemo_Shared/Window/AboutWindow.xaml
index cc46e5a7..b553870f 100644
--- a/src/Shared/HandyControlDemo_Shared/Window/AboutWindow.xaml
+++ b/src/Shared/HandyControlDemo_Shared/Window/AboutWindow.xaml
@@ -10,7 +10,6 @@
ShowTitle="True"
BorderThickness="1"
BorderBrush="#262e2f"
- Style="{StaticResource WindowWin10}"
ResizeMode="NoResize"
ShowInTaskbar="False"
WindowStartupLocation="CenterOwner"
diff --git a/src/Shared/HandyControlDemo_Shared/Window/BlurWindow.xaml b/src/Shared/HandyControlDemo_Shared/Window/BlurWindow.xaml
index 6a192705..573688c2 100644
--- a/src/Shared/HandyControlDemo_Shared/Window/BlurWindow.xaml
+++ b/src/Shared/HandyControlDemo_Shared/Window/BlurWindow.xaml
@@ -1,15 +1,14 @@
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:hc="https://handyorg.github.io/handycontrol"
+ xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
+ mc:Ignorable="d"
+ WindowStartupLocation="CenterScreen"
+ Title="{x:Static langs:Lang.Title}"
+ Height="450"
+ Width="800"
+ Icon="/HandyControlDemo;component/Resources/Img/icon.ico">
diff --git a/src/Shared/HandyControlDemo_Shared/Window/CommonWindow.xaml b/src/Shared/HandyControlDemo_Shared/Window/CommonWindow.xaml
index a44dd0f1..57f506a2 100644
--- a/src/Shared/HandyControlDemo_Shared/Window/CommonWindow.xaml
+++ b/src/Shared/HandyControlDemo_Shared/Window/CommonWindow.xaml
@@ -8,7 +8,6 @@
mc:Ignorable="d"
Background="{DynamicResource MainContentBackgroundBrush}"
WindowStartupLocation="CenterScreen"
- Style="{StaticResource WindowWin10}"
Title="{x:Static langs:Lang.Title}"
Height="450"
Width="800"
diff --git a/src/Shared/HandyControlDemo_Shared/Window/CustomNonClientAreaWindow.xaml b/src/Shared/HandyControlDemo_Shared/Window/CustomNonClientAreaWindow.xaml
index a39bbba1..7dc14330 100644
--- a/src/Shared/HandyControlDemo_Shared/Window/CustomNonClientAreaWindow.xaml
+++ b/src/Shared/HandyControlDemo_Shared/Window/CustomNonClientAreaWindow.xaml
@@ -9,10 +9,9 @@
OtherButtonForeground="{DynamicResource ReverseTextBrush}"
CloseButtonForeground="{DynamicResource ReverseTextBrush}"
NonClientAreaBackground="{DynamicResource ToolBarBackground}"
- NonClientAreaHeight="69"
+ NonClientAreaHeight="62"
Background="{DynamicResource MainContentBackgroundBrush}"
WindowStartupLocation="CenterScreen"
- Style="{StaticResource WindowWin10}"
ShowTitle="False"
Title="{x:Static langs:Lang.Title}"
Height="450"
diff --git a/src/Shared/HandyControlDemo_Shared/Window/GlowWindow.xaml b/src/Shared/HandyControlDemo_Shared/Window/GlowWindow.xaml
new file mode 100644
index 00000000..b1bc5e52
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/Window/GlowWindow.xaml
@@ -0,0 +1,17 @@
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/Window/GlowWindow.xaml.cs b/src/Shared/HandyControlDemo_Shared/Window/GlowWindow.xaml.cs
new file mode 100644
index 00000000..a58d408f
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/Window/GlowWindow.xaml.cs
@@ -0,0 +1,10 @@
+namespace HandyControlDemo.Window
+{
+ public partial class GlowWindow
+ {
+ public GlowWindow()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/src/Shared/HandyControlDemo_Shared/Window/NoNonClientAreaDragableWindow.xaml b/src/Shared/HandyControlDemo_Shared/Window/NoNonClientAreaDragableWindow.xaml
index 7a9199fe..39d0715f 100644
--- a/src/Shared/HandyControlDemo_Shared/Window/NoNonClientAreaDragableWindow.xaml
+++ b/src/Shared/HandyControlDemo_Shared/Window/NoNonClientAreaDragableWindow.xaml
@@ -8,7 +8,6 @@
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
ShowTitle="True"
- Style="{StaticResource WindowBlur}"
Icon="/HandyControlDemo;component/Resources/Img/icon.ico"
ShowNonClientArea="False"
Title="NoClientDragableWindow"
diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs
index 5fa5481f..86777414 100644
--- a/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs
@@ -18,5 +18,14 @@ namespace HandyControl.Controls
public static void SetPlacement(DependencyObject element, TipPlacement value) => element.SetValue(PlacementProperty, value);
public static TipPlacement GetPlacement(DependencyObject element) => (TipPlacement) element.GetValue(PlacementProperty);
+
+ public static readonly DependencyProperty StringFormatProperty = DependencyProperty.RegisterAttached(
+ "StringFormat", typeof(string), typeof(TipElement), new PropertyMetadata("#0.0"));
+
+ public static void SetStringFormat(DependencyObject element, string value)
+ => element.SetValue(StringFormatProperty, value);
+
+ public static string GetStringFormat(DependencyObject element)
+ => (string) element.GetValue(StringFormatProperty);
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/WindowAttach.cs b/src/Shared/HandyControl_Shared/Controls/Attach/WindowAttach.cs
index 911f6fec..dd6a8db5 100644
--- a/src/Shared/HandyControl_Shared/Controls/Attach/WindowAttach.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Attach/WindowAttach.cs
@@ -97,7 +97,7 @@ namespace HandyControl.Controls
{
var _ = new WindowInteropHelper(window)
{
- Owner = NativeMethods.GetDesktopWindow()
+ Owner = InteropMethods.GetDesktopWindow()
};
}
}
diff --git a/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs b/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs
index dc9ecf92..0aea9a99 100644
--- a/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs
+++ b/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs
@@ -96,10 +96,10 @@ namespace HandyControl.Controls
public static Color GetColorAt(int x, int y)
{
- var desk = UnsafeNativeMethods.GetDesktopWindow();
- var dc = UnsafeNativeMethods.GetWindowDC(desk);
- var a = (int)UnsafeNativeMethods.GetPixel(dc, x, y);
- UnsafeNativeMethods.ReleaseDC(desk, dc);
+ var desk = InteropMethods.GetDesktopWindow();
+ var dc = InteropMethods.GetWindowDC(desk);
+ var a = (int)InteropMethods.GetPixel(dc, x, y);
+ InteropMethods.ReleaseDC(desk, dc);
return Color.FromArgb(255, (byte) ((a >> 0) & 0xff), (byte) ((a >> 8) & 0xff), (byte) ((a >> 16) & 0xff));
}
}
diff --git a/src/Shared/HandyControl_Shared/Controls/Image/ImageBlock.cs b/src/Shared/HandyControl_Shared/Controls/Image/ImageBlock.cs
index 11f3adcb..1093a4fe 100644
--- a/src/Shared/HandyControl_Shared/Controls/Image/ImageBlock.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Image/ImageBlock.cs
@@ -23,13 +23,46 @@ namespace HandyControl.Controls
private int _blockHeight;
+ private bool _isDisposed;
+
public ImageBlock()
{
_dispatcherTimer = new DispatcherTimer(DispatcherPriority.Render)
{
Interval = Interval
};
- _dispatcherTimer.Tick += DispatcherTimer_Tick;
+
+ IsVisibleChanged += ImageBlock_IsVisibleChanged;
+ }
+
+ ~ImageBlock() => Dispose();
+
+ public void Dispose()
+ {
+ if (_isDisposed) return;
+
+ IsVisibleChanged -= ImageBlock_IsVisibleChanged;
+ _dispatcherTimer.Stop();
+ _isDisposed = true;
+
+ GC.SuppressFinalize(this);
+ }
+
+ private void ImageBlock_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
+ {
+ if(IsVisible)
+ {
+ _dispatcherTimer.Tick += DispatcherTimer_Tick;
+ if (IsPlaying)
+ {
+ _dispatcherTimer.Start();
+ }
+ }
+ else
+ {
+ _dispatcherTimer.Stop();
+ _dispatcherTimer.Tick -= DispatcherTimer_Tick;
+ }
}
private void UpdateDatas()
diff --git a/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs b/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs
index c18bbb0a..d2e2b08b 100644
--- a/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Input/NumericUpDown.cs
@@ -13,18 +13,23 @@ namespace HandyControl.Controls
/// 数值选择控件
///
[TemplatePart(Name = ElementTextBox, Type = typeof(TextBox))]
+ [TemplatePart(Name = ElementErrorTip, Type = typeof(UIElement))]
public class NumericUpDown : Control, IDataInput
{
#region Constants
private const string ElementTextBox = "PART_TextBox";
+ private const string ElementErrorTip = "PART_ErrorTip";
+
#endregion Constants
#region Data
private TextBox _textBox;
+ private UIElement _errorTip;
+
private bool _updateText;
#endregion Data
@@ -77,6 +82,7 @@ namespace HandyControl.Controls
base.OnApplyTemplate();
_textBox = GetTemplateChild(ElementTextBox) as TextBox;
+ _errorTip = GetTemplateChild(ElementErrorTip) as UIElement;
if (_textBox != null)
{
@@ -105,7 +111,7 @@ namespace HandyControl.Controls
private void TextBox_LostFocus(object sender, RoutedEventArgs e)
{
- if (IsError) return;
+ if (IsError && _errorTip != null) return;
_textBox.Text = CurrentText;
}
@@ -196,13 +202,7 @@ namespace HandyControl.Controls
ctl.Value = maximum;
}
- var result = num > maximum ? maximum : num;
- if (!ctl.DecimalPlaces.HasValue)
- {
- result = Math.Floor(result);
- }
-
- return result;
+ return num > maximum ? maximum : num;
}
///
diff --git a/src/Shared/HandyControl_Shared/Controls/Input/PasswordBox.cs b/src/Shared/HandyControl_Shared/Controls/Input/PasswordBox.cs
index 1c2037aa..5fdd95be 100644
--- a/src/Shared/HandyControl_Shared/Controls/Input/PasswordBox.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Input/PasswordBox.cs
@@ -60,8 +60,6 @@ namespace HandyControl.Controls
private SecureString _password;
- private char _passwordChar;
-
private System.Windows.Controls.TextBox _textBox;
public PasswordBox()
@@ -223,12 +221,6 @@ namespace HandyControl.Controls
}
}
}
-
- if (_passwordChar != default(char))
- {
- ActualPasswordBox.PasswordChar = _passwordChar;
- _passwordChar = default;
- }
}
if (_textBox != null)
diff --git a/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs b/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs
index 86634976..89fa3e43 100644
--- a/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs
@@ -1,9 +1,339 @@
-using System.Windows.Controls;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using HandyControl.Data;
+using HandyControl.Tools;
+using HandyControl.Tools.Extension;
namespace HandyControl.Controls
{
+ [TemplatePart(Name = ElementPanel, Type = typeof(Panel))]
public class PinBox : Control
{
+ private const string ElementPanel = "PART_Panel";
+ private static readonly object MinLength = 4;
+
+ private Panel _panel;
+
+ private int _inputIndex;
+
+ private bool _changed;
+
+ private bool _isInternalAction;
+
+ private List _passwordList;
+
+ private RoutedEventHandler _passwordBoxsGotFocusEventHandler;
+
+ private RoutedEventHandler _passwordBoxsPasswordChangedEventHandler;
+
+ public PinBox()
+ {
+ Loaded += PinBox_Loaded;
+ Unloaded += PinBox_Unloaded;
+ }
+
+ private void PinBox_Unloaded(object sender, RoutedEventArgs e)
+ {
+ RemoveHandler(System.Windows.Controls.PasswordBox.PasswordChangedEvent, _passwordBoxsPasswordChangedEventHandler);
+ RemoveHandler(GotFocusEvent, _passwordBoxsGotFocusEventHandler);
+
+ Loaded -= PinBox_Loaded;
+ Unloaded -= PinBox_Unloaded;
+ }
+
+ private void PinBox_Loaded(object sender, RoutedEventArgs e)
+ {
+ _passwordBoxsPasswordChangedEventHandler = PasswordBoxsPasswordChanged;
+ AddHandler(System.Windows.Controls.PasswordBox.PasswordChangedEvent, _passwordBoxsPasswordChangedEventHandler);
+
+ _passwordBoxsGotFocusEventHandler = PasswordBoxsGotFocus;
+ AddHandler(GotFocusEvent, _passwordBoxsGotFocusEventHandler);
+ }
+
+ private void PasswordBoxsPasswordChanged(object sender, RoutedEventArgs e)
+ {
+ if (_isInternalAction) return;
+
+ if (e.OriginalSource is System.Windows.Controls.PasswordBox passwordBox)
+ {
+ if (passwordBox.Password.Length > 0)
+ {
+ if (++_inputIndex >= Length)
+ {
+ _inputIndex = Length - 1;
+
+ if (_panel.Children.OfType()
+ .All(item => item.Password.Any()))
+ {
+ FocusManager.SetFocusedElement(this, null);
+ Keyboard.ClearFocus();
+ RaiseEvent(new RoutedEventArgs(CompletedEvent, this));
+ }
+ return;
+ }
+ }
+ else
+ {
+ if (--_inputIndex < 0)
+ {
+ _inputIndex = 0;
+ return;
+ }
+ }
+
+ _changed = true;
+ FocusManager.SetFocusedElement(this, _panel.Children[_inputIndex]);
+ }
+ }
+
+ private void PasswordBoxsGotFocus(object sender, RoutedEventArgs e)
+ {
+ if (e.OriginalSource is System.Windows.Controls.PasswordBox passwordBox)
+ {
+ _inputIndex = _panel.Children.IndexOf(passwordBox);
+ passwordBox.SelectAll();
+ }
+ }
+
+ protected override void OnPreviewKeyDown(KeyEventArgs e)
+ {
+ base.OnPreviewKeyUp(e);
+
+ if (e.Key == Key.Left)
+ {
+ if (--_inputIndex < 0)
+ {
+ _inputIndex = 0;
+ return;
+ }
+
+ var passwordBox = _panel.Children[_inputIndex] as System.Windows.Controls.PasswordBox;
+ passwordBox?.SelectAll();
+
+ FocusManager.SetFocusedElement(this, passwordBox);
+ }
+ else if (e.Key == Key.Right)
+ {
+ if (++_inputIndex >= Length)
+ {
+ _inputIndex = Length - 1;
+ return;
+ }
+
+ var passwordBox = _panel.Children[_inputIndex] as System.Windows.Controls.PasswordBox;
+ passwordBox?.SelectAll();
+
+ FocusManager.SetFocusedElement(this, passwordBox);
+ }
+ }
+
+ protected override void OnPreviewKeyUp(KeyEventArgs e)
+ {
+ base.OnPreviewKeyUp(e);
+
+ if (_changed)
+ {
+ _changed = false;
+ return;
+ }
+
+ if (e.Key == Key.Delete || e.Key == Key.Back)
+ {
+ if (_panel.Children[_inputIndex] is System.Windows.Controls.PasswordBox passwordBox)
+ {
+ _isInternalAction = true;
+ passwordBox.Clear();
+ _isInternalAction = false;
+ }
+
+ if (--_inputIndex < 0)
+ {
+ _inputIndex = 0;
+ return;
+ }
+
+ FocusManager.SetFocusedElement(this, _panel.Children[_inputIndex]);
+ }
+ }
+
+ public string Password
+ {
+ get
+ {
+ return string.Join("", _panel.Children.OfType().Select(item => item.Password));
+ }
+ set
+ {
+ if (_panel == null)
+ {
+ _passwordList = new List();
+
+ if (value == null)
+ {
+ value = string.Empty;
+ }
+
+ foreach (var item in value)
+ {
+ var secureString = new SecureString();
+ secureString.AppendChar(item);
+ _passwordList.Add(secureString);
+ }
+
+ return;
+ }
+
+ var length = Length;
+ if (string.IsNullOrEmpty(value) || value.Length != length || value.Length != _panel.Children.Count)
+ {
+ _panel.Children.OfType().Do(item => item.Clear());
+ }
+ else
+ {
+ _panel.Children.OfType().DoWithIndex((item, index) => item.Password = value[index].ToString());
+ }
+ }
+ }
+
+ ///
+ /// 掩码字符
+ ///
+ public static readonly DependencyProperty PasswordCharProperty =
+ System.Windows.Controls.PasswordBox.PasswordCharProperty.AddOwner(typeof(PinBox),
+ new FrameworkPropertyMetadata('●'));
+
+ public char PasswordChar
+ {
+ get => (char)GetValue(PasswordCharProperty);
+ set => SetValue(PasswordCharProperty, value);
+ }
+
+ public static readonly DependencyProperty LengthProperty = DependencyProperty.Register(
+ "Length", typeof(int), typeof(PinBox), new PropertyMetadata(MinLength, OnLengthChanged, CoerceLength), ValidateHelper.IsInRangeOfPosInt);
+
+ private static void OnLengthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ var ctl = (PinBox) d;
+ ctl.UpdateItems();
+ }
+
+ private static object CoerceLength(DependencyObject d, object basevalue) => (int)basevalue < 4 ? MinLength : basevalue;
+
+ public int Length
+ {
+ get => (int) GetValue(LengthProperty);
+ set => SetValue(LengthProperty, value);
+ }
+
+ public static readonly DependencyProperty ItemMarginProperty = DependencyProperty.Register(
+ "ItemMargin", typeof(Thickness), typeof(PinBox), new PropertyMetadata(default(Thickness)));
+
+ public Thickness ItemMargin
+ {
+ get => (Thickness) GetValue(ItemMarginProperty);
+ set => SetValue(ItemMarginProperty, value);
+ }
+
+ public static readonly DependencyProperty ItemWidthProperty = DependencyProperty.Register(
+ "ItemWidth", typeof(double), typeof(PinBox), new PropertyMetadata(ValueBoxes.Double0Box));
+
+ public double ItemWidth
+ {
+ get => (double) GetValue(ItemWidthProperty);
+ set => SetValue(ItemWidthProperty, value);
+ }
+
+ public static readonly DependencyProperty ItemHeightProperty = DependencyProperty.Register(
+ "ItemHeight", typeof(double), typeof(PinBox), new PropertyMetadata(ValueBoxes.Double0Box));
+
+ public double ItemHeight
+ {
+ get => (double) GetValue(ItemHeightProperty);
+ set => SetValue(ItemHeightProperty, value);
+ }
+
+ public static readonly RoutedEvent CompletedEvent =
+ EventManager.RegisterRoutedEvent("Completed", RoutingStrategy.Bubble,
+ typeof(RoutedEventHandler), typeof(PinBox));
+
+ public event RoutedEventHandler Completed
+ {
+ add => AddHandler(CompletedEvent, value);
+ remove => RemoveHandler(CompletedEvent, value);
+ }
+
+ private void UpdateItems()
+ {
+ if (_panel == null) return;
+
+ _panel.Children.Clear();
+ var length = Length;
+
+ for (var i = 0; i < length; i++)
+ {
+ _panel.Children.Add(CreatePasswordBox());
+ }
+ }
+
+ private System.Windows.Controls.PasswordBox CreatePasswordBox()
+ {
+ return new System.Windows.Controls.PasswordBox
+ {
+ MaxLength = 1,
+ HorizontalContentAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Center,
+ Margin = ItemMargin,
+ Width = ItemWidth,
+ Height = ItemHeight,
+ Padding = default,
+ PasswordChar = PasswordChar
+ };
+ }
+
+ public override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+
+ _panel = GetTemplateChild(ElementPanel) as Panel;
+ if (_panel != null)
+ {
+ UpdateItems();
+
+ var length = Length;
+ if (_passwordList != null && _passwordList.Count == length && _panel.Children.Count == length)
+ {
+ for (var i = 0; i < length; i++)
+ {
+ var password = _passwordList[i];
+ if (password.Length > 0)
+ {
+ var valuePtr = IntPtr.Zero;
+ try
+ {
+ valuePtr = Marshal.SecureStringToGlobalAllocUnicode(password);
+ if (_panel.Children[i] is System.Windows.Controls.PasswordBox passwordBox)
+ {
+ passwordBox.Password = Marshal.PtrToStringUni(valuePtr) ?? throw new InvalidOperationException();
+ }
+ }
+ finally
+ {
+ Marshal.ZeroFreeGlobalAllocUnicode(valuePtr);
+ password.Clear();
+ }
+ }
+ }
+
+ _passwordList.Clear();
+ }
+ }
+ }
}
}
diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Carousel.cs b/src/Shared/HandyControl_Shared/Controls/Other/Carousel.cs
index 61cc89ad..47ac493a 100644
--- a/src/Shared/HandyControl_Shared/Controls/Other/Carousel.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Other/Carousel.cs
@@ -22,7 +22,7 @@ namespace HandyControl.Controls
[ContentProperty("Items")]
[TemplatePart(Name = ElementPanelPage, Type = typeof(Panel))]
[TemplatePart(Name = ElementItemsControl, Type = typeof(ItemsPresenter))]
- public class Carousel : ListBox
+ public class Carousel : ListBox, IDisposable
{
#region Constants
@@ -33,6 +33,8 @@ namespace HandyControl.Controls
#region Data
+ private bool _isDisposed;
+
private Panel _panelPage;
private bool _appliedTemplate;
@@ -119,6 +121,36 @@ namespace HandyControl.Controls
CommandBindings.Add(new CommandBinding(ControlCommands.Selected, ButtonPages_OnClick));
Loaded += (s, e) => UpdatePageButtons();
+ IsVisibleChanged += Carousel_IsVisibleChanged;
+ }
+
+ ~Carousel() => Dispose();
+
+ public void Dispose()
+ {
+ if (_isDisposed) return;
+
+ IsVisibleChanged -= Carousel_IsVisibleChanged;
+ _updateTimer.Stop();
+ _isDisposed = true;
+
+ GC.SuppressFinalize(this);
+ }
+
+ private void Carousel_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
+ {
+ if (_updateTimer == null) return;
+
+ if (IsVisible)
+ {
+ _updateTimer.Tick += UpdateTimer_Tick;
+ _updateTimer.Start();
+ }
+ else
+ {
+ _updateTimer.Stop();
+ _updateTimer.Tick -= UpdateTimer_Tick;
+ }
}
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
diff --git a/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs b/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs
index 988b72c4..6531ccf6 100644
--- a/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs
@@ -33,7 +33,7 @@ namespace HandyControl.Controls
private IconHandle _iconHandle;
- private const int WmTrayMouseMessage = NativeMethods.WM_USER + 1024;
+ private const int WmTrayMouseMessage = InteropValues.WM_USER + 1024;
private string _windowClassName;
@@ -41,7 +41,7 @@ namespace HandyControl.Controls
private IntPtr _messageWindowHandle;
- private readonly WndProc _callback;
+ private readonly InteropValues.WndProc _callback;
private Popup _contextContent;
@@ -93,10 +93,7 @@ namespace HandyControl.Controls
if (Application.Current != null) Application.Current.Exit += (s, e) => Dispose();
}
- ~NotifyIcon()
- {
- Dispose(false);
- }
+ ~NotifyIcon() => Dispose(false);
public void Init()
{
@@ -165,9 +162,9 @@ namespace HandyControl.Controls
{
if (!_added || DesignerHelper.IsInDesignMode) return;
- var data = new NOTIFYICONDATA
+ var data = new InteropValues.NOTIFYICONDATA
{
- uFlags = NativeMethods.NIF_INFO,
+ uFlags = InteropValues.NIF_INFO,
hWnd = _messageWindowHandle,
uID = _id,
szInfoTitle = title ?? string.Empty,
@@ -177,20 +174,20 @@ namespace HandyControl.Controls
switch (infoType)
{
case NotifyIconInfoType.Info:
- data.dwInfoFlags = NativeMethods.NIIF_INFO;
+ data.dwInfoFlags = InteropValues.NIIF_INFO;
break;
case NotifyIconInfoType.Warning:
- data.dwInfoFlags = NativeMethods.NIIF_WARNING;
+ data.dwInfoFlags = InteropValues.NIIF_WARNING;
break;
case NotifyIconInfoType.Error:
- data.dwInfoFlags = NativeMethods.NIIF_ERROR;
+ data.dwInfoFlags = InteropValues.NIIF_ERROR;
break;
case NotifyIconInfoType.None:
- data.dwInfoFlags = NativeMethods.NIIF_NONE;
+ data.dwInfoFlags = InteropValues.NIIF_NONE;
break;
}
- UnsafeNativeMethods.Shell_NotifyIcon(NativeMethods.NIM_MODIFY, data);
+ InteropMethods.Shell_NotifyIcon(InteropValues.NIM_MODIFY, data);
}
public void Dispose()
@@ -330,7 +327,7 @@ namespace HandyControl.Controls
{
var isTrue = FindNotifyIcon(out var rectNotify);
if (!isTrue) return false;
- NativeMethods.GetCursorPos(out var point);
+ InteropMethods.GetCursorPos(out var point);
if (point.X >= rectNotify.Left && point.X <= rectNotify.Right &&
point.Y >= rectNotify.Top && point.Y <= rectNotify.Bottom)
{
@@ -368,17 +365,17 @@ namespace HandyControl.Controls
//referenced from http://www.cnblogs.com/sczmzx/p/5158127.html
private IntPtr FindTrayToolbarWindow()
{
- var hWnd = NativeMethods.FindWindow("Shell_TrayWnd", null);
+ var hWnd = InteropMethods.FindWindow("Shell_TrayWnd", null);
if (hWnd != IntPtr.Zero)
{
- hWnd = NativeMethods.FindWindowEx(hWnd, IntPtr.Zero, "TrayNotifyWnd", null);
+ hWnd = InteropMethods.FindWindowEx(hWnd, IntPtr.Zero, "TrayNotifyWnd", null);
if (hWnd != IntPtr.Zero)
{
- hWnd = NativeMethods.FindWindowEx(hWnd, IntPtr.Zero, "SysPager", null);
+ hWnd = InteropMethods.FindWindowEx(hWnd, IntPtr.Zero, "SysPager", null);
if (hWnd != IntPtr.Zero)
{
- hWnd = NativeMethods.FindWindowEx(hWnd, IntPtr.Zero, "ToolbarWindow32", null);
+ hWnd = InteropMethods.FindWindowEx(hWnd, IntPtr.Zero, "ToolbarWindow32", null);
}
}
@@ -389,17 +386,17 @@ namespace HandyControl.Controls
//referenced from http://www.cnblogs.com/sczmzx/p/5158127.html
private IntPtr FindTrayToolbarOverFlowWindow()
{
- var hWnd = NativeMethods.FindWindow("NotifyIconOverflowWindow", null);
+ var hWnd = InteropMethods.FindWindow("NotifyIconOverflowWindow", null);
if (hWnd != IntPtr.Zero)
{
- hWnd = NativeMethods.FindWindowEx(hWnd, IntPtr.Zero, "ToolbarWindow32", null);
+ hWnd = InteropMethods.FindWindowEx(hWnd, IntPtr.Zero, "ToolbarWindow32", null);
}
return hWnd;
}
- private bool FindNotifyIcon(out NativeMethods.RECT rect)
+ private bool FindNotifyIcon(out InteropValues.RECT rect)
{
- var rectNotify = new NativeMethods.RECT();
+ var rectNotify = new InteropValues.RECT();
var hTrayWnd = FindTrayToolbarWindow();
var isTrue = FindNotifyIcon(hTrayWnd, ref rectNotify);
if (!isTrue)
@@ -412,48 +409,48 @@ namespace HandyControl.Controls
}
//referenced from http://www.cnblogs.com/sczmzx/p/5158127.html
- private bool FindNotifyIcon(IntPtr hTrayWnd, ref NativeMethods.RECT rectNotify)
+ private bool FindNotifyIcon(IntPtr hTrayWnd, ref InteropValues.RECT rectNotify)
{
- NativeMethods.GetWindowRect(hTrayWnd, out var rectTray);
- var count = (int)NativeMethods.SendMessage(hTrayWnd, NativeMethods.TB_BUTTONCOUNT, 0, IntPtr.Zero);
+ InteropMethods.GetWindowRect(hTrayWnd, out var rectTray);
+ var count = (int)InteropMethods.SendMessage(hTrayWnd, InteropValues.TB_BUTTONCOUNT, 0, IntPtr.Zero);
var isFind = false;
if (count > 0)
{
- NativeMethods.GetWindowThreadProcessId(hTrayWnd, out var trayPid);
- var hProcess = NativeMethods.OpenProcess(NativeMethods.ProcessAccess.VMOperation | NativeMethods.ProcessAccess.VMRead | NativeMethods.ProcessAccess.VMWrite, false, trayPid);
- var address = NativeMethods.VirtualAllocEx(hProcess, IntPtr.Zero, 1024, NativeMethods.AllocationType.Commit, NativeMethods.MemoryProtection.ReadWrite);
+ InteropMethods.GetWindowThreadProcessId(hTrayWnd, out var trayPid);
+ var hProcess = InteropMethods.OpenProcess(InteropValues.ProcessAccess.VMOperation | InteropValues.ProcessAccess.VMRead | InteropValues.ProcessAccess.VMWrite, false, trayPid);
+ var address = InteropMethods.VirtualAllocEx(hProcess, IntPtr.Zero, 1024, InteropValues.AllocationType.Commit, InteropValues.MemoryProtection.ReadWrite);
- var btnData = new NativeMethods.TBBUTTON();
- var trayData = new NativeMethods.TRAYDATA();
+ var btnData = new InteropValues.TBBUTTON();
+ var trayData = new InteropValues.TRAYDATA();
var handel = Process.GetCurrentProcess().Id;
for (uint i = 0; i < count; i++)
{
- NativeMethods.SendMessage(hTrayWnd, NativeMethods.TB_GETBUTTON, i, address);
- var isTrue = NativeMethods.ReadProcessMemory(hProcess, address, out btnData, Marshal.SizeOf(btnData), out _);
+ InteropMethods.SendMessage(hTrayWnd, InteropValues.TB_GETBUTTON, i, address);
+ var isTrue = InteropMethods.ReadProcessMemory(hProcess, address, out btnData, Marshal.SizeOf(btnData), out _);
if (!isTrue) continue;
if (btnData.dwData == IntPtr.Zero)
{
btnData.dwData = btnData.iString;
}
- NativeMethods.ReadProcessMemory(hProcess, btnData.dwData, out trayData, Marshal.SizeOf(trayData), out _);
- NativeMethods.GetWindowThreadProcessId(trayData.hwnd, out var dwProcessId);
+ InteropMethods.ReadProcessMemory(hProcess, btnData.dwData, out trayData, Marshal.SizeOf(trayData), out _);
+ InteropMethods.GetWindowThreadProcessId(trayData.hwnd, out var dwProcessId);
if (dwProcessId == (uint)handel)
{
- var rect = new NativeMethods.RECT();
- var lngRect = NativeMethods.VirtualAllocEx(hProcess, IntPtr.Zero, Marshal.SizeOf(typeof(Rect)), NativeMethods.AllocationType.Commit, NativeMethods.MemoryProtection.ReadWrite);
- NativeMethods.SendMessage(hTrayWnd, NativeMethods.TB_GETITEMRECT, i, lngRect);
- NativeMethods.ReadProcessMemory(hProcess, lngRect, out rect, Marshal.SizeOf(rect), out _);
+ var rect = new InteropValues.RECT();
+ var lngRect = InteropMethods.VirtualAllocEx(hProcess, IntPtr.Zero, Marshal.SizeOf(typeof(Rect)), InteropValues.AllocationType.Commit, InteropValues.MemoryProtection.ReadWrite);
+ InteropMethods.SendMessage(hTrayWnd, InteropValues.TB_GETITEMRECT, i, lngRect);
+ InteropMethods.ReadProcessMemory(hProcess, lngRect, out rect, Marshal.SizeOf(rect), out _);
- NativeMethods.VirtualFreeEx(hProcess, lngRect, Marshal.SizeOf(rect), NativeMethods.FreeType.Decommit);
- NativeMethods.VirtualFreeEx(hProcess, lngRect, 0, NativeMethods.FreeType.Release);
+ InteropMethods.VirtualFreeEx(hProcess, lngRect, Marshal.SizeOf(rect), InteropValues.FreeType.Decommit);
+ InteropMethods.VirtualFreeEx(hProcess, lngRect, 0, InteropValues.FreeType.Release);
var left = rectTray.Left + rect.Left;
var top = rectTray.Top + rect.Top;
var botton = rectTray.Top + rect.Bottom;
var right = rectTray.Left + rect.Right;
- rectNotify = new NativeMethods.RECT
+ rectNotify = new InteropValues.RECT
{
Left = left,
Right = right,
@@ -464,9 +461,9 @@ namespace HandyControl.Controls
break;
}
}
- NativeMethods.VirtualFreeEx(hProcess, address, 0x4096, NativeMethods.FreeType.Decommit);
- NativeMethods.VirtualFreeEx(hProcess, address, 0, NativeMethods.FreeType.Release);
- NativeMethods.CloseHandle(hProcess);
+ InteropMethods.VirtualFreeEx(hProcess, address, 0x4096, InteropValues.FreeType.Decommit);
+ InteropMethods.VirtualFreeEx(hProcess, address, 0, InteropValues.FreeType.Release);
+ InteropMethods.CloseHandle(hProcess);
}
return isFind;
}
@@ -496,13 +493,13 @@ namespace HandyControl.Controls
if (DesignerHelper.IsInDesignMode) return;
_isTransparent = isTransparent;
- var data = new NOTIFYICONDATA
+ var data = new InteropValues.NOTIFYICONDATA
{
uCallbackMessage = WmTrayMouseMessage,
- uFlags = NativeMethods.NIF_MESSAGE | NativeMethods.NIF_ICON | NativeMethods.NIF_TIP,
+ uFlags = InteropValues.NIF_MESSAGE | InteropValues.NIF_ICON | InteropValues.NIF_TIP,
hWnd = _messageWindowHandle,
uID = _id,
- dwInfoFlags = NativeMethods.NIF_TIP,
+ dwInfoFlags = InteropValues.NIF_TIP,
hIcon = isTransparent ? IntPtr.Zero : _iconCurrentHandle,
szTip = Text
};
@@ -511,17 +508,17 @@ namespace HandyControl.Controls
{
if (!_added)
{
- UnsafeNativeMethods.Shell_NotifyIcon(NativeMethods.NIM_ADD, data);
+ InteropMethods.Shell_NotifyIcon(InteropValues.NIM_ADD, data);
_added = true;
}
else
{
- UnsafeNativeMethods.Shell_NotifyIcon(NativeMethods.NIM_MODIFY, data);
+ InteropMethods.Shell_NotifyIcon(InteropValues.NIM_MODIFY, data);
}
}
else if (_added)
{
- UnsafeNativeMethods.Shell_NotifyIcon(NativeMethods.NIM_DELETE, data);
+ InteropMethods.Shell_NotifyIcon(InteropValues.NIM_DELETE, data);
_added = false;
}
}
@@ -530,7 +527,7 @@ namespace HandyControl.Controls
private void RegisterClass()
{
_windowClassName = $"HandyControl.Controls.NotifyIcon{Guid.NewGuid()}";
- var wndclass = new WNDCLASS
+ var wndclass = new InteropValues.WNDCLASS4ICON
{
style = 0,
lpfnWndProc = _callback,
@@ -544,9 +541,9 @@ namespace HandyControl.Controls
lpszClassName = _windowClassName
};
- UnsafeNativeMethods.RegisterClass(wndclass);
- _wmTaskbarCreated = NativeMethods.RegisterWindowMessage("TaskbarCreated");
- _messageWindowHandle = UnsafeNativeMethods.CreateWindowEx(0, _windowClassName, "", 0, 0, 0, 1, 1,
+ InteropMethods.RegisterClass(wndclass);
+ _wmTaskbarCreated = InteropMethods.RegisterWindowMessage("TaskbarCreated");
+ _messageWindowHandle = InteropMethods.CreateWindowEx(0, _windowClassName, "", 0, 0, 0, 1, 1,
IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
}
@@ -562,17 +559,17 @@ namespace HandyControl.Controls
{
switch (lparam.ToInt64())
{
- case NativeMethods.WM_LBUTTONDBLCLK:
+ case InteropValues.WM_LBUTTONDBLCLK:
WmMouseDown(MouseButton.Left, 2);
break;
- case NativeMethods.WM_LBUTTONUP:
+ case InteropValues.WM_LBUTTONUP:
WmMouseUp(MouseButton.Left);
break;
- case NativeMethods.WM_RBUTTONUP:
+ case InteropValues.WM_RBUTTONUP:
ShowContextMenu();
WmMouseUp(MouseButton.Right);
break;
- case NativeMethods.WM_MOUSEMOVE:
+ case InteropValues.WM_MOUSEMOVE:
if (!_dispatcherTimerPos.IsEnabled)
{
_dispatcherTimerPos.Interval = TimeSpan.FromMilliseconds(200);
@@ -583,7 +580,7 @@ namespace HandyControl.Controls
}
}
- return UnsafeNativeMethods.DefWindowProc(hWnd, msg, wparam, lparam);
+ return InteropMethods.DefWindowProc(hWnd, msg, wparam, lparam);
}
private void WmMouseDown(MouseButton button, int clicks)
@@ -632,7 +629,7 @@ namespace HandyControl.Controls
Content = ContextContent
};
_contextContent.IsOpen = true;
- UnsafeNativeMethods.SetForegroundWindow(_contextContent.Child.GetHandle());
+ InteropMethods.SetForegroundWindow(_contextContent.Child.GetHandle());
}
else if (ContextMenu != null)
{
@@ -655,7 +652,7 @@ namespace HandyControl.Controls
ContextMenu.Placement = PlacementMode.Mouse;
ContextMenu.IsOpen = true;
- UnsafeNativeMethods.SetForegroundWindow(ContextMenu.GetHandle());
+ InteropMethods.SetForegroundWindow(ContextMenu.GetHandle());
}
}
diff --git a/src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs b/src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs
index f2705d0e..7d4dffad 100644
--- a/src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Panel/RelativePanel.cs
@@ -2,9 +2,11 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
+using System.Windows.Markup;
using HandyControl.Data;
namespace HandyControl.Controls
@@ -63,6 +65,7 @@ namespace HandyControl.Controls
public static void SetAlignLeftWith(DependencyObject element, UIElement value)
=> element.SetValue(AlignLeftWithProperty, value);
+ [TypeConverter(typeof(NameReferenceConverter))]
public static UIElement GetAlignLeftWith(DependencyObject element)
=> (UIElement) element.GetValue(AlignLeftWithProperty);
@@ -72,6 +75,7 @@ namespace HandyControl.Controls
public static void SetAlignTopWith(DependencyObject element, UIElement value)
=> element.SetValue(AlignTopWithProperty, value);
+ [TypeConverter(typeof(NameReferenceConverter))]
public static UIElement GetAlignTopWith(DependencyObject element)
=> (UIElement) element.GetValue(AlignTopWithProperty);
@@ -81,6 +85,7 @@ namespace HandyControl.Controls
public static void SetAlignRightWith(DependencyObject element, UIElement value)
=> element.SetValue(AlignRightWithProperty, value);
+ [TypeConverter(typeof(NameReferenceConverter))]
public static UIElement GetAlignRightWith(DependencyObject element)
=> (UIElement) element.GetValue(AlignRightWithProperty);
@@ -90,6 +95,7 @@ namespace HandyControl.Controls
public static void SetAlignBottomWith(DependencyObject element, UIElement value)
=> element.SetValue(AlignBottomWithProperty, value);
+ [TypeConverter(typeof(NameReferenceConverter))]
public static UIElement GetAlignBottomWith(DependencyObject element)
=> (UIElement) element.GetValue(AlignBottomWithProperty);
@@ -103,6 +109,7 @@ namespace HandyControl.Controls
public static void SetLeftOf(DependencyObject element, UIElement value)
=> element.SetValue(LeftOfProperty, value);
+ [TypeConverter(typeof(NameReferenceConverter))]
public static UIElement GetLeftOf(DependencyObject element)
=> (UIElement)element.GetValue(LeftOfProperty);
@@ -112,6 +119,7 @@ namespace HandyControl.Controls
public static void SetAbove(DependencyObject element, UIElement value)
=> element.SetValue(AboveProperty, value);
+ [TypeConverter(typeof(NameReferenceConverter))]
public static UIElement GetAbove(DependencyObject element)
=> (UIElement)element.GetValue(AboveProperty);
@@ -121,6 +129,7 @@ namespace HandyControl.Controls
public static void SetRightOf(DependencyObject element, UIElement value)
=> element.SetValue(RightOfProperty, value);
+ [TypeConverter(typeof(NameReferenceConverter))]
public static UIElement GetRightOf(DependencyObject element)
=> (UIElement)element.GetValue(RightOfProperty);
@@ -130,6 +139,7 @@ namespace HandyControl.Controls
public static void SetBelow(DependencyObject element, UIElement value)
=> element.SetValue(BelowProperty, value);
+ [TypeConverter(typeof(NameReferenceConverter))]
public static UIElement GetBelow(DependencyObject element)
=> (UIElement) element.GetValue(BelowProperty);
@@ -161,6 +171,7 @@ namespace HandyControl.Controls
public static void SetAlignHorizontalCenterWith(DependencyObject element, UIElement value)
=> element.SetValue(AlignHorizontalCenterWithProperty, value);
+ [TypeConverter(typeof(NameReferenceConverter))]
public static UIElement GetAlignHorizontalCenterWith(DependencyObject element)
=> (UIElement)element.GetValue(AlignHorizontalCenterWithProperty);
@@ -170,6 +181,7 @@ namespace HandyControl.Controls
public static void SetAlignVerticalCenterWith(DependencyObject element, UIElement value)
=> element.SetValue(AlignVerticalCenterWithProperty, value);
+ [TypeConverter(typeof(NameReferenceConverter))]
public static UIElement GetAlignVerticalCenterWith(DependencyObject element)
=> (UIElement)element.GetValue(AlignVerticalCenterWithProperty);
diff --git a/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipClock.cs b/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipClock.cs
index bd066e7d..d7d1fc0d 100644
--- a/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipClock.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Time/FlipClock/FlipClock.cs
@@ -8,6 +8,10 @@ namespace HandyControl.Controls
{
public class FlipClock : Control
{
+ private readonly DispatcherTimer _dispatcherTimer;
+
+ private bool _isDisposed;
+
public static readonly DependencyProperty NumberListProperty = DependencyProperty.Register(
"NumberList", typeof(List), typeof(FlipClock), new PropertyMetadata(new List {0, 0, 0, 0, 0, 0}));
@@ -44,12 +48,39 @@ namespace HandyControl.Controls
public FlipClock()
{
- var dispatcherTimer = new DispatcherTimer
+ _dispatcherTimer = new DispatcherTimer(DispatcherPriority.Render)
{
Interval = TimeSpan.FromMilliseconds(200)
};
- dispatcherTimer.Tick += DispatcherTimer_Tick;
- dispatcherTimer.Start();
+
+ IsVisibleChanged += FlipClock_IsVisibleChanged;
+ }
+
+ ~FlipClock() => Dispose();
+
+ public void Dispose()
+ {
+ if (_isDisposed) return;
+
+ IsVisibleChanged -= FlipClock_IsVisibleChanged;
+ _dispatcherTimer.Stop();
+ _isDisposed = true;
+
+ GC.SuppressFinalize(this);
+ }
+
+ private void FlipClock_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
+ {
+ if (IsVisible)
+ {
+ _dispatcherTimer.Tick += DispatcherTimer_Tick;
+ _dispatcherTimer.Start();
+ }
+ else
+ {
+ _dispatcherTimer.Stop();
+ _dispatcherTimer.Tick -= DispatcherTimer_Tick;
+ }
}
private void DispatcherTimer_Tick(object sender, EventArgs e) => DisplayTime = DateTime.Now;
diff --git a/src/Shared/HandyControl_Shared/Controls/Window/BlurWindow.cs b/src/Shared/HandyControl_Shared/Controls/Window/BlurWindow.cs
index 8e461830..9defae36 100644
--- a/src/Shared/HandyControl_Shared/Controls/Window/BlurWindow.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Window/BlurWindow.cs
@@ -1,4 +1,5 @@
using System.Runtime.InteropServices;
+using System.Windows;
using System.Windows.Media;
using HandyControl.Data;
using HandyControl.Tools;
@@ -7,6 +8,11 @@ namespace HandyControl.Controls
{
public class BlurWindow : Window
{
+ static BlurWindow()
+ {
+ StyleProperty.OverrideMetadata(typeof(BlurWindow), new FrameworkPropertyMetadata(Application.Current.FindResource(ResourceToken.WindowBlur)));
+ }
+
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
diff --git a/src/Shared/HandyControl_Shared/Controls/Window/GlowWindow.cs b/src/Shared/HandyControl_Shared/Controls/Window/GlowWindow.cs
new file mode 100644
index 00000000..490b9b67
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Controls/Window/GlowWindow.cs
@@ -0,0 +1,472 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Interop;
+using System.Windows.Media;
+using System.Windows.Threading;
+using HandyControl.Data;
+using HandyControl.Expression.Drawing;
+using HandyControl.Tools;
+using HandyControl.Tools.Interop;
+
+namespace HandyControl.Controls
+{
+ public class GlowWindow : Window
+ {
+ internal int DeferGlowChangesCount;
+
+ private readonly GlowEdge[] _glowEdges = new GlowEdge[4];
+
+ private DispatcherTimer _makeGlowVisibleTimer;
+
+ private bool _isGlowVisible;
+
+ private bool _useLogicalSizeForRestore;
+
+ private bool _updatingZOrder;
+
+ private Rect _logicalSizeForRestore = Rect.Empty;
+
+ public static readonly DependencyProperty ActiveGlowColorProperty = DependencyProperty.Register(
+ "ActiveGlowColor", typeof(Color), typeof(GlowWindow), new PropertyMetadata(default(Color), OnGlowColorChanged));
+
+ public Color ActiveGlowColor
+ {
+ get => (Color)GetValue(ActiveGlowColorProperty);
+ set => SetValue(ActiveGlowColorProperty, value);
+ }
+
+ public static readonly DependencyProperty InactiveGlowColorProperty = DependencyProperty.Register(
+ "InactiveGlowColor", typeof(Color), typeof(GlowWindow), new PropertyMetadata(default(Color), OnGlowColorChanged));
+
+ public Color InactiveGlowColor
+ {
+ get => (Color)GetValue(InactiveGlowColorProperty);
+ set => SetValue(InactiveGlowColorProperty, value);
+ }
+
+ static GlowWindow()
+ {
+ StyleProperty.OverrideMetadata(typeof(GlowWindow), new FrameworkPropertyMetadata(Application.Current.FindResource(ResourceToken.WindowGlow)));
+ ResizeModeProperty.OverrideMetadata(typeof(GlowWindow), new FrameworkPropertyMetadata(OnResizeModeChanged));
+ }
+
+ #region internal
+
+ internal void EndDeferGlowChanges()
+ {
+ foreach (var current in LoadedGlowWindows) current.CommitChanges();
+ }
+
+ #endregion
+
+ #region protected
+
+ protected virtual bool ShouldShowGlow
+ {
+ get
+ {
+ var handle = this.GetHandle();
+ return InteropMethods.IsWindowVisible(handle) && !InteropMethods.IsIconic(handle) &&
+ !InteropMethods.IsZoomed(handle) && ResizeMode != ResizeMode.NoResize;
+ }
+ }
+
+ protected virtual IntPtr HwndSourceHook(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
+ {
+ if (msg <= InteropValues.WM_WINDOWPOSCHANGED)
+ {
+ if (msg == InteropValues.WM_ACTIVATE)
+ {
+ return IntPtr.Zero;
+ }
+
+ if (msg != InteropValues.WM_QUIT)
+ {
+ switch (msg)
+ {
+ case InteropValues.WM_WINDOWPOSCHANGING:
+ WmWindowPosChanging(lParam);
+ return IntPtr.Zero;
+ case InteropValues.WM_WINDOWPOSCHANGED:
+ WmWindowPosChanged(lParam);
+ return IntPtr.Zero;
+ default:
+ return IntPtr.Zero;
+ }
+ }
+ }
+ else
+ {
+ if (msg <= InteropValues.WM_NCRBUTTONDBLCLK)
+ {
+ switch (msg)
+ {
+ case InteropValues.WM_SETICON:
+ break;
+ case InteropValues.WM_NCCREATE:
+ case InteropValues.WM_NCDESTROY:
+ return IntPtr.Zero;
+ case InteropValues.WM_NCACTIVATE:
+ handled = true;
+ return WmNcActivate(hWnd, wParam);
+ default:
+ switch (msg)
+ {
+ case InteropValues.WM_NCRBUTTONDOWN:
+ case InteropValues.WM_NCRBUTTONUP:
+ case InteropValues.WM_NCRBUTTONDBLCLK:
+ handled = true;
+ return IntPtr.Zero;
+ default:
+ return IntPtr.Zero;
+ }
+ }
+ }
+ else
+ {
+ switch (msg)
+ {
+ case InteropValues.WM_NCUAHDRAWCAPTION:
+ case InteropValues.WM_NCUAHDRAWFRAME:
+ handled = true;
+ return IntPtr.Zero;
+ default:
+ if (msg != InteropValues.WM_SYSCOMMAND) return IntPtr.Zero;
+ WmSysCommand(hWnd, wParam);
+ return IntPtr.Zero;
+ }
+ }
+ }
+
+ handled = true;
+ return CallDefWindowProcWithoutVisibleStyle(hWnd, msg, wParam, lParam);
+ }
+
+ protected override void OnActivated(EventArgs e)
+ {
+ UpdateGlowActiveState();
+ base.OnActivated(e);
+ }
+
+ protected override void OnDeactivated(EventArgs e)
+ {
+ UpdateGlowActiveState();
+ base.OnDeactivated(e);
+ }
+
+ protected override void OnClosed(EventArgs e)
+ {
+ StopTimer();
+ DestroyGlowWindows();
+ base.OnClosed(e);
+ }
+
+ protected override void OnSourceInitialized(EventArgs e)
+ {
+ var hwndSource = HwndSource.FromHwnd(new WindowInteropHelper(this).Handle);
+ if (hwndSource != null)
+ {
+ hwndSource.AddHook(HwndSourceHook);
+ CreateGlowWindowHandles();
+ }
+
+ base.OnSourceInitialized(e);
+ }
+
+ #endregion
+
+ #region private
+
+ private IEnumerable LoadedGlowWindows => from w in _glowEdges where w != null select w;
+
+ private bool IsGlowVisible
+ {
+ get => _isGlowVisible;
+ set
+ {
+ if (_isGlowVisible != value)
+ {
+ _isGlowVisible = value;
+ for (var i = 0; i < _glowEdges.Length; i++)
+ {
+ GetOrCreateGlowWindow(i).IsVisible = value;
+ }
+ }
+ }
+ }
+
+ private GlowEdge GetOrCreateGlowWindow(int direction)
+ {
+ return _glowEdges[direction] ?? (_glowEdges[direction] = new GlowEdge(this, (Dock)direction)
+ {
+ ActiveGlowColor = ActiveGlowColor,
+ InactiveGlowColor = InactiveGlowColor,
+ IsActive = IsActive
+ });
+ }
+
+ private static void OnResizeModeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
+ {
+ var customChromeWindow = (GlowWindow)obj;
+ customChromeWindow.UpdateGlowVisibility(false);
+ }
+
+ private static void OnGlowColorChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) => ((GlowWindow)obj).UpdateGlowColors();
+
+ private void UpdateGlowColors()
+ {
+ using (DeferGlowChanges())
+ {
+ foreach (var current in LoadedGlowWindows)
+ {
+ current.ActiveGlowColor = ActiveGlowColor;
+ current.InactiveGlowColor = InactiveGlowColor;
+ }
+ }
+ }
+
+ private void UpdateGlowVisibility(bool delayIfNecessary)
+ {
+ var shouldShowGlow = ShouldShowGlow;
+ if (shouldShowGlow != IsGlowVisible)
+ {
+ if (SystemParameters.MinimizeAnimation && shouldShowGlow && delayIfNecessary)
+ {
+ if (_makeGlowVisibleTimer != null)
+ {
+ _makeGlowVisibleTimer.Stop();
+ }
+ else
+ {
+ _makeGlowVisibleTimer = new DispatcherTimer
+ {
+ Interval = TimeSpan.FromMilliseconds(200.0)
+ };
+ _makeGlowVisibleTimer.Tick += OnDelayedVisibilityTimerTick;
+ }
+
+ _makeGlowVisibleTimer.Start();
+ return;
+ }
+
+ StopTimer();
+ IsGlowVisible = shouldShowGlow;
+ }
+ }
+
+ private void StopTimer()
+ {
+ if (_makeGlowVisibleTimer != null)
+ {
+ _makeGlowVisibleTimer.Stop();
+ _makeGlowVisibleTimer.Tick -= OnDelayedVisibilityTimerTick;
+ _makeGlowVisibleTimer = null;
+ }
+ }
+
+ private void OnDelayedVisibilityTimerTick(object sender, EventArgs e)
+ {
+ StopTimer();
+ UpdateGlowWindowPositions(false);
+ }
+
+ private void UpdateGlowWindowPositions(bool delayIfNecessary)
+ {
+ using (DeferGlowChanges())
+ {
+ UpdateGlowVisibility(delayIfNecessary);
+ foreach (var current in LoadedGlowWindows) current.UpdateWindowPos();
+ }
+ }
+
+ private IDisposable DeferGlowChanges() => new ChangeScope(this);
+
+ private void UpdateGlowActiveState()
+ {
+ using (DeferGlowChanges())
+ {
+ foreach (var current in LoadedGlowWindows)
+ {
+ current.IsActive = IsActive;
+ }
+ }
+ }
+
+ private void DestroyGlowWindows()
+ {
+ for (var i = 0; i < _glowEdges.Length; i++)
+ {
+ using (_glowEdges[i])
+ {
+ _glowEdges[i] = null;
+ }
+ }
+ }
+
+ private void WmWindowPosChanging(IntPtr lParam)
+ {
+ var windowpos = (InteropValues.WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(InteropValues.WINDOWPOS));
+ if ((windowpos.flags & 2u) == 0u && (windowpos.flags & 1u) == 0u && windowpos.cx > 0 && windowpos.cy > 0)
+ {
+ var rect = new Rect(windowpos.x, windowpos.y, windowpos.cx, windowpos.cy);
+ rect = rect.DeviceToLogicalUnits();
+ if (_useLogicalSizeForRestore)
+ {
+ rect = _logicalSizeForRestore;
+ _logicalSizeForRestore = Rect.Empty;
+ _useLogicalSizeForRestore = false;
+ }
+
+ var logicalRect = GetOnScreenPosition(rect);
+ logicalRect = logicalRect.LogicalToDeviceUnits();
+ windowpos.x = (int)logicalRect.X;
+ windowpos.y = (int)logicalRect.Y;
+ Marshal.StructureToPtr(windowpos, lParam, true);
+ }
+ }
+
+ private void UpdateZOrderOfOwner(IntPtr hwndOwner)
+ {
+ var lastOwnedWindow = IntPtr.Zero;
+ InteropMethods.EnumThreadWindows(InteropMethods.GetCurrentThreadId(), delegate (IntPtr hwnd, IntPtr lParam)
+ {
+ if (InteropMethods.GetWindow(hwnd, 4) == hwndOwner) lastOwnedWindow = hwnd;
+ return true;
+ }, IntPtr.Zero);
+
+ if (lastOwnedWindow != IntPtr.Zero && InteropMethods.GetWindow(hwndOwner, 3) != lastOwnedWindow)
+ InteropMethods.SetWindowPos(hwndOwner, lastOwnedWindow, 0, 0, 0, 0, 19);
+ }
+
+ private void UpdateZOrderOfThisAndOwner()
+ {
+ if (_updatingZOrder) return;
+ try
+ {
+ _updatingZOrder = true;
+ var windowInteropHelper = new WindowInteropHelper(this);
+ var handle = windowInteropHelper.Handle;
+ foreach (var current in LoadedGlowWindows)
+ {
+ var window = InteropMethods.GetWindow(current.Handle, 3);
+ if (window != handle) InteropMethods.SetWindowPos(current.Handle, handle, 0, 0, 0, 0, 19);
+ handle = current.Handle;
+ }
+
+ var owner = windowInteropHelper.Owner;
+ if (owner != IntPtr.Zero) UpdateZOrderOfOwner(owner);
+ }
+ finally
+ {
+ _updatingZOrder = false;
+ }
+ }
+
+ private void WmWindowPosChanged(IntPtr lParam)
+ {
+ try
+ {
+ var windowpos = (InteropValues.WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(InteropValues.WINDOWPOS));
+
+ UpdateGlowWindowPositions((windowpos.flags & 64u) == 0u);
+ UpdateZOrderOfThisAndOwner();
+ }
+ catch
+ {
+ // ignored
+ }
+ }
+
+ private Rect GetOnScreenPosition(Rect floatRect)
+ {
+ var result = floatRect;
+ floatRect = floatRect.LogicalToDeviceUnits();
+ ScreenHelper.FindMaximumSingleMonitorRectangle(floatRect, out _, out var rect2);
+ if (!floatRect.IntersectsWith(rect2))
+ {
+ ScreenHelper.FindMonitorRectsFromPoint(InteropMethods.GetCursorPos(), out _, out rect2);
+ rect2 = rect2.DeviceToLogicalUnits();
+ if (result.Width > rect2.Width) result.Width = rect2.Width;
+ if (result.Height > rect2.Height) result.Height = rect2.Height;
+ if (rect2.Right <= result.X) result.X = rect2.Right - result.Width;
+ if (rect2.Left > result.X + result.Width) result.X = rect2.Left;
+ if (rect2.Bottom <= result.Y) result.Y = rect2.Bottom - result.Height;
+ if (rect2.Top > result.Y + result.Height) result.Y = rect2.Top;
+ }
+
+ return result;
+ }
+
+ private static InteropValues.MONITORINFO MonitorInfoFromWindow(IntPtr hWnd)
+ {
+ var hMonitor = InteropMethods.MonitorFromWindow(hWnd, 2);
+ var result = default(InteropValues.MONITORINFO);
+ result.cbSize = (uint)Marshal.SizeOf(typeof(InteropValues.MONITORINFO));
+ InteropMethods.GetMonitorInfo(hMonitor, ref result);
+ return result;
+ }
+
+ private IntPtr WmNcActivate(IntPtr hWnd, IntPtr wParam) => InteropMethods.DefWindowProc(hWnd, InteropValues.WM_NCACTIVATE, wParam, InteropMethods.HRGN_NONE);
+
+ private bool IsAeroSnappedToMonitor(IntPtr hWnd)
+ {
+ var monitorinfo = MonitorInfoFromWindow(hWnd);
+ var logicalRect = new Rect(Left, Top, Width, Height);
+ logicalRect = logicalRect.LogicalToDeviceUnits();
+ return MathHelper.AreClose(monitorinfo.rcWork.Height, logicalRect.Height) && MathHelper.AreClose(monitorinfo.rcWork.Top, logicalRect.Top);
+ }
+
+ private void WmSysCommand(IntPtr hWnd, IntPtr wParam)
+ {
+ var num = InteropMethods.GET_SC_WPARAM(wParam);
+
+ if (num == InteropValues.SC_MOVE)
+ {
+ InteropMethods.RedrawWindow(hWnd, IntPtr.Zero, IntPtr.Zero,
+ InteropValues.RedrawWindowFlags.Invalidate | InteropValues.RedrawWindowFlags.NoChildren |
+ InteropValues.RedrawWindowFlags.UpdateNow | InteropValues.RedrawWindowFlags.Frame);
+ }
+
+ if ((num == InteropValues.SC_MAXIMIZE || num == InteropValues.SC_MINIMIZE || num == InteropValues.SC_MOVE ||
+ num == InteropValues.SC_SIZE) && WindowState == WindowState.Normal && !IsAeroSnappedToMonitor(hWnd))
+ {
+ _logicalSizeForRestore = new Rect(Left, Top, Width, Height);
+ }
+
+ if (num == InteropValues.SC_MOVE && WindowState == WindowState.Maximized && _logicalSizeForRestore == Rect.Empty)
+ {
+ _logicalSizeForRestore = new Rect(Left, Top, Width, Height);
+ }
+
+ if (num == InteropValues.SC_RESTORE && WindowState != WindowState.Minimized &&
+ _logicalSizeForRestore.Width > 0.0 && _logicalSizeForRestore.Height > 0.0)
+ {
+ Left = _logicalSizeForRestore.Left;
+ Top = _logicalSizeForRestore.Top;
+ Width = _logicalSizeForRestore.Width;
+ Height = _logicalSizeForRestore.Height;
+ _useLogicalSizeForRestore = true;
+ }
+ }
+
+ private IntPtr CallDefWindowProcWithoutVisibleStyle(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam)
+ {
+ var flag = VisualHelper.ModifyStyle(hWnd, InteropValues.WS_VISIBLE, 0);
+ var result = InteropMethods.DefWindowProc(hWnd, msg, wParam, lParam);
+ if (flag) VisualHelper.ModifyStyle(hWnd, 0, InteropValues.WS_VISIBLE);
+ return result;
+ }
+
+ private void CreateGlowWindowHandles()
+ {
+ for (var i = 0; i < _glowEdges.Length; i++) GetOrCreateGlowWindow(i).EnsureHandle();
+ }
+
+ #endregion
+
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Controls/Window/Window.cs b/src/Shared/HandyControl_Shared/Controls/Window/Window.cs
index 747b45f9..5d190fb6 100644
--- a/src/Shared/HandyControl_Shared/Controls/Window/Window.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Window/Window.cs
@@ -63,7 +63,7 @@ namespace HandyControl.Controls
public static readonly DependencyProperty NonClientAreaHeightProperty = DependencyProperty.Register(
"NonClientAreaHeight", typeof(double), typeof(Window),
- new PropertyMetadata(26.0));
+ new PropertyMetadata(22.0));
public static readonly DependencyProperty ShowNonClientAreaProperty = DependencyProperty.Register(
"ShowNonClientArea", typeof(bool), typeof(Window),
@@ -80,8 +80,6 @@ namespace HandyControl.Controls
private Thickness _actualBorderThickness;
- private UIElement _nonClientArea;
-
private bool _showNonClientArea = true;
private double _tempNonClientAreaHeight;
@@ -92,6 +90,13 @@ namespace HandyControl.Controls
private ResizeMode _tempResizeMode;
+ private UIElement _nonClientArea;
+
+ static Window()
+ {
+ StyleProperty.OverrideMetadata(typeof(Window), new FrameworkPropertyMetadata(Application.Current.FindResource(ResourceToken.WindowWin10)));
+ }
+
public Window()
{
#if netle40
diff --git a/src/Shared/HandyControl_Shared/Data/Args/MouseHookEventArgs.cs b/src/Shared/HandyControl_Shared/Data/Args/MouseHookEventArgs.cs
index 9c6b03fd..b63114ec 100644
--- a/src/Shared/HandyControl_Shared/Data/Args/MouseHookEventArgs.cs
+++ b/src/Shared/HandyControl_Shared/Data/Args/MouseHookEventArgs.cs
@@ -7,6 +7,6 @@ namespace HandyControl.Data
{
public MouseHookMessageType Message { get; set; }
- public NativeMethods.POINT Point { get; set; }
+ public InteropValues.POINT Point { get; set; }
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Data/DisposableObject.cs b/src/Shared/HandyControl_Shared/Data/DisposableObject.cs
new file mode 100644
index 00000000..482ede5e
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Data/DisposableObject.cs
@@ -0,0 +1,69 @@
+using System;
+
+namespace HandyControl.Data
+{
+ public class DisposableObject : IDisposable
+ {
+ private EventHandler _disposing;
+
+ public bool IsDisposed { get; private set; }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ ~DisposableObject()
+ {
+ Dispose(false);
+ }
+
+ public event EventHandler Disposing
+ {
+ add
+ {
+ ThrowIfDisposed();
+ _disposing += value;
+ }
+ remove
+ {
+ _disposing -= value;
+ }
+ }
+
+ protected void ThrowIfDisposed()
+ {
+ if (IsDisposed) throw new ObjectDisposedException(GetType().Name);
+ }
+
+ protected void Dispose(bool disposing)
+ {
+ if (IsDisposed) return;
+
+ try
+ {
+ if (disposing)
+ {
+ _disposing?.Invoke(this, EventArgs.Empty);
+ _disposing = null;
+ DisposeManagedResources();
+ }
+
+ DisposeNativeResources();
+ }
+ finally
+ {
+ IsDisposed = true;
+ }
+ }
+
+ protected virtual void DisposeManagedResources()
+ {
+ }
+
+ protected virtual void DisposeNativeResources()
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Data/GlowWindow/ChangeScope.cs b/src/Shared/HandyControl_Shared/Data/GlowWindow/ChangeScope.cs
new file mode 100644
index 00000000..699461c2
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Data/GlowWindow/ChangeScope.cs
@@ -0,0 +1,21 @@
+using HandyControl.Controls;
+
+namespace HandyControl.Data
+{
+ internal class ChangeScope : DisposableObject
+ {
+ private readonly GlowWindow _window;
+
+ public ChangeScope(GlowWindow window)
+ {
+ _window = window;
+ _window.DeferGlowChangesCount++;
+ }
+
+ protected override void DisposeManagedResources()
+ {
+ _window.DeferGlowChangesCount--;
+ if (_window.DeferGlowChangesCount == 0) _window.EndDeferGlowChanges();
+ }
+ }
+}
diff --git a/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowBitmap.cs b/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowBitmap.cs
new file mode 100644
index 00000000..e75f1681
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowBitmap.cs
@@ -0,0 +1,114 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using HandyControl.Tools.Interop;
+
+namespace HandyControl.Data
+{
+ internal class GlowBitmap : DisposableObject
+ {
+ internal const int GlowBitmapPartCount = 16;
+
+ private const int BytesPerPixelBgra32 = 4;
+
+ private static readonly CachedBitmapInfo[] _transparencyMasks = new CachedBitmapInfo[GlowBitmapPartCount];
+
+ private readonly InteropValues.BITMAPINFO _bitmapInfo;
+
+ private readonly IntPtr _pbits;
+
+ internal GlowBitmap(IntPtr hdcScreen, int width, int height)
+ {
+ _bitmapInfo.biSize = Marshal.SizeOf(typeof(InteropValues.BITMAPINFOHEADER));
+ _bitmapInfo.biPlanes = 1;
+ _bitmapInfo.biBitCount = 32;
+ _bitmapInfo.biCompression = 0;
+ _bitmapInfo.biXPelsPerMeter = 0;
+ _bitmapInfo.biYPelsPerMeter = 0;
+ _bitmapInfo.biWidth = width;
+ _bitmapInfo.biHeight = -height;
+
+ Handle = InteropMethods.CreateDIBSection(
+ hdcScreen,
+ ref _bitmapInfo,
+ 0u,
+ out _pbits,
+ IntPtr.Zero,
+ 0u);
+ }
+
+ internal IntPtr Handle { get; }
+
+ internal IntPtr DIBits => _pbits;
+
+ internal int Width => _bitmapInfo.biWidth;
+
+ internal int Height => -_bitmapInfo.biHeight;
+
+ protected override void DisposeNativeResources() => InteropMethods.DeleteObject(Handle);
+
+ private static byte PremultiplyAlpha(byte channel, byte alpha) => (byte)(channel * alpha / 255.0);
+
+ internal static GlowBitmap Create(GlowDrawingContext drawingContext, GlowBitmapPart bitmapPart, Color color)
+ {
+ var orCreateAlphaMask =
+ GetOrCreateAlphaMask(bitmapPart);
+
+ var glowBitmap =
+ new GlowBitmap(
+ drawingContext.ScreenDC,
+ orCreateAlphaMask.Width,
+ orCreateAlphaMask.Height);
+
+ for (var i = 0; i < orCreateAlphaMask.DIBits.Length; i += BytesPerPixelBgra32)
+ {
+ var b = orCreateAlphaMask.DIBits[i + 3];
+ var val = PremultiplyAlpha(color.R, b);
+ var val2 = PremultiplyAlpha(color.G, b);
+ var val3 = PremultiplyAlpha(color.B, b);
+ Marshal.WriteByte(glowBitmap.DIBits, i, val3);
+ Marshal.WriteByte(glowBitmap.DIBits, i + 1, val2);
+ Marshal.WriteByte(glowBitmap.DIBits, i + 2, val);
+ Marshal.WriteByte(glowBitmap.DIBits, i + 3, b);
+ }
+
+ return glowBitmap;
+ }
+
+ private static CachedBitmapInfo GetOrCreateAlphaMask(GlowBitmapPart bitmapPart)
+ {
+ if (_transparencyMasks[(int)bitmapPart] == null)
+ {
+ var bitmapImage = new BitmapImage(new Uri($"pack://application:,,,/HandyControl;Component/Resources/Images/GlowWindow/{bitmapPart}.png"));
+
+ var array = new byte[BytesPerPixelBgra32 * bitmapImage.PixelWidth * bitmapImage.PixelHeight];
+ var stride = BytesPerPixelBgra32 * bitmapImage.PixelWidth;
+ bitmapImage.CopyPixels(array, stride, 0);
+ bitmapImage.Freeze();
+
+ _transparencyMasks[(int)bitmapPart] =
+ new CachedBitmapInfo(
+ array,
+ bitmapImage.PixelWidth,
+ bitmapImage.PixelHeight);
+ }
+
+ return _transparencyMasks[(int)bitmapPart];
+ }
+
+ private sealed class CachedBitmapInfo
+ {
+ internal readonly byte[] DIBits;
+ internal readonly int Height;
+ internal readonly int Width;
+
+ internal CachedBitmapInfo(byte[] diBits, int width, int height)
+ {
+ Width = width;
+ Height = height;
+ DIBits = diBits;
+ }
+ }
+ }
+}
diff --git a/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowBitmapPart.cs b/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowBitmapPart.cs
new file mode 100644
index 00000000..b1c0b061
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowBitmapPart.cs
@@ -0,0 +1,22 @@
+namespace HandyControl.Data
+{
+ internal enum GlowBitmapPart
+ {
+ CornerTopLeft,
+ CornerTopRight,
+ CornerBottomLeft,
+ CornerBottomRight,
+ TopLeft,
+ Top,
+ TopRight,
+ LeftTop,
+ Left,
+ LeftBottom,
+ BottomLeft,
+ Bottom,
+ BottomRight,
+ RightTop,
+ Right,
+ RightBottom
+ }
+}
diff --git a/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowDrawingContext.cs b/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowDrawingContext.cs
new file mode 100644
index 00000000..6d9b7388
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowDrawingContext.cs
@@ -0,0 +1,51 @@
+using System;
+using HandyControl.Tools.Interop;
+
+namespace HandyControl.Data
+{
+ internal class GlowDrawingContext : DisposableObject
+ {
+ private readonly GlowBitmap _windowBitmap;
+
+ internal InteropValues.BLENDFUNCTION Blend;
+
+ internal GlowDrawingContext(int width, int height)
+ {
+ ScreenDC = InteropMethods.GetDC(IntPtr.Zero);
+ if (ScreenDC == IntPtr.Zero) return;
+ WindowDC = InteropMethods.CreateCompatibleDC(ScreenDC);
+ if (WindowDC == IntPtr.Zero) return;
+ BackgroundDC = InteropMethods.CreateCompatibleDC(ScreenDC);
+ if (BackgroundDC == IntPtr.Zero) return;
+ Blend.BlendOp = 0;
+ Blend.BlendFlags = 0;
+ Blend.SourceConstantAlpha = 255;
+ Blend.AlphaFormat = 1;
+ _windowBitmap = new GlowBitmap(ScreenDC, width, height);
+ InteropMethods.SelectObject(WindowDC, _windowBitmap.Handle);
+ }
+
+ internal bool IsInitialized =>
+ ScreenDC != IntPtr.Zero && WindowDC != IntPtr.Zero &&
+ BackgroundDC != IntPtr.Zero && _windowBitmap != null;
+
+ internal IntPtr ScreenDC { get; }
+
+ internal IntPtr WindowDC { get; }
+
+ internal IntPtr BackgroundDC { get; }
+
+ internal int Width => _windowBitmap.Width;
+
+ internal int Height => _windowBitmap.Height;
+
+ protected override void DisposeManagedResources() => _windowBitmap.Dispose();
+
+ protected override void DisposeNativeResources()
+ {
+ if (ScreenDC != IntPtr.Zero) InteropMethods.ReleaseDC(IntPtr.Zero, ScreenDC);
+ if (WindowDC != IntPtr.Zero) InteropMethods.DeleteDC(WindowDC);
+ if (BackgroundDC != IntPtr.Zero) InteropMethods.DeleteDC(BackgroundDC);
+ }
+ }
+}
diff --git a/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowEdge.cs b/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowEdge.cs
new file mode 100644
index 00000000..0fd7818a
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Data/GlowWindow/GlowEdge.cs
@@ -0,0 +1,587 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Windows.Controls;
+using System.Windows.Interop;
+using System.Windows.Media;
+using HandyControl.Controls;
+using HandyControl.Tools.Interop;
+
+namespace HandyControl.Data
+{
+ internal class GlowEdge : HwndWrapper
+ {
+ private const string GlowEdgeClassName = "HandyControlGlowEdge";
+
+ private const int GlowDepth = 9;
+
+ private const int CornerGripThickness = 18;
+
+ private static ushort _sharedWindowClassAtom;
+
+ // ReSharper disable once NotAccessedField.Local
+ private static InteropValues.WndProc _sharedWndProc;
+
+ private readonly GlowBitmap[] _activeGlowBitmaps = new GlowBitmap[16];
+
+ private readonly GlowBitmap[] _inactiveGlowBitmaps = new GlowBitmap[16];
+
+ private readonly Dock _orientation;
+
+ private readonly GlowWindow _targetWindow;
+
+ private Color _activeGlowColor = Colors.Transparent;
+
+ private int _height;
+
+ private Color _inactiveGlowColor = Colors.Transparent;
+
+ private FieldInvalidationTypes _invalidatedValues;
+
+ private bool _isActive;
+
+ private bool _isVisible;
+
+ private int _left;
+
+ private bool _pendingDelayRender;
+
+ private int _top;
+
+ private int _width;
+
+ internal static long CreatedGlowEdges { get; private set; }
+
+ internal static long DisposedGlowEdges { get; private set; }
+
+ internal GlowEdge(GlowWindow owner, Dock orientation)
+ {
+ _targetWindow = owner ?? throw new ArgumentNullException(nameof(owner));
+ _orientation = orientation;
+ CreatedGlowEdges += 1L;
+ }
+
+ private bool IsDeferringChanges => _targetWindow.DeferGlowChangesCount > 0;
+
+ private static ushort SharedWindowClassAtom
+ {
+ get
+ {
+ if (_sharedWindowClassAtom == 0)
+ {
+ var wndclass = default(InteropValues.WNDCLASS);
+
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = 0;
+ wndclass.hbrBackground = IntPtr.Zero;
+ wndclass.hCursor = IntPtr.Zero;
+ wndclass.hIcon = IntPtr.Zero;
+ wndclass.lpfnWndProc = _sharedWndProc = InteropMethods.DefWindowProc;
+ wndclass.lpszClassName = GlowEdgeClassName;
+ wndclass.lpszMenuName = null;
+ wndclass.style = 0u;
+
+ _sharedWindowClassAtom = InteropMethods.RegisterClass(ref wndclass);
+ }
+
+ return _sharedWindowClassAtom;
+ }
+ }
+
+ internal bool IsVisible
+ {
+ get => _isVisible;
+ set => UpdateProperty(ref _isVisible, value, FieldInvalidationTypes.Render | FieldInvalidationTypes.Visibility);
+ }
+
+ internal int Left
+ {
+ get => _left;
+ set => UpdateProperty(ref _left, value, FieldInvalidationTypes.Location);
+ }
+
+ internal int Top
+ {
+ get => _top;
+ set => UpdateProperty(ref _top, value, FieldInvalidationTypes.Location);
+ }
+
+ internal int Width
+ {
+ get => _width;
+ set => UpdateProperty( ref _width, value, FieldInvalidationTypes.Size | FieldInvalidationTypes.Render);
+ }
+
+ internal int Height
+ {
+ get => _height;
+ set => UpdateProperty(ref _height, value, FieldInvalidationTypes.Size | FieldInvalidationTypes.Render);
+ }
+
+ internal bool IsActive
+ {
+ get => _isActive;
+ set => UpdateProperty(ref _isActive, value, FieldInvalidationTypes.Render);
+ }
+
+ internal Color ActiveGlowColor
+ {
+ get => _activeGlowColor;
+ set => UpdateProperty(ref _activeGlowColor, value, FieldInvalidationTypes.ActiveColor | FieldInvalidationTypes.Render);
+ }
+
+ internal Color InactiveGlowColor
+ {
+ get => _inactiveGlowColor;
+ set => UpdateProperty(ref _inactiveGlowColor, value, FieldInvalidationTypes.InactiveColor | FieldInvalidationTypes.Render);
+ }
+
+ private IntPtr TargetWindowHandle => new WindowInteropHelper(_targetWindow).Handle;
+
+ protected override bool IsWindowSubclassed => true;
+
+ private bool IsPositionValid => (_invalidatedValues & (FieldInvalidationTypes.Location | FieldInvalidationTypes.Size | FieldInvalidationTypes.Visibility)) == FieldInvalidationTypes.None;
+
+ private void UpdateProperty(ref T field, T value, FieldInvalidationTypes invalidatedValues) where T : struct
+ {
+ if (!field.Equals(value))
+ {
+ field = value;
+ _invalidatedValues |= invalidatedValues;
+ if (!IsDeferringChanges) CommitChanges();
+ }
+ }
+
+ protected override ushort CreateWindowClassCore() => SharedWindowClassAtom;
+
+ protected override void DestroyWindowClassCore()
+ {
+ }
+
+ protected override IntPtr CreateWindowCore()
+ {
+ return InteropMethods.CreateWindowEx(
+ 524416,
+ new IntPtr(WindowClassAtom),
+ string.Empty,
+ -2046820352,
+ 0,
+ 0,
+ 0,
+ 0,
+ new WindowInteropHelper(_targetWindow).Owner,
+ IntPtr.Zero,
+ IntPtr.Zero,
+ IntPtr.Zero);
+ }
+
+ internal void ChangeOwner(IntPtr newOwner) => InteropMethods.SetWindowLongPtr(Handle, InteropValues.GWLP.HWNDPARENT, newOwner);
+
+ protected override IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam)
+ {
+ if (msg <= 70)
+ {
+ if (msg == 6) return IntPtr.Zero;
+ if (msg == 70)
+ {
+ var windowpos = (InteropValues.WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(InteropValues.WINDOWPOS));
+ windowpos.flags |= 16u;
+ Marshal.StructureToPtr(windowpos, lParam, true);
+ }
+ }
+ else
+ {
+ if (msg != 126)
+ {
+ if (msg == 132) return new IntPtr(WmNcHitTest(lParam));
+ switch (msg)
+ {
+ case 161:
+ case 163:
+ case 164:
+ case 166:
+ case 167:
+ case 169:
+ case 171:
+ case 173:
+ {
+ var targetWindowHandle = TargetWindowHandle;
+ InteropMethods.SendMessage(targetWindowHandle, 6, new IntPtr(2), IntPtr.Zero);
+ InteropMethods.SendMessage(targetWindowHandle, msg, wParam, IntPtr.Zero);
+ return IntPtr.Zero;
+ }
+ }
+ }
+ else
+ {
+ if (IsVisible) RenderLayeredWindow();
+ }
+ }
+
+ return base.WndProc(hwnd, msg, wParam, lParam);
+ }
+
+ private int WmNcHitTest(IntPtr lParam)
+ {
+ var xLParam = InteropMethods.GetXLParam(lParam.ToInt32());
+ var yLParam = InteropMethods.GetYLParam(lParam.ToInt32());
+ InteropMethods.GetWindowRect(Handle, out var rect);
+ switch (_orientation)
+ {
+ case Dock.Left:
+ if (yLParam - CornerGripThickness < rect.Top) return 13;
+ if (yLParam + CornerGripThickness > rect.Bottom) return 16;
+ return 10;
+ case Dock.Top:
+ if (xLParam - CornerGripThickness < rect.Left) return 13;
+ if (xLParam + CornerGripThickness > rect.Right) return 14;
+ return 12;
+ case Dock.Right:
+ if (yLParam - CornerGripThickness < rect.Top) return 14;
+ if (yLParam + CornerGripThickness > rect.Bottom) return 17;
+ return 11;
+ default:
+ if (xLParam - CornerGripThickness < rect.Left) return 16;
+ if (xLParam + CornerGripThickness > rect.Right) return 17;
+ return 15;
+ }
+ }
+
+ internal void CommitChanges()
+ {
+ InvalidateCachedBitmaps();
+ UpdateWindowPosCore();
+ UpdateLayeredWindowCore();
+ _invalidatedValues = FieldInvalidationTypes.None;
+ }
+
+ private void InvalidateCachedBitmaps()
+ {
+ if (_invalidatedValues.HasFlag(FieldInvalidationTypes.ActiveColor)) ClearCache(_activeGlowBitmaps);
+ if (_invalidatedValues.HasFlag(FieldInvalidationTypes.InactiveColor)) ClearCache(_inactiveGlowBitmaps);
+ }
+
+ private void UpdateWindowPosCore()
+ {
+ if (_invalidatedValues.HasFlag(FieldInvalidationTypes.Location) ||
+ _invalidatedValues.HasFlag(FieldInvalidationTypes.Size) ||
+ _invalidatedValues.HasFlag(FieldInvalidationTypes.Visibility))
+ {
+ var num = 532;
+ if (_invalidatedValues.HasFlag(FieldInvalidationTypes.Visibility))
+ {
+ if (IsVisible)
+ num |= 64;
+ else
+ num |= 131;
+ }
+
+ if (!_invalidatedValues.HasFlag(FieldInvalidationTypes.Location)) num |= 2;
+ if (!_invalidatedValues.HasFlag(FieldInvalidationTypes.Size)) num |= 1;
+ InteropMethods.SetWindowPos(Handle, IntPtr.Zero, Left, Top, Width, Height, num);
+ }
+ }
+
+ private void UpdateLayeredWindowCore()
+ {
+ if (IsVisible && _invalidatedValues.HasFlag(FieldInvalidationTypes.Render))
+ {
+ if (IsPositionValid)
+ {
+ BeginDelayedRender();
+ return;
+ }
+
+ CancelDelayedRender();
+ RenderLayeredWindow();
+ }
+ }
+
+ private void BeginDelayedRender()
+ {
+ if (!_pendingDelayRender)
+ {
+ _pendingDelayRender = true;
+ CompositionTarget.Rendering += CommitDelayedRender;
+ }
+ }
+
+ private void CancelDelayedRender()
+ {
+ if (_pendingDelayRender)
+ {
+ _pendingDelayRender = false;
+ CompositionTarget.Rendering -= CommitDelayedRender;
+ }
+ }
+
+ private void CommitDelayedRender(object sender, EventArgs e)
+ {
+ CancelDelayedRender();
+ if (IsVisible) RenderLayeredWindow();
+ }
+
+ private void RenderLayeredWindow()
+ {
+ using var glowDrawingContext = new GlowDrawingContext(Width, Height);
+ if (glowDrawingContext.IsInitialized)
+ {
+ switch (_orientation)
+ {
+ case Dock.Left:
+ DrawLeft(glowDrawingContext);
+ break;
+ case Dock.Top:
+ DrawTop(glowDrawingContext);
+ break;
+ case Dock.Right:
+ DrawRight(glowDrawingContext);
+ break;
+ default:
+ DrawBottom(glowDrawingContext);
+ break;
+ }
+
+ var point = new InteropValues.POINT
+ {
+ X = Left,
+ Y = Top
+ };
+ var size = new InteropValues.SIZE
+ {
+ cx = Width,
+ cy = Height
+ };
+ var point2 = new InteropValues.POINT
+ {
+ X = 0,
+ Y = 0
+ };
+
+ InteropMethods.UpdateLayeredWindow(
+ Handle,
+ glowDrawingContext.ScreenDC,
+ ref point,
+ ref size,
+ glowDrawingContext.WindowDC,
+ ref point2,
+ 0u,
+ ref glowDrawingContext.Blend,
+ 2u);
+ }
+ }
+
+ private GlowBitmap GetOrCreateBitmap(GlowDrawingContext drawingContext, GlowBitmapPart bitmapPart)
+ {
+ GlowBitmap[] array;
+ Color color;
+ if (IsActive)
+ {
+ array = _activeGlowBitmaps;
+ color = ActiveGlowColor;
+ }
+ else
+ {
+ array = _inactiveGlowBitmaps;
+ color = InactiveGlowColor;
+ }
+
+ return array[(int) bitmapPart] ?? (array[(int) bitmapPart] = GlowBitmap.Create(drawingContext, bitmapPart, color));
+ }
+
+ private void ClearCache(GlowBitmap[] cache)
+ {
+ for (var i = 0; i < cache.Length; i++)
+ using (cache[i])
+ {
+ cache[i] = null;
+ }
+ }
+
+ protected override void DisposeManagedResources()
+ {
+ ClearCache(_activeGlowBitmaps);
+ ClearCache(_inactiveGlowBitmaps);
+ }
+
+ protected override void DisposeNativeResources()
+ {
+ base.DisposeNativeResources();
+ DisposedGlowEdges += 1L;
+ }
+
+ private void DrawLeft(GlowDrawingContext drawingContext)
+ {
+ var orCreateBitmap = GetOrCreateBitmap(drawingContext, GlowBitmapPart.CornerTopLeft);
+ var orCreateBitmap2 = GetOrCreateBitmap(drawingContext, GlowBitmapPart.LeftTop);
+ var orCreateBitmap3 = GetOrCreateBitmap(drawingContext, GlowBitmapPart.Left);
+ var orCreateBitmap4 = GetOrCreateBitmap(drawingContext, GlowBitmapPart.LeftBottom);
+ var orCreateBitmap5 = GetOrCreateBitmap(drawingContext, GlowBitmapPart.CornerBottomLeft);
+ var height = orCreateBitmap.Height;
+ var num = height + orCreateBitmap2.Height;
+ var num2 = drawingContext.Height - orCreateBitmap5.Height;
+ var num3 = num2 - orCreateBitmap4.Height;
+ var num4 = num3 - num;
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, 0, 0, orCreateBitmap.Width, orCreateBitmap.Height,
+ drawingContext.BackgroundDC, 0, 0, orCreateBitmap.Width, orCreateBitmap.Height,
+ drawingContext.Blend);
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap2.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, 0, height, orCreateBitmap2.Width,
+ orCreateBitmap2.Height, drawingContext.BackgroundDC, 0, 0, orCreateBitmap2.Width,
+ orCreateBitmap2.Height, drawingContext.Blend);
+ if (num4 > 0)
+ {
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap3.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, 0, num, orCreateBitmap3.Width, num4,
+ drawingContext.BackgroundDC, 0, 0, orCreateBitmap3.Width, orCreateBitmap3.Height,
+ drawingContext.Blend);
+ }
+
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap4.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, 0, num3, orCreateBitmap4.Width,
+ orCreateBitmap4.Height, drawingContext.BackgroundDC, 0, 0, orCreateBitmap4.Width,
+ orCreateBitmap4.Height, drawingContext.Blend);
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap5.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, 0, num2, orCreateBitmap5.Width,
+ orCreateBitmap5.Height, drawingContext.BackgroundDC, 0, 0, orCreateBitmap5.Width,
+ orCreateBitmap5.Height, drawingContext.Blend);
+ }
+
+ private void DrawRight(GlowDrawingContext drawingContext)
+ {
+ var orCreateBitmap = GetOrCreateBitmap(drawingContext, GlowBitmapPart.CornerTopRight);
+ var orCreateBitmap2 = GetOrCreateBitmap(drawingContext, GlowBitmapPart.RightTop);
+ var orCreateBitmap3 = GetOrCreateBitmap(drawingContext, GlowBitmapPart.Right);
+ var orCreateBitmap4 = GetOrCreateBitmap(drawingContext, GlowBitmapPart.RightBottom);
+ var orCreateBitmap5 = GetOrCreateBitmap(drawingContext, GlowBitmapPart.CornerBottomRight);
+ var height = orCreateBitmap.Height;
+ var num = height + orCreateBitmap2.Height;
+ var num2 = drawingContext.Height - orCreateBitmap5.Height;
+ var num3 = num2 - orCreateBitmap4.Height;
+ var num4 = num3 - num;
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, 0, 0, orCreateBitmap.Width, orCreateBitmap.Height,
+ drawingContext.BackgroundDC, 0, 0, orCreateBitmap.Width, orCreateBitmap.Height,
+ drawingContext.Blend);
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap2.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, 0, height, orCreateBitmap2.Width,
+ orCreateBitmap2.Height, drawingContext.BackgroundDC, 0, 0, orCreateBitmap2.Width,
+ orCreateBitmap2.Height, drawingContext.Blend);
+ if (num4 > 0)
+ {
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap3.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, 0, num, orCreateBitmap3.Width, num4,
+ drawingContext.BackgroundDC, 0, 0, orCreateBitmap3.Width, orCreateBitmap3.Height,
+ drawingContext.Blend);
+ }
+
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap4.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, 0, num3, orCreateBitmap4.Width,
+ orCreateBitmap4.Height, drawingContext.BackgroundDC, 0, 0, orCreateBitmap4.Width,
+ orCreateBitmap4.Height, drawingContext.Blend);
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap5.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, 0, num2, orCreateBitmap5.Width,
+ orCreateBitmap5.Height, drawingContext.BackgroundDC, 0, 0, orCreateBitmap5.Width,
+ orCreateBitmap5.Height, drawingContext.Blend);
+ }
+
+ private void DrawTop(GlowDrawingContext drawingContext)
+ {
+ var orCreateBitmap = GetOrCreateBitmap(drawingContext, GlowBitmapPart.TopLeft);
+ var orCreateBitmap2 = GetOrCreateBitmap(drawingContext, GlowBitmapPart.Top);
+ var orCreateBitmap3 = GetOrCreateBitmap(drawingContext, GlowBitmapPart.TopRight);
+ var num2 = GlowDepth + orCreateBitmap.Width;
+ var num3 = drawingContext.Width - GlowDepth - orCreateBitmap3.Width;
+ var num4 = num3 - num2;
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, GlowDepth, 0, orCreateBitmap.Width, orCreateBitmap.Height,
+ drawingContext.BackgroundDC, 0, 0, orCreateBitmap.Width, orCreateBitmap.Height,
+ drawingContext.Blend);
+ if (num4 > 0)
+ {
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap2.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, num2, 0, num4, orCreateBitmap2.Height,
+ drawingContext.BackgroundDC, 0, 0, orCreateBitmap2.Width, orCreateBitmap2.Height,
+ drawingContext.Blend);
+ }
+
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap3.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, num3, 0, orCreateBitmap3.Width,
+ orCreateBitmap3.Height, drawingContext.BackgroundDC, 0, 0, orCreateBitmap3.Width,
+ orCreateBitmap3.Height, drawingContext.Blend);
+ }
+
+ private void DrawBottom(GlowDrawingContext drawingContext)
+ {
+ var orCreateBitmap = GetOrCreateBitmap(drawingContext, GlowBitmapPart.BottomLeft);
+ var orCreateBitmap2 = GetOrCreateBitmap(drawingContext, GlowBitmapPart.Bottom);
+ var orCreateBitmap3 = GetOrCreateBitmap(drawingContext, GlowBitmapPart.BottomRight);
+ var num2 = GlowDepth + orCreateBitmap.Width;
+ var num3 = drawingContext.Width - GlowDepth - orCreateBitmap3.Width;
+ var num4 = num3 - num2;
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, GlowDepth, 0, orCreateBitmap.Width, orCreateBitmap.Height,
+ drawingContext.BackgroundDC, 0, 0, orCreateBitmap.Width, orCreateBitmap.Height,
+ drawingContext.Blend);
+ if (num4 > 0)
+ {
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap2.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, num2, 0, num4, orCreateBitmap2.Height,
+ drawingContext.BackgroundDC, 0, 0, orCreateBitmap2.Width, orCreateBitmap2.Height,
+ drawingContext.Blend);
+ }
+
+ InteropMethods.SelectObject(drawingContext.BackgroundDC, orCreateBitmap3.Handle);
+ InteropMethods.AlphaBlend(drawingContext.WindowDC, num3, 0, orCreateBitmap3.Width,
+ orCreateBitmap3.Height, drawingContext.BackgroundDC, 0, 0, orCreateBitmap3.Width,
+ orCreateBitmap3.Height, drawingContext.Blend);
+ }
+
+ internal void UpdateWindowPos()
+ {
+ var targetWindowHandle = TargetWindowHandle;
+ InteropMethods.GetWindowRect(targetWindowHandle, out var rect);
+ InteropMethods.GetWindowPlacement(targetWindowHandle);
+ if (IsVisible)
+ switch (_orientation)
+ {
+ case Dock.Left:
+ Left = rect.Left - GlowDepth;
+ Top = rect.Top - GlowDepth;
+ Width = GlowDepth;
+ Height = rect.Height + CornerGripThickness;
+ return;
+ case Dock.Top:
+ Left = rect.Left - GlowDepth;
+ Top = rect.Top - GlowDepth;
+ Width = rect.Width + CornerGripThickness;
+ Height = GlowDepth;
+ return;
+ case Dock.Right:
+ Left = rect.Right;
+ Top = rect.Top - GlowDepth;
+ Width = GlowDepth;
+ Height = rect.Height + CornerGripThickness;
+ return;
+ default:
+ Left = rect.Left - GlowDepth;
+ Top = rect.Bottom;
+ Width = rect.Width + CornerGripThickness;
+ Height = GlowDepth;
+ break;
+ }
+ }
+
+ [Flags]
+ private enum FieldInvalidationTypes
+ {
+ None = 0,
+ Location = 1,
+ Size = 2,
+ ActiveColor = 4,
+ InactiveColor = 8,
+ Render = 16,
+ Visibility = 32
+ }
+ }
+}
diff --git a/src/Shared/HandyControl_Shared/Data/HandyControlConfig.cs b/src/Shared/HandyControl_Shared/Data/HandyControlConfig.cs
index 88702c88..4e6d9a23 100644
--- a/src/Shared/HandyControl_Shared/Data/HandyControlConfig.cs
+++ b/src/Shared/HandyControl_Shared/Data/HandyControlConfig.cs
@@ -5,5 +5,7 @@
public SystemVersionInfo SystemVersionInfo { get; set; }
public string Lang { get; set; }
+
+ public int TimelineFrameRate { get; set; } = 60;
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Data/HwndWrapper.cs b/src/Shared/HandyControl_Shared/Data/HwndWrapper.cs
new file mode 100644
index 00000000..ff0f69d0
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Data/HwndWrapper.cs
@@ -0,0 +1,102 @@
+using System;
+using System.Runtime.InteropServices;
+using HandyControl.Tools.Interop;
+
+namespace HandyControl.Data
+{
+ public abstract class HwndWrapper : DisposableObject
+ {
+ private IntPtr _handle;
+
+ private bool _isHandleCreationAllowed = true;
+
+ private ushort _wndClassAtom;
+
+ private Delegate _wndProc;
+
+ protected ushort WindowClassAtom
+ {
+ get
+ {
+ if (_wndClassAtom == 0) _wndClassAtom = CreateWindowClassCore();
+ return _wndClassAtom;
+ }
+ }
+
+ public IntPtr Handle
+ {
+ get
+ {
+ EnsureHandle();
+ return _handle;
+ }
+ }
+
+ protected virtual bool IsWindowSubclassed => false;
+
+ protected virtual ushort CreateWindowClassCore() => RegisterClass(Guid.NewGuid().ToString());
+
+ protected virtual void DestroyWindowClassCore()
+ {
+ if (_wndClassAtom != 0)
+ {
+ var moduleHandle = InteropMethods.GetModuleHandle(null);
+ InteropMethods.UnregisterClass(new IntPtr(_wndClassAtom), moduleHandle);
+ _wndClassAtom = 0;
+ }
+ }
+
+ protected ushort RegisterClass(string className)
+ {
+ var wndClass = default(InteropValues.WNDCLASS);
+ wndClass.cbClsExtra = 0;
+ wndClass.cbWndExtra = 0;
+ wndClass.hbrBackground = IntPtr.Zero;
+ wndClass.hCursor = IntPtr.Zero;
+ wndClass.hIcon = IntPtr.Zero;
+ wndClass.lpfnWndProc = _wndProc = new InteropValues.WndProc(WndProc);
+ wndClass.lpszClassName = className;
+ wndClass.lpszMenuName = null;
+ wndClass.style = 0u;
+ return InteropMethods.RegisterClass(ref wndClass);
+ }
+
+ private void SubclassWndProc()
+ {
+ _wndProc = new InteropValues.WndProc(WndProc);
+ InteropMethods.SetWindowLong(_handle, -4, Marshal.GetFunctionPointerForDelegate(_wndProc));
+ }
+
+ protected abstract IntPtr CreateWindowCore();
+
+ protected virtual void DestroyWindowCore()
+ {
+ if (_handle != IntPtr.Zero)
+ {
+ InteropMethods.DestroyWindow(_handle);
+ _handle = IntPtr.Zero;
+ }
+ }
+
+ protected virtual IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam) =>
+ InteropMethods.DefWindowProc(hwnd, msg, wParam, lParam);
+
+ public void EnsureHandle()
+ {
+ if (_handle == IntPtr.Zero)
+ {
+ if (!_isHandleCreationAllowed) return;
+ _isHandleCreationAllowed = false;
+ _handle = CreateWindowCore();
+ if (IsWindowSubclassed) SubclassWndProc();
+ }
+ }
+
+ protected override void DisposeNativeResources()
+ {
+ _isHandleCreationAllowed = false;
+ DestroyWindowCore();
+ DestroyWindowClassCore();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Data/ResourceToken.cs b/src/Shared/HandyControl_Shared/Data/ResourceToken.cs
index 0b2bfcae..3b9d94bf 100644
--- a/src/Shared/HandyControl_Shared/Data/ResourceToken.cs
+++ b/src/Shared/HandyControl_Shared/Data/ResourceToken.cs
@@ -302,6 +302,10 @@
internal const string WindowWin10 = nameof(WindowWin10);
+ internal const string WindowBlur = nameof(WindowBlur);
+
+ internal const string WindowGlow = nameof(WindowGlow);
+
internal const string AddTagButtonStyle = nameof(AddTagButtonStyle);
internal const string RadioGroupItemDefault = nameof(RadioGroupItemDefault);
diff --git a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
index 32cab771..8f137a9f 100644
--- a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
+++ b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
@@ -41,6 +41,8 @@
+
+
@@ -48,6 +50,12 @@
+
+
+
+
+
+
@@ -70,6 +78,7 @@
+
@@ -299,6 +308,7 @@
+
@@ -309,20 +319,14 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -394,6 +398,26 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
@@ -923,4 +947,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Interactivity/Commands/PushMainWindow2TopCommand.cs b/src/Shared/HandyControl_Shared/Interactivity/Commands/PushMainWindow2TopCommand.cs
index 65e96979..07a2427c 100644
--- a/src/Shared/HandyControl_Shared/Interactivity/Commands/PushMainWindow2TopCommand.cs
+++ b/src/Shared/HandyControl_Shared/Interactivity/Commands/PushMainWindow2TopCommand.cs
@@ -18,7 +18,7 @@ namespace HandyControl.Interactivity
var hwndSource = (HwndSource)PresentationSource.FromDependencyObject(Application.Current.MainWindow);
if (hwndSource != null)
{
- UnsafeNativeMethods.SetForegroundWindow(hwndSource.Handle);
+ InteropMethods.SetForegroundWindow(hwndSource.Handle);
}
}
}
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs
index d9db4d8d..cc31cac1 100644
--- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs
@@ -320,5 +320,23 @@ namespace HandyControl.Properties.Langs {
return ResourceManager.GetString("Yes", resourceCulture);
}
}
+
+ ///
+ /// 查找类似 放大 的本地化字符串。
+ ///
+ public static string ZoomIn {
+ get {
+ return ResourceManager.GetString("ZoomIn", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 缩小 的本地化字符串。
+ ///
+ public static string ZoomOut {
+ get {
+ return ResourceManager.GetString("ZoomOut", resourceCulture);
+ }
+ }
}
}
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.en.resx
index 28b6a0dc..4992c864 100644
--- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.en.resx
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.en.resx
@@ -184,4 +184,10 @@
No
+
+ Zoom in
+
+
+ Zoom out
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fa.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fa.resx
index 58de5d70..166a0b08 100644
--- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fa.resx
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fa.resx
@@ -184,4 +184,10 @@
خیر
+
+ Zoom in
+
+
+ Zoom out
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fr.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fr.resx
index f616fa21..c400a1f2 100644
--- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fr.resx
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fr.resx
@@ -204,4 +204,10 @@
Non
+
+ Zoom in
+
+
+ Zoom out
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx
index 295d0acb..2579b146 100644
--- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx
@@ -204,4 +204,10 @@
네
+
+ Zoom in
+
+
+ Zoom out
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx
index 76827085..679dd9bb 100644
--- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx
@@ -184,4 +184,10 @@
否
+
+ 放大
+
+
+ 缩小
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottom.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottom.png
new file mode 100644
index 00000000..11b8dc5e
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottom.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottomleft.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottomleft.png
new file mode 100644
index 00000000..8dcf7cc6
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottomleft.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottomright.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottomright.png
new file mode 100644
index 00000000..16558870
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottomright.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornerbottomleft.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornerbottomleft.png
new file mode 100644
index 00000000..91bd8329
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornerbottomleft.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornerbottomright.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornerbottomright.png
new file mode 100644
index 00000000..07528f32
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornerbottomright.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornertopleft.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornertopleft.png
new file mode 100644
index 00000000..4c344967
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornertopleft.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornertopright.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornertopright.png
new file mode 100644
index 00000000..b0ab1a22
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornertopright.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/left.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/left.png
new file mode 100644
index 00000000..22430933
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/left.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/leftbottom.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/leftbottom.png
new file mode 100644
index 00000000..025d9496
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/leftbottom.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/lefttop.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/lefttop.png
new file mode 100644
index 00000000..6456879b
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/lefttop.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/right.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/right.png
new file mode 100644
index 00000000..67dfd001
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/right.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/rightbottom.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/rightbottom.png
new file mode 100644
index 00000000..3a7ea61b
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/rightbottom.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/righttop.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/righttop.png
new file mode 100644
index 00000000..58b35960
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/righttop.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/top.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/top.png
new file mode 100644
index 00000000..c5c30ca6
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/top.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/topleft.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/topleft.png
new file mode 100644
index 00000000..b3fef880
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/topleft.png differ
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/topright.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/topright.png
new file mode 100644
index 00000000..d6129fe7
Binary files /dev/null and b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/topright.png differ
diff --git a/src/Shared/HandyControl_Shared/Themes/Basic/Brushes.xaml b/src/Shared/HandyControl_Shared/Themes/Basic/Brushes.xaml
index 555392d9..93849725 100644
--- a/src/Shared/HandyControl_Shared/Themes/Basic/Brushes.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Basic/Brushes.xaml
@@ -1,60 +1,61 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:o="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options">
-
-
-
+
+
+
-
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
+
+
+
-
+
-
-
-
+
+
+
-
+
-
-
-
+
+
+
-
+
-
-
-
+
+
+
-
+
-
-
+
+
-
-
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Basic/Effects.xaml b/src/Shared/HandyControl_Shared/Themes/Basic/Effects.xaml
index da3428ff..a48cb76a 100644
--- a/src/Shared/HandyControl_Shared/Themes/Basic/Effects.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Basic/Effects.xaml
@@ -1,13 +1,13 @@
+ xmlns:o="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options">
#AA000000
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Basic/Geometries.xaml b/src/Shared/HandyControl_Shared/Themes/Basic/Geometries.xaml
index 58fe7055..7d375239 100644
--- a/src/Shared/HandyControl_Shared/Themes/Basic/Geometries.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Basic/Geometries.xaml
@@ -1,44 +1,45 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:o="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options">
- M377.897477 116.291025l265.298718 0 0 47.459125-265.298718 0 0-47.459125ZM888.317416 116.291025 748.229288 116.291025l0 47.459125 123.54866 0c18.167626 0 32.894732 14.727106 32.894732 32.894732l0 92.92987L115.42936 289.574752l0-92.92987c0-18.167626 14.727106-32.894732 32.894732-32.894732l123.54866 0 0-47.459125L131.776437 116.291025c-35.244356 0-63.814389 28.571056-63.814389 63.815412l0.004093 713.966329c0 35.243333 28.571056 63.814389 63.814389 63.814389l756.540979 0c35.244356 0 63.814389-28.571056 63.814389-63.815412l-0.004093-713.966329C952.131805 144.861058 923.560749 116.291025 888.317416 116.291025zM904.67268 337.033877l0 540.498398c0 18.167626-14.727106 32.894732-32.894732 32.894732L148.324092 910.427007c-18.167626 0-32.894732-14.727106-32.894732-32.894732L115.42936 337.033877 904.67268 337.033877zM300.659736 64.801927l47.459125 0 0 170.241292-47.459125 0 0-170.241292ZM672.97481 64.801927l47.450938 0 0 170.241292-47.450938 0 0-170.241292ZM358.384138 547.939214l0 231.021432 52.863464 0L411.247602 459.226591l-34.580198 0-2.651514 3.804835c-18.000819 25.896006-41.448959 48.758786-69.681285 67.955908l-3.886703 2.643327 0 53.742526 13.441772-8.069156C330.690097 569.215794 345.588103 558.712075 358.384138 547.939214zM618.031888 726.552576c-10.287791 6.395971-24.435678 8.069156-42.059902 4.948946-16.094309-2.842881-27.898712-18.373321-35.082666-46.159464l-2.261615-8.753781-48.312603 13.424375 1.68956 8.129534c6.270098 30.168514 18.347737 52.052967 35.884976 65.017855 17.120734 12.705979 35.542152 19.777364 54.731087 21.043255 3.358652 0.225138 6.655903 0.337707 9.897892 0.337707 14.859119 0 28.430857-2.374184 40.452211-7.072408 14.417029-5.641758 26.88866-13.338413 37.076162-22.86278 10.365566-9.723922 18.230051-22.143362 23.378552-36.920612 4.918246-14.170401 7.739636-28.296797 8.385373-42.025108 0.60685-13.658723-0.667228-26.650218-3.791531-38.619382l-0.008187-0.017397c-3.111-11.777796-8.133628-23.738773-14.946104-35.551363-7.353831-12.679372-19.028268-22.750211-34.710165-29.952586-15.037183-6.872854-30.927843-10.685876-47.24729-11.32752-11.414505-0.415482-23.487027 1.386646-36.04462 5.434017 3.813022-14.568486 7.648557-31.884681 11.465673-51.775637l113.87693 0 0-49.357449L535.645647 464.492778l-1.495122 7.028404c-24.621928 115.77116-31.589954 145.497585-33.102473 150.039235l-3.432334 10.338958 45.829943 5.391036 3.054716-4.20292c8.146931-11.214951 18.247448-18.139996 30.879746-21.164011 13.004799-3.137607 24.743707-3.180588 34.879018-0.129966 9.857981 2.95545 17.822756 8.771178 24.327202 17.758284 6.512633 9.03111 10.084143 20.392401 10.617311 33.757421 0.519864 13.849067-1.603598 26.442477-6.314102 37.440476C636.315153 711.429431 628.843637 719.871089 618.031888 726.552576z
- M512 620.544l253.3376 253.3376a76.6976 76.6976 0 1 0 108.544-108.544L620.6464 512l253.2352-253.3376a76.6976 76.6976 0 1 0-108.544-108.544L512 403.3536 258.6624 150.1184a76.6976 76.6976 0 1 0-108.544 108.544L403.3536 512 150.1184 765.3376a76.6976 76.6976 0 1 0 108.544 108.544L512 620.6464z
- M7.4038057,6.4038057 C7.1478834,6.4038057 6.8919611,6.5014372 6.6966991,6.6966991 6.3061748,7.0872235 6.3061748,7.7203884 6.6966991,8.1109123 L10.585787,12 6.6966991,15.889088 C6.3061748,16.279612 6.3061748,16.912777 6.6966991,17.303301 7.0872235,17.693825 7.7203879,17.693825 8.1109123,17.303301 L12,13.414213 15.889088,17.303301 C16.279612,17.693825 16.912777,17.693825 17.303301,17.303301 17.693825,16.912777 17.693825,16.279612 17.303301,15.889088 L13.414213,12 17.303301,8.1109123 C17.693825,7.7203884 17.693825,7.0872235 17.303301,6.6966991 16.912777,6.3061748 16.279612,6.3061748 15.889088,6.6966991 L12,10.585787 8.1109123,6.6966991 C7.9156504,6.5014372 7.6597281,6.4038057 7.4038057,6.4038057 z M12,0 C18.627417,0 24,5.3725829 24,12 24,18.627417 18.627417,24 12,24 5.3725829,24 0,18.627417 0,12 0,5.3725829 5.3725829,0 12,0 z
- M0.7,0 L5,4.3 L9.3,0 L10,0.7 L5.7,5 L10,9.3 L9.3,10 L5,5.7 L0.7,10 L0,9.3 L4.3,5 L0,0.7 z
- M512 801.6896L5.12 282.0096l58.1632-59.5968L512 682.3936l448.7168-460.0832 58.1632 59.5968-506.88 519.7824z
- M50.000001,0 L100,51.262779 94.262627,57.141584 50.000001,11.767713 5.7373757,57.151686 0,51.27288 z
- M498.506684 256.571517 425.359734 256.571517 425.359734 622.190635 720.166063 622.190635 720.166063 549.725206 498.506684 549.725206ZM512.714268 80.162738c-245.740844 0-445.181175 197.577914-445.181175 441.024505s199.439308 441.024505 445.181175 441.024505c245.738797 0 445.178105-197.577914 445.178105-441.024505S758.453065 80.162738 512.714268 80.162738zM512.714268 874.005824c-195.880249 0-356.145349-158.768003-356.145349-352.818581s160.2651-352.821651 356.145349-352.821651c195.877179 0 356.14228 158.77005 356.14228 352.821651S708.591447 874.005824 512.714268 874.005824z
- M394.24 512L683.52 248.32c10.24-10.24 10.24-25.6 0-35.84-10.24-10.24-25.6-10.24-35.84 0l-307.2 279.04c-5.12 5.12-7.68 12.8-7.68 20.48 0 7.68 2.56 15.36 7.68 20.48l307.2 279.04c10.24 10.24 25.6 10.24 35.84 0 10.24-10.24 10.24-25.6 0-35.84L394.24 512z
- M4.1666641,0 C5.2083321,0 6.25,0.41666794 7.0833321,1.25 L57.083331,46.666664 C57.916664,47.499998 58.33333,48.749998 58.333329,49.999998 58.33333,51.249997 57.916664,52.499997 57.083331,53.333331 L7.0833321,98.749996 C5.4166641,100.41666 2.9166641,100.41666 1.2499962,98.749996 -0.41666794,97.083328 -0.41666794,94.583328 1.2499962,92.916664 L48.333331,49.999998 1.2499962,7.0833321 C-0.41666794,5.4166641 -0.41666794,2.9166641 1.2499962,1.25 2.0833282,0.41666794 3.1249962,0 4.1666641,0 z
- M165.238899 508.178506C164.450369 456.442676 171.767779 404.485842 187.244542 353.863631 266.138632 95.812692 533.436225-51.353028 784.380224 25.368251 1035.324219 102.08953 1174.62994 373.566359 1095.735851 631.617298 1016.84176 889.66824 749.544168 1036.833959 498.600172 960.11268 424.134741 937.346313 357.837833 896.870788 303.973868 842.276436 291.310328 829.441176 291.396506 808.495802 304.166356 795.493625 316.936205 782.491452 337.554042 782.356136 350.217582 795.191397 396.640587 842.243889 453.73137 877.098901 517.975091 896.740177 734.436966 962.919213 965.320335 835.802028 1033.557737 612.607541 1101.795139 389.413057 981.467179 154.919792 765.005305 88.740755 548.543428 22.561718 317.660056 149.678904 249.422655 372.873388 235.597198 418.094418 229.294871 464.461039 230.4403 510.559881L311.240978 429.759202C323.584094 417.416085 343.892513 417.712357 356.601099 430.420946 369.309686 443.129535 369.605959 463.437952 357.262842 475.781068L230.778782 602.265128C229.273826 605.769679 227.098877 609.041396 224.251145 611.889128 211.908029 624.232245 191.59961 623.935974 178.891024 611.227385L40.825428 473.16179C28.11684 460.453206 27.820569 440.144784 40.163685 427.801668 52.506801 415.458551 72.815218 415.754827 85.523806 428.463411L165.238899 508.178506Z
- M750.3 198.7C598 46.4 351.1 46.4 198.7 198.7s-152.3 399.2 0 551.5C345.1 896.6 578.8 902.3 732 767.3l172.1 172.1 35.4-35.4-172.1-171.9c135-153.2 129.3-387-17.1-533.4z m39.3 403.8c-17.1 42.1-42.2 80-74.7 112.4-32.5 32.5-70.3 57.6-112.4 74.7-40.7 16.5-83.8 24.9-128 24.9s-87.2-8.4-128-24.9c-42.1-17.1-80-42.2-112.4-74.7s-57.6-70.3-74.7-112.4c-16.5-40.7-24.9-83.8-24.9-128s8.4-87.2 24.9-128c17.1-42.1 42.2-80 74.7-112.4s70.3-57.6 112.4-74.7c40.7-16.5 83.8-24.9 128-24.9s87.2 8.4 128 24.9c42.1 17.1 80 42.2 112.4 74.7 32.5 32.5 57.6 70.3 74.7 112.4 16.5 40.7 24.9 83.8 24.9 128s-8.4 87.3-24.9 128zM671 502H496v175h-50V502H271v-50h175V277h50v175h175v50z
- M750.3 198.7C598 46.4 351.1 46.4 198.7 198.7s-152.3 399.2 0 551.5C345.1 896.6 578.8 902.3 732 767.3l172.1 172.1 35.4-35.4-172.1-171.9c135-153.2 129.3-387-17.1-533.4z m39.3 403.8c-17.1 42.1-42.2 80-74.7 112.4-32.5 32.5-70.3 57.6-112.4 74.7-40.7 16.5-83.8 24.9-128 24.9s-87.2-8.4-128-24.9c-42.1-17.1-80-42.2-112.4-74.7s-57.6-70.3-74.7-112.4c-16.5-40.7-24.9-83.8-24.9-128s8.4-87.2 24.9-128c17.1-42.1 42.2-80 74.7-112.4s70.3-57.6 112.4-74.7c40.7-16.5 83.8-24.9 128-24.9s87.2 8.4 128 24.9c42.1 17.1 80 42.2 112.4 74.7 32.5 32.5 57.6 70.3 74.7 112.4 16.5 40.7 24.9 83.8 24.9 128s-8.4 87.3-24.9 128zM671 502H271v-50h400v50z
- M868.100096 742.600704l-0.049152 0L216.246272 742.600704l-0.049152 0c-13.98784 0-25.327616 11.33568-25.327616 25.352192 0 13.993984 11.360256 25.327616 25.327616 25.327616l0.049152 0 651.804672 0 0.049152 0c13.996032 0 25.33376-11.333632 25.33376-25.327616C893.431808 753.936384 882.096128 742.600704 868.100096 742.600704L868.100096 742.600704 868.100096 742.600704M523.15136 688.433152c4.728832 4.757504 11.237376 7.733248 18.47296 7.733248l0 0 0 0c7.231488 0 13.740032-2.951168 18.42176-7.757824l314.836992-314.83904c4.732928-4.704256 7.714816-11.214848 7.7312-18.395136 0-14.342144-11.712512-25.9584-25.972736-25.9584-7.213056-0.02048-13.694976 2.930688-18.376704 7.636992L567.578624 607.51872 567.578624 117.52448c-0.024576-0.026624-0.024576-0.026624-0.024576-0.0512 0.024576-14.344192-11.59168-25.980928-25.901056-25.980928-14.348288 0-25.960448 11.634688-25.960448 25.980928 0 0 0 0.024576 0.024576 0.0512l0 489.967616L245.055488 336.826368c-4.683776-4.704256-11.2128-7.6288-18.374656-7.60832-14.342144-0.02048-25.954304 11.614208-26.005504 25.9072 0 7.20896 2.951168 13.768704 7.684096 18.423808L523.15136 688.433152 523.15136 688.433152 523.15136 688.433152M523.15136 688.433152 523.15136 688.433152z
- M608 320C625.664 320 640 305.696 640 288L640 160C640 142.304 625.664 128 608 128 590.336 128 576 142.304 576 160L576 288C576 305.696 590.336 320 608 320L608 320ZM960 896C960 931.328 931.328 960 896 960L128 960C92.672 960 64 931.328 64 896L64 128C64 92.672 92.672 64 128 64L192 64 192 384C192 419.328 220.672 448 256 448L768 448C803.328 448 832 419.328 832 384L832 64 896 64C931.328 64 960 92.672 960 128L960 896 960 896ZM256 64 768 64 768 352C768 369.696 753.664 384 736 384L288 384C270.336 384 256 369.696 256 352L256 64 256 64ZM896 0 128 0C57.312 0 0 57.312 0 128L0 896C0 966.688 57.312 1024 128 1024L896 1024C966.688 1024 1024 966.688 1024 896L1024 128C1024 57.312 966.688 0 896 0L896 0Z
- M426.276571 574.829714l0 372.004571-389.705143-53.686857 0-318.317714 389.705143 0zM426.276571 150.308571l0 376.539429-389.705143 0 0-322.852571zM987.428571 574.829714l0 449.170286-518.290286-71.460571 0-377.709714 518.290286 0zM987.428571 73.142857l0 453.705143-518.290286 0 0-382.317714z
- M942 82v320h-50V167.4l-274 274-35.4-35.4 274-274H622V82h320zM406 582.6l-274 274V622H82v320h320v-50H167.4l274-274-35.4-35.4zM132 132h302V82H82v352h50V132z m760 760H590v50h352V590h-50v302z
- M94.186081,59.07 L100,59.07 100,100 59.07,100 59.07,94.186081 94.186081,94.186081 z M4.5814285,58.208999 L41.791,58.208999 41.791,95.418571 35.977005,95.418571 35.977005,68.139304 4.1163101,100 0,95.88369 31.860695,64.022995 4.5814285,64.022995 z M95.88369,0 L100,4.1163101 68.139304,35.977005 95.418571,35.977005 95.418571,41.791 58.208999,41.791 58.208999,4.5814285 64.022995,4.5814285 64.022995,31.860695 z M0,0 L40.929998,0 40.929998,5.8139191 5.8139191,5.8139191 5.8139191,40.929998 0,40.929998 z
- M716.6003 213.800623c-138.851102-138.915088-364.020238-138.915088-502.935326 0s-138.915088 364.084225 0 502.935326a355.573996 355.573996 0 0 0 502.935326 0 355.573996 355.573996 0 0 0 0-502.935326z m-580.359212 580.359212a465.183184 465.183184 0 1 1 657.783099 0 465.183184 465.183184 0 0 1-657.783099 0z m868.939152 211.156054a63.474789 63.474789 0 0 1-89.837303 0l-89.773316-89.837303a63.410803 63.410803 0 1 1 89.773316-89.773316l89.837303 89.773316a63.346816 63.346816 0 0 1 0 89.837303z
- M454.464 143.68l-253.44 253.44c-12.032 12.032-12.032 31.36 0 43.392 11.968 11.968 31.36 11.968 43.328 0l237.376-237.376 237.376 237.376c11.968 11.968 31.36 11.968 43.328 0 12.032-12.032 12.032-31.36 0-43.392l-253.44-253.44C491.264 126.016 478.016 124.032 454.464 143.68zM507.968 947.648l252.48-253.376c11.968-11.968 11.968-31.36 0-43.392-11.968-11.968-31.296-11.968-43.264 0l-236.48 237.376L244.16 650.88c-11.968-11.968-31.296-11.968-43.264 0-11.968 12.032-11.968 31.424 0 43.392l252.48 253.376C465.984 960 491.136 964.48 507.968 947.648z
- M0,4 L10,4 L10,5 L0,5 z
- M 0,2 3,5 8,0
- M928 406.4c-100.8-137.6-249.6-224-416-224s-315.2 86.4-416 224c-44.8 60.8-44.8 150.4 0 211.2 102.4 137.6 251.2 224 416 224 166.4 0 315.2-86.4 416-224 46.4-60.8 46.4-150.4 0-211.2zM512 721.6c-115.2 0-209.6-94.4-209.6-209.6 0-115.2 94.4-209.6 209.6-209.6 115.2 0 209.6 94.4 209.6 209.6 1.6 115.2-92.8 209.6-209.6 209.6z m0-360c-83.2 0-150.4 67.2-150.4 150.4s67.2 150.4 150.4 150.4 150.4-67.2 150.4-150.4-67.2-150.4-150.4-150.4z m0 0
- M950.4 361.6c8-20.8 0-43.2-19.2-54.4-9.6-4.8-20.8-6.4-32-3.2s-19.2 11.2-24 22.4c-56 132.8-208 228.8-361.6 228.8-155.2 0-307.2-97.6-363.2-232-4.8-11.2-12.8-19.2-24-24-9.6-4.8-20.8-3.2-32 0-20.8 9.6-30.4 35.2-20.8 56 25.6 60.8 67.2 118.4 123.2 164.8l-67.2 70.4c-14.4 16-14.4 40 0 57.6 8 8 17.6 14.4 28.8 14.4s22.4-3.2 30.4-11.2l76.8-81.6c35.2 20.8 73.6 38.4 113.6 49.6l-28.8 83.2c-8 22.4 3.2 46.4 24 54.4 4.8 1.6 9.6 3.2 14.4 3.2 6.4 0 11.2-1.6 17.6-3.2 9.6-4.8 17.6-12.8 22.4-24l33.6-96c41.6 4.8 81.6 3.2 123.2-3.2l32 94.4c3.2 11.2 11.2 19.2 22.4 24 9.6 4.8 20.8 4.8 32 1.6 20.8-8 32-32 24-54.4l-28.8-84.8c30.4-9.6 59.2-22.4 86.4-38.4l62.4 65.6c14.4 16 43.2 16 57.6 0 16-16 16-43.2 0-60.8l-51.2-54.4c56-43.2 100.8-100.8 128-164.8z
- M1,3 L1,9 L7,9 L7,3 z M3,1 L3,2 L8,2 L8,7 L9,7 L9,1 z M2,0 L10,0 L10,8 L8,8 L8,10 L0,10 L0,2 L2,2 z
- M1,1 L1,9 L9,9 L9,1 z M0,0 L10,0 L10,10 L0,10 z
- M627.52666696 962L550.66666696 890.47999971c116.82-92.99999971 191.09999971-230.94 191.09999971-385.2 0-146.99999971-67.61999971-279-174.96-371.57999942L643.84666667 62C770.86666638 172.99999971 850.66666667 330.2 850.66666667 505.09999971c0 182.27999971-86.58 345.42-223.13999971 456.90000029zM405.64666638 782l-76.32-77.22a227.88 227.88 0 0 0 116.40000058-199.26A228.06 228.06 0 0 0 347.86666638 317.84000029L422.86666696 242A334.37999971 334.37999971 0 0 1 550.66666696 505.52 334.62 334.62 0 0 1 405.64666638 782zM205.66666638 596.6C164.26666638 596.6 130.66666667 562.51999971 130.66666667 520.64 130.66666667 478.76000029 164.26666638 444.79999971 205.66666638 444.79999971s74.99999971 33.95999971 75.00000058 75.90000058c0 41.87999971-33.59999971 75.84000029-75.00000058 75.83999942z
- M0,0L28,0 28,14.0000006258488 28,15.0010000765324 28.0151405334473,15.0010000765324 28.0455417633057,15.8010965883732C28.4084091186524,22.9596563875675,30.92209815979,29.5507589876652,34.9532623291016,34.9410597383976L34.9984359741211,34.9999815523624 34.0966339111328,34.9885679781437C15.1841707229614,34.5094191133976,2.0535663480814E-07,19.0279375612736,0,0z
- M535.9 165.2l96.5 195.4c3.9 7.9 11.4 13.3 20.1 14.6l215.7 31.3c21.9 3.2 30.6 30 14.8 45.5L726.8 604.1c-6.3 6.1-9.1 14.9-7.7 23.6L756 842.5c3.7 21.8-19.1 38.4-38.7 28.1L524.4 769.2c-7.8-4.1-17-4.1-24.8 0L306.7 870.6c-19.6 10.3-42.4-6.3-38.7-28.1l36.8-214.8c1.5-8.6-1.4-17.5-7.7-23.6L141.1 452c-15.8-15.4-7.1-42.3 14.8-45.5l215.7-31.3c8.7-1.3 16.2-6.7 20.1-14.6l96.5-195.4c9.7-19.9 37.9-19.9 47.7 0z
- M938.666667 426.666667h-341.333334V85.333333c0-46.933333-38.4-85.333333-85.333333-85.333333s-85.333333 38.4-85.333333 85.333333v341.333334H85.333333c-46.933333 0-85.333333 38.4-85.333333 85.333333s38.4 85.333333 85.333333 85.333333h341.333334v341.333334c0 46.933333 38.4 85.333333 85.333333 85.333333s85.333333-38.4 85.333333-85.333333v-341.333334h341.333334c46.933333 0 85.333333-38.4 85.333333-85.333333s-38.4-85.333333-85.333333-85.333333z
- M62.5797 488.9508c0.2632 42.5185 34.985 77.2116 77.5035 77.5035l743.0216-0.6728c42.5185 0.3215 76.7437-33.9333 76.4518-76.4805l0 0c-0.2918-42.5175-34.985-77.2106-77.5045-77.5035l-743.0216-0.087C96.513 411.4473 62.2879 446.4323 62.5797 488.9508L62.5797 488.9508z
- M943.644188 827.215696l-351.176649-608.204749c-42.945473-74.36249-113.147387-74.36249-156.092861 0l-351.176649 608.204749c-42.946498 74.431167-7.811716 135.14955 78.012605 135.14955l702.420949 0C951.455904 962.36422 986.555836 901.645838 943.644188 827.215696zM466.187532 391.579035c12.621133-13.644108 28.66175-20.466675 48.233578-20.466675 19.580028 0 35.612444 6.75389 48.241778 20.194018 12.544256 13.473954 18.820484 30.325365 18.820484 50.587035 0 17.430551-26.19759 145.621205-34.929778 238.882082l-63.105666 0c-7.666162-93.259852-36.090106-221.450507-36.090106-238.882082C447.358847 421.938226 453.643275 405.155491 466.187532 391.579035zM561.76804 835.026386c-13.268949 12.928641-29.062535 19.375023-47.345906 19.375023-18.275171 0-34.076957-6.447407-47.346931-19.375023-13.235123-12.89379-19.818859-28.517221-19.818859-46.869269 0-18.249546 6.583736-34.043131 19.818859-47.278254 13.268949-13.235123 29.07176-19.852685 47.346931-19.852685 18.283371 0 34.076957 6.617562 47.345906 19.852685 13.235123 13.235123 19.827059 29.028709 19.827059 47.278254C581.595099 806.51019 575.003163 822.132597 561.76804 835.026386z
- M505.6512 39.0144c-261.2224 3.4816-470.1184 218.112-466.6368 479.4368 3.4816 261.12 218.112 470.1184 479.3344 466.6368 261.2224-3.4816 470.1184-218.112 466.7392-479.3344C981.504 244.4288 766.8736 35.5328 505.6512 39.0144zM558.08 196.608c48.128 0 62.2592 27.9552 62.2592 59.8016 0 39.8336-31.9488 76.6976-86.3232 76.6976-45.568 0-67.1744-22.9376-65.9456-60.8256C468.0704 240.4352 494.7968 196.608 558.08 196.608zM434.7904 807.6288c-32.8704 0-56.9344-19.968-33.8944-107.6224l37.6832-155.5456c6.5536-24.8832 7.68-34.9184 0-34.9184-9.8304 0-52.5312 17.2032-77.7216 34.2016l-16.384-26.9312c79.9744-66.7648 171.8272-105.8816 211.2512-105.8816 32.8704 0 38.2976 38.912 21.9136 98.6112l-43.2128 163.5328c-7.68 28.8768-4.4032 38.912 3.2768 38.912 9.9328 0 42.1888-11.9808 73.9328-36.9664l18.6368 24.8832C552.5504 777.728 467.6608 807.6288 434.7904 807.6288z
- M495.469714 0C224.621714 0 0 224.621714 0 495.469714c0 270.884571 224.621714 495.506286 495.469714 495.506286 270.884571 0 495.506286-224.621714 495.506286-495.506286C990.976 224.621714 766.354286 0 495.469714 0z m211.419429 634.221714c19.821714 19.821714 19.821714 46.226286 0 66.048s-46.226286 19.821714-66.048 0l-138.752-138.715428-145.334857 145.334857a51.858286 51.858286 0 0 1-72.667429 0 51.858286 51.858286 0 0 1 0-72.667429l145.334857-145.334857-138.752-138.752c-19.821714-19.821714-19.821714-46.226286 0-66.048s46.262857-19.821714 66.084572 0l138.715428 138.715429 145.371429-145.334857a51.858286 51.858286 0 0 1 72.667428 0 51.858286 51.858286 0 0 1 0 72.667428l-145.371428 145.334857 138.752 138.752z
- M512.66048 64.64c-247.424 0-448 200.57728-448 448s200.576 448 448 448 448-200.57728 448-448c0-247.424-200.57728-448-448-448z m250.71232 334.86336L480.98176 681.89312c-15.49568 15.49696-40.61952 15.49696-56.11648 0l-162.9184-162.9184c-15.49568-15.49568-15.49568-40.61824 0-56.1152s40.61952-15.49568 56.11648 0l134.85952 134.85952L707.25504 343.3856c15.49568-15.49568 40.61952-15.49568 56.11648 0s15.49696 40.6208 0.00128 56.11776z
- M716.8 375.466667l34.133333 34.133333c17.066667 17.066667 42.666667 17.066667 59.733334 0 17.066667-17.066667 17.066667-42.666667 0-59.733333l-34.133334-34.133334 34.133334-34.133333c17.066667-17.066667 17.066667-42.666667 0-59.733333-17.066667-17.066667-42.666667-17.066667-59.733334 0l-34.133333 34.133333-34.133333-34.133333c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733333l34.133334 34.133333-34.133334 34.133334c-17.066667 17.066667-17.066667 42.666667 0 59.733333 17.066667 17.066667 42.666667 17.066667 59.733334 0l34.133333-34.133333z m-426.666667 0l34.133334 34.133333c17.066667 17.066667 42.666667 17.066667 59.733333 0 17.066667-17.066667 17.066667-42.666667 0-59.733333l-34.133333-34.133334 34.133333-34.133333c17.066667-17.066667 17.066667-42.666667 0-59.733333-17.066667-17.066667-42.666667-17.066667-59.733333 0l-34.133334 34.133333-34.133333-34.133333c-17.066667-17.066667-42.666667-17.066667-59.733333 0-17.066667 17.066667-17.066667 42.666667 0 59.733333l34.133333 34.133333-34.133333 34.133334c-17.066667 17.066667-17.066667 42.666667 0 59.733333 17.066667 17.066667 42.666667 17.066667 59.733333 0l34.133333-34.133333zM0 85.333333c0-51.2 42.666667-85.333333 85.333333-85.333333h853.333334c51.2 0 85.333333 42.666667 85.333333 85.333333v853.333334c0 51.2-42.666667 85.333333-85.333333 85.333333H85.333333c-51.2 0-85.333333-42.666667-85.333333-85.333333V85.333333z m512 469.333334c-136.533333 0-230.4 68.266667-290.133333 196.266666-8.533333 17.066667 0 42.666667 17.066666 59.733334s42.666667 0 59.733334-17.066667c51.2-93.866667 110.933333-145.066667 221.866666-145.066667 102.4 0 170.666667 51.2 221.866667 145.066667 8.533333 17.066667 34.133333 25.6 59.733333 17.066667 17.066667-8.533333 25.6-34.133333 17.066667-59.733334-76.8-128-170.666667-196.266667-307.2-196.266666z
- M512 0 30.11843 240.941297l0 542.117406 481.88157 240.941297 481.88157-240.941297L993.88157 240.941297 512 0zM575.776472 768.799969 460.188012 768.799969 460.188012 656.222073l115.588459 0L575.776472 768.799969zM623.335603 509.329685c-52.375829 36.723353-59.600363 55.988096-59.600363 84.885211l0 19.866447L468.616977 614.081343l0-26.489278c0-45.754021 13.846342-80.67124 61.406497-116.791866 46.957428-36.723353 57.79423-62.0082 57.79423-84.282484 0-25.284848-21.67258-54.181962-55.386393-54.181962-42.743457 0-70.436142 26.489278-82.477374 85.486914l-105.956088-21.67258c24.683144-111.976192 82.477374-157.127486 205.289345-157.127486 98.12985 0 157.72919 63.212631 157.72919 131.842639C707.017407 423.240044 688.956071 461.76953 623.335603 509.329685z
- M 721.005 638.949 C 758.74 638.949 789.333 669.56 789.333 707.312 C 789.333 745.047 758.74 775.657 721.005 775.657 C 683.253 775.657 652.66 745.047 652.66 707.312 C 652.66 669.56 683.253 638.949 721.005 638.949 Z M 512.017 638.949 C 549.77 638.949 580.38 669.56 580.38 707.312 C 580.38 745.047 549.77 775.657 512.017 775.657 C 474.265 775.657 443.672 745.047 443.672 707.312 C 443.672 669.56 474.265 638.949 512.017 638.949 Z M 303.029 638.949 C 340.781 638.949 371.392 669.56 371.392 707.312 C 371.392 745.047 340.781 775.657 303.029 775.657 C 265.277 775.657 234.667 745.047 234.667 707.312 C 234.667 669.56 265.277 638.949 303.029 638.949 Z M 721.005 443.655 C 758.74 443.655 789.333 474.265 789.333 512.017 C 789.333 549.769 758.74 580.363 721.005 580.363 C 683.253 580.363 652.66 549.769 652.66 512.017 C 652.66 474.265 683.253 443.655 721.005 443.655 Z M 512.017 443.655 C 549.77 443.655 580.38 474.265 580.38 512.017 C 580.38 549.769 549.77 580.363 512.017 580.363 C 474.265 580.363 443.672 549.769 443.672 512.017 C 443.672 474.265 474.265 443.655 512.017 443.655 Z M 303.029 443.655 C 340.781 443.655 371.392 474.265 371.392 512.017 C 371.392 549.769 340.781 580.363 303.029 580.363 C 265.277 580.363 234.667 549.769 234.667 512.017 C 234.667 474.265 265.277 443.655 303.029 443.655 Z M 721.005 248.343 C 758.74 248.343 789.333 278.953 789.333 316.688 C 789.333 354.44 758.74 385.051 721.005 385.051 C 683.253 385.051 652.66 354.44 652.66 316.688 C 652.66 278.953 683.253 248.343 721.005 248.343 Z M 512.017 248.343 C 549.77 248.343 580.38 278.953 580.38 316.688 C 580.38 354.44 549.77 385.051 512.017 385.051 C 474.265 385.051 443.672 354.44 443.672 316.688 C 443.672 278.953 474.265 248.343 512.017 248.343 Z M 303.029 248.343 C 340.781 248.343 371.392 278.953 371.392 316.688 C 371.392 354.44 340.781 385.051 303.029 385.051 C 265.277 385.051 234.667 354.44 234.667 316.688 C 234.667 278.953 265.277 248.343 303.029 248.343 Z
- M384 896C384 825.307552 440.814697 768 512 768 582.692448 768 640 824.814694 640 896 640 966.692448 583.185303 1024 512 1024 441.307552 1024 384 967.185306 384 896ZM384 512C384 441.307552 440.814697 384 512 384 582.692448 384 640 440.814697 640 512 640 582.692448 583.185303 640 512 640 441.307552 640 384 583.185303 384 512ZM384 128C384 57.307552 440.814697 0 512 0 582.692448 0 640 56.814697 640 128 640 198.692448 583.185303 256 512 256 441.307552 256 384 199.185303 384 128Z
- M798.165333 97.834667a42.624 42.624 0 0 0-60.330666 0l-140.629334 140.629333-55.381333-55.296-60.330667 60.330667 55.381334 55.296-353.706667 353.706666a42.709333 42.709333 0 0 0-11.221333 19.84l-42.666667 170.666667a42.538667 42.538667 0 0 0 51.712 51.712l170.666667-42.666667c7.509333-1.877333 14.378667-5.76 19.84-11.221333l353.792-353.792 55.210666 55.125333 60.330667-60.330666-55.210667-55.125334 140.544-140.544a42.624 42.624 0 0 0 0-60.330666l-128-128zM319.488 772.138667l-90.197333 22.570666 22.570666-90.197333 345.386667-345.386667 67.669333 67.584-345.429333 345.429334z
+ M377.897477 116.291025l265.298718 0 0 47.459125-265.298718 0 0-47.459125ZM888.317416 116.291025 748.229288 116.291025l0 47.459125 123.54866 0c18.167626 0 32.894732 14.727106 32.894732 32.894732l0 92.92987L115.42936 289.574752l0-92.92987c0-18.167626 14.727106-32.894732 32.894732-32.894732l123.54866 0 0-47.459125L131.776437 116.291025c-35.244356 0-63.814389 28.571056-63.814389 63.815412l0.004093 713.966329c0 35.243333 28.571056 63.814389 63.814389 63.814389l756.540979 0c35.244356 0 63.814389-28.571056 63.814389-63.815412l-0.004093-713.966329C952.131805 144.861058 923.560749 116.291025 888.317416 116.291025zM904.67268 337.033877l0 540.498398c0 18.167626-14.727106 32.894732-32.894732 32.894732L148.324092 910.427007c-18.167626 0-32.894732-14.727106-32.894732-32.894732L115.42936 337.033877 904.67268 337.033877zM300.659736 64.801927l47.459125 0 0 170.241292-47.459125 0 0-170.241292ZM672.97481 64.801927l47.450938 0 0 170.241292-47.450938 0 0-170.241292ZM358.384138 547.939214l0 231.021432 52.863464 0L411.247602 459.226591l-34.580198 0-2.651514 3.804835c-18.000819 25.896006-41.448959 48.758786-69.681285 67.955908l-3.886703 2.643327 0 53.742526 13.441772-8.069156C330.690097 569.215794 345.588103 558.712075 358.384138 547.939214zM618.031888 726.552576c-10.287791 6.395971-24.435678 8.069156-42.059902 4.948946-16.094309-2.842881-27.898712-18.373321-35.082666-46.159464l-2.261615-8.753781-48.312603 13.424375 1.68956 8.129534c6.270098 30.168514 18.347737 52.052967 35.884976 65.017855 17.120734 12.705979 35.542152 19.777364 54.731087 21.043255 3.358652 0.225138 6.655903 0.337707 9.897892 0.337707 14.859119 0 28.430857-2.374184 40.452211-7.072408 14.417029-5.641758 26.88866-13.338413 37.076162-22.86278 10.365566-9.723922 18.230051-22.143362 23.378552-36.920612 4.918246-14.170401 7.739636-28.296797 8.385373-42.025108 0.60685-13.658723-0.667228-26.650218-3.791531-38.619382l-0.008187-0.017397c-3.111-11.777796-8.133628-23.738773-14.946104-35.551363-7.353831-12.679372-19.028268-22.750211-34.710165-29.952586-15.037183-6.872854-30.927843-10.685876-47.24729-11.32752-11.414505-0.415482-23.487027 1.386646-36.04462 5.434017 3.813022-14.568486 7.648557-31.884681 11.465673-51.775637l113.87693 0 0-49.357449L535.645647 464.492778l-1.495122 7.028404c-24.621928 115.77116-31.589954 145.497585-33.102473 150.039235l-3.432334 10.338958 45.829943 5.391036 3.054716-4.20292c8.146931-11.214951 18.247448-18.139996 30.879746-21.164011 13.004799-3.137607 24.743707-3.180588 34.879018-0.129966 9.857981 2.95545 17.822756 8.771178 24.327202 17.758284 6.512633 9.03111 10.084143 20.392401 10.617311 33.757421 0.519864 13.849067-1.603598 26.442477-6.314102 37.440476C636.315153 711.429431 628.843637 719.871089 618.031888 726.552576z
+ M512 620.544l253.3376 253.3376a76.6976 76.6976 0 1 0 108.544-108.544L620.6464 512l253.2352-253.3376a76.6976 76.6976 0 1 0-108.544-108.544L512 403.3536 258.6624 150.1184a76.6976 76.6976 0 1 0-108.544 108.544L403.3536 512 150.1184 765.3376a76.6976 76.6976 0 1 0 108.544 108.544L512 620.6464z
+ M7.4038057,6.4038057 C7.1478834,6.4038057 6.8919611,6.5014372 6.6966991,6.6966991 6.3061748,7.0872235 6.3061748,7.7203884 6.6966991,8.1109123 L10.585787,12 6.6966991,15.889088 C6.3061748,16.279612 6.3061748,16.912777 6.6966991,17.303301 7.0872235,17.693825 7.7203879,17.693825 8.1109123,17.303301 L12,13.414213 15.889088,17.303301 C16.279612,17.693825 16.912777,17.693825 17.303301,17.303301 17.693825,16.912777 17.693825,16.279612 17.303301,15.889088 L13.414213,12 17.303301,8.1109123 C17.693825,7.7203884 17.693825,7.0872235 17.303301,6.6966991 16.912777,6.3061748 16.279612,6.3061748 15.889088,6.6966991 L12,10.585787 8.1109123,6.6966991 C7.9156504,6.5014372 7.6597281,6.4038057 7.4038057,6.4038057 z M12,0 C18.627417,0 24,5.3725829 24,12 24,18.627417 18.627417,24 12,24 5.3725829,24 0,18.627417 0,12 0,5.3725829 5.3725829,0 12,0 z
+ M0.7,0 L5,4.3 L9.3,0 L10,0.7 L5.7,5 L10,9.3 L9.3,10 L5,5.7 L0.7,10 L0,9.3 L4.3,5 L0,0.7 z
+ M512 801.6896L5.12 282.0096l58.1632-59.5968L512 682.3936l448.7168-460.0832 58.1632 59.5968-506.88 519.7824z
+ M50.000001,0 L100,51.262779 94.262627,57.141584 50.000001,11.767713 5.7373757,57.151686 0,51.27288 z
+ M498.506684 256.571517 425.359734 256.571517 425.359734 622.190635 720.166063 622.190635 720.166063 549.725206 498.506684 549.725206ZM512.714268 80.162738c-245.740844 0-445.181175 197.577914-445.181175 441.024505s199.439308 441.024505 445.181175 441.024505c245.738797 0 445.178105-197.577914 445.178105-441.024505S758.453065 80.162738 512.714268 80.162738zM512.714268 874.005824c-195.880249 0-356.145349-158.768003-356.145349-352.818581s160.2651-352.821651 356.145349-352.821651c195.877179 0 356.14228 158.77005 356.14228 352.821651S708.591447 874.005824 512.714268 874.005824z
+ M394.24 512L683.52 248.32c10.24-10.24 10.24-25.6 0-35.84-10.24-10.24-25.6-10.24-35.84 0l-307.2 279.04c-5.12 5.12-7.68 12.8-7.68 20.48 0 7.68 2.56 15.36 7.68 20.48l307.2 279.04c10.24 10.24 25.6 10.24 35.84 0 10.24-10.24 10.24-25.6 0-35.84L394.24 512z
+ M4.1666641,0 C5.2083321,0 6.25,0.41666794 7.0833321,1.25 L57.083331,46.666664 C57.916664,47.499998 58.33333,48.749998 58.333329,49.999998 58.33333,51.249997 57.916664,52.499997 57.083331,53.333331 L7.0833321,98.749996 C5.4166641,100.41666 2.9166641,100.41666 1.2499962,98.749996 -0.41666794,97.083328 -0.41666794,94.583328 1.2499962,92.916664 L48.333331,49.999998 1.2499962,7.0833321 C-0.41666794,5.4166641 -0.41666794,2.9166641 1.2499962,1.25 2.0833282,0.41666794 3.1249962,0 4.1666641,0 z
+ M165.238899 508.178506C164.450369 456.442676 171.767779 404.485842 187.244542 353.863631 266.138632 95.812692 533.436225-51.353028 784.380224 25.368251 1035.324219 102.08953 1174.62994 373.566359 1095.735851 631.617298 1016.84176 889.66824 749.544168 1036.833959 498.600172 960.11268 424.134741 937.346313 357.837833 896.870788 303.973868 842.276436 291.310328 829.441176 291.396506 808.495802 304.166356 795.493625 316.936205 782.491452 337.554042 782.356136 350.217582 795.191397 396.640587 842.243889 453.73137 877.098901 517.975091 896.740177 734.436966 962.919213 965.320335 835.802028 1033.557737 612.607541 1101.795139 389.413057 981.467179 154.919792 765.005305 88.740755 548.543428 22.561718 317.660056 149.678904 249.422655 372.873388 235.597198 418.094418 229.294871 464.461039 230.4403 510.559881L311.240978 429.759202C323.584094 417.416085 343.892513 417.712357 356.601099 430.420946 369.309686 443.129535 369.605959 463.437952 357.262842 475.781068L230.778782 602.265128C229.273826 605.769679 227.098877 609.041396 224.251145 611.889128 211.908029 624.232245 191.59961 623.935974 178.891024 611.227385L40.825428 473.16179C28.11684 460.453206 27.820569 440.144784 40.163685 427.801668 52.506801 415.458551 72.815218 415.754827 85.523806 428.463411L165.238899 508.178506Z
+ M750.3 198.7C598 46.4 351.1 46.4 198.7 198.7s-152.3 399.2 0 551.5C345.1 896.6 578.8 902.3 732 767.3l172.1 172.1 35.4-35.4-172.1-171.9c135-153.2 129.3-387-17.1-533.4z m39.3 403.8c-17.1 42.1-42.2 80-74.7 112.4-32.5 32.5-70.3 57.6-112.4 74.7-40.7 16.5-83.8 24.9-128 24.9s-87.2-8.4-128-24.9c-42.1-17.1-80-42.2-112.4-74.7s-57.6-70.3-74.7-112.4c-16.5-40.7-24.9-83.8-24.9-128s8.4-87.2 24.9-128c17.1-42.1 42.2-80 74.7-112.4s70.3-57.6 112.4-74.7c40.7-16.5 83.8-24.9 128-24.9s87.2 8.4 128 24.9c42.1 17.1 80 42.2 112.4 74.7 32.5 32.5 57.6 70.3 74.7 112.4 16.5 40.7 24.9 83.8 24.9 128s-8.4 87.3-24.9 128zM671 502H496v175h-50V502H271v-50h175V277h50v175h175v50z
+ M750.3 198.7C598 46.4 351.1 46.4 198.7 198.7s-152.3 399.2 0 551.5C345.1 896.6 578.8 902.3 732 767.3l172.1 172.1 35.4-35.4-172.1-171.9c135-153.2 129.3-387-17.1-533.4z m39.3 403.8c-17.1 42.1-42.2 80-74.7 112.4-32.5 32.5-70.3 57.6-112.4 74.7-40.7 16.5-83.8 24.9-128 24.9s-87.2-8.4-128-24.9c-42.1-17.1-80-42.2-112.4-74.7s-57.6-70.3-74.7-112.4c-16.5-40.7-24.9-83.8-24.9-128s8.4-87.2 24.9-128c17.1-42.1 42.2-80 74.7-112.4s70.3-57.6 112.4-74.7c40.7-16.5 83.8-24.9 128-24.9s87.2 8.4 128 24.9c42.1 17.1 80 42.2 112.4 74.7 32.5 32.5 57.6 70.3 74.7 112.4 16.5 40.7 24.9 83.8 24.9 128s-8.4 87.3-24.9 128zM671 502H271v-50h400v50z
+ M868.100096 742.600704l-0.049152 0L216.246272 742.600704l-0.049152 0c-13.98784 0-25.327616 11.33568-25.327616 25.352192 0 13.993984 11.360256 25.327616 25.327616 25.327616l0.049152 0 651.804672 0 0.049152 0c13.996032 0 25.33376-11.333632 25.33376-25.327616C893.431808 753.936384 882.096128 742.600704 868.100096 742.600704L868.100096 742.600704 868.100096 742.600704M523.15136 688.433152c4.728832 4.757504 11.237376 7.733248 18.47296 7.733248l0 0 0 0c7.231488 0 13.740032-2.951168 18.42176-7.757824l314.836992-314.83904c4.732928-4.704256 7.714816-11.214848 7.7312-18.395136 0-14.342144-11.712512-25.9584-25.972736-25.9584-7.213056-0.02048-13.694976 2.930688-18.376704 7.636992L567.578624 607.51872 567.578624 117.52448c-0.024576-0.026624-0.024576-0.026624-0.024576-0.0512 0.024576-14.344192-11.59168-25.980928-25.901056-25.980928-14.348288 0-25.960448 11.634688-25.960448 25.980928 0 0 0 0.024576 0.024576 0.0512l0 489.967616L245.055488 336.826368c-4.683776-4.704256-11.2128-7.6288-18.374656-7.60832-14.342144-0.02048-25.954304 11.614208-26.005504 25.9072 0 7.20896 2.951168 13.768704 7.684096 18.423808L523.15136 688.433152 523.15136 688.433152 523.15136 688.433152M523.15136 688.433152 523.15136 688.433152z
+ M608 320C625.664 320 640 305.696 640 288L640 160C640 142.304 625.664 128 608 128 590.336 128 576 142.304 576 160L576 288C576 305.696 590.336 320 608 320L608 320ZM960 896C960 931.328 931.328 960 896 960L128 960C92.672 960 64 931.328 64 896L64 128C64 92.672 92.672 64 128 64L192 64 192 384C192 419.328 220.672 448 256 448L768 448C803.328 448 832 419.328 832 384L832 64 896 64C931.328 64 960 92.672 960 128L960 896 960 896ZM256 64 768 64 768 352C768 369.696 753.664 384 736 384L288 384C270.336 384 256 369.696 256 352L256 64 256 64ZM896 0 128 0C57.312 0 0 57.312 0 128L0 896C0 966.688 57.312 1024 128 1024L896 1024C966.688 1024 1024 966.688 1024 896L1024 128C1024 57.312 966.688 0 896 0L896 0Z
+ M426.276571 574.829714l0 372.004571-389.705143-53.686857 0-318.317714 389.705143 0zM426.276571 150.308571l0 376.539429-389.705143 0 0-322.852571zM987.428571 574.829714l0 449.170286-518.290286-71.460571 0-377.709714 518.290286 0zM987.428571 73.142857l0 453.705143-518.290286 0 0-382.317714z
+ M942 82v320h-50V167.4l-274 274-35.4-35.4 274-274H622V82h320zM406 582.6l-274 274V622H82v320h320v-50H167.4l274-274-35.4-35.4zM132 132h302V82H82v352h50V132z m760 760H590v50h352V590h-50v302z
+ M94.186081,59.07 L100,59.07 100,100 59.07,100 59.07,94.186081 94.186081,94.186081 z M4.5814285,58.208999 L41.791,58.208999 41.791,95.418571 35.977005,95.418571 35.977005,68.139304 4.1163101,100 0,95.88369 31.860695,64.022995 4.5814285,64.022995 z M95.88369,0 L100,4.1163101 68.139304,35.977005 95.418571,35.977005 95.418571,41.791 58.208999,41.791 58.208999,4.5814285 64.022995,4.5814285 64.022995,31.860695 z M0,0 L40.929998,0 40.929998,5.8139191 5.8139191,5.8139191 5.8139191,40.929998 0,40.929998 z
+ M716.6003 213.800623c-138.851102-138.915088-364.020238-138.915088-502.935326 0s-138.915088 364.084225 0 502.935326a355.573996 355.573996 0 0 0 502.935326 0 355.573996 355.573996 0 0 0 0-502.935326z m-580.359212 580.359212a465.183184 465.183184 0 1 1 657.783099 0 465.183184 465.183184 0 0 1-657.783099 0z m868.939152 211.156054a63.474789 63.474789 0 0 1-89.837303 0l-89.773316-89.837303a63.410803 63.410803 0 1 1 89.773316-89.773316l89.837303 89.773316a63.346816 63.346816 0 0 1 0 89.837303z
+ M454.464 143.68l-253.44 253.44c-12.032 12.032-12.032 31.36 0 43.392 11.968 11.968 31.36 11.968 43.328 0l237.376-237.376 237.376 237.376c11.968 11.968 31.36 11.968 43.328 0 12.032-12.032 12.032-31.36 0-43.392l-253.44-253.44C491.264 126.016 478.016 124.032 454.464 143.68zM507.968 947.648l252.48-253.376c11.968-11.968 11.968-31.36 0-43.392-11.968-11.968-31.296-11.968-43.264 0l-236.48 237.376L244.16 650.88c-11.968-11.968-31.296-11.968-43.264 0-11.968 12.032-11.968 31.424 0 43.392l252.48 253.376C465.984 960 491.136 964.48 507.968 947.648z
+ M0,4 L10,4 L10,5 L0,5 z
+ M 0,2 3,5 8,0
+ M928 406.4c-100.8-137.6-249.6-224-416-224s-315.2 86.4-416 224c-44.8 60.8-44.8 150.4 0 211.2 102.4 137.6 251.2 224 416 224 166.4 0 315.2-86.4 416-224 46.4-60.8 46.4-150.4 0-211.2zM512 721.6c-115.2 0-209.6-94.4-209.6-209.6 0-115.2 94.4-209.6 209.6-209.6 115.2 0 209.6 94.4 209.6 209.6 1.6 115.2-92.8 209.6-209.6 209.6z m0-360c-83.2 0-150.4 67.2-150.4 150.4s67.2 150.4 150.4 150.4 150.4-67.2 150.4-150.4-67.2-150.4-150.4-150.4z m0 0
+ M950.4 361.6c8-20.8 0-43.2-19.2-54.4-9.6-4.8-20.8-6.4-32-3.2s-19.2 11.2-24 22.4c-56 132.8-208 228.8-361.6 228.8-155.2 0-307.2-97.6-363.2-232-4.8-11.2-12.8-19.2-24-24-9.6-4.8-20.8-3.2-32 0-20.8 9.6-30.4 35.2-20.8 56 25.6 60.8 67.2 118.4 123.2 164.8l-67.2 70.4c-14.4 16-14.4 40 0 57.6 8 8 17.6 14.4 28.8 14.4s22.4-3.2 30.4-11.2l76.8-81.6c35.2 20.8 73.6 38.4 113.6 49.6l-28.8 83.2c-8 22.4 3.2 46.4 24 54.4 4.8 1.6 9.6 3.2 14.4 3.2 6.4 0 11.2-1.6 17.6-3.2 9.6-4.8 17.6-12.8 22.4-24l33.6-96c41.6 4.8 81.6 3.2 123.2-3.2l32 94.4c3.2 11.2 11.2 19.2 22.4 24 9.6 4.8 20.8 4.8 32 1.6 20.8-8 32-32 24-54.4l-28.8-84.8c30.4-9.6 59.2-22.4 86.4-38.4l62.4 65.6c14.4 16 43.2 16 57.6 0 16-16 16-43.2 0-60.8l-51.2-54.4c56-43.2 100.8-100.8 128-164.8z
+ M1,3 L1,9 L7,9 L7,3 z M3,1 L3,2 L8,2 L8,7 L9,7 L9,1 z M2,0 L10,0 L10,8 L8,8 L8,10 L0,10 L0,2 L2,2 z
+ M1,1 L1,9 L9,9 L9,1 z M0,0 L10,0 L10,10 L0,10 z
+ M627.52666696 962L550.66666696 890.47999971c116.82-92.99999971 191.09999971-230.94 191.09999971-385.2 0-146.99999971-67.61999971-279-174.96-371.57999942L643.84666667 62C770.86666638 172.99999971 850.66666667 330.2 850.66666667 505.09999971c0 182.27999971-86.58 345.42-223.13999971 456.90000029zM405.64666638 782l-76.32-77.22a227.88 227.88 0 0 0 116.40000058-199.26A228.06 228.06 0 0 0 347.86666638 317.84000029L422.86666696 242A334.37999971 334.37999971 0 0 1 550.66666696 505.52 334.62 334.62 0 0 1 405.64666638 782zM205.66666638 596.6C164.26666638 596.6 130.66666667 562.51999971 130.66666667 520.64 130.66666667 478.76000029 164.26666638 444.79999971 205.66666638 444.79999971s74.99999971 33.95999971 75.00000058 75.90000058c0 41.87999971-33.59999971 75.84000029-75.00000058 75.83999942z
+ M0,0L28,0 28,14.0000006258488 28,15.0010000765324 28.0151405334473,15.0010000765324 28.0455417633057,15.8010965883732C28.4084091186524,22.9596563875675,30.92209815979,29.5507589876652,34.9532623291016,34.9410597383976L34.9984359741211,34.9999815523624 34.0966339111328,34.9885679781437C15.1841707229614,34.5094191133976,2.0535663480814E-07,19.0279375612736,0,0z
+ M535.9 165.2l96.5 195.4c3.9 7.9 11.4 13.3 20.1 14.6l215.7 31.3c21.9 3.2 30.6 30 14.8 45.5L726.8 604.1c-6.3 6.1-9.1 14.9-7.7 23.6L756 842.5c3.7 21.8-19.1 38.4-38.7 28.1L524.4 769.2c-7.8-4.1-17-4.1-24.8 0L306.7 870.6c-19.6 10.3-42.4-6.3-38.7-28.1l36.8-214.8c1.5-8.6-1.4-17.5-7.7-23.6L141.1 452c-15.8-15.4-7.1-42.3 14.8-45.5l215.7-31.3c8.7-1.3 16.2-6.7 20.1-14.6l96.5-195.4c9.7-19.9 37.9-19.9 47.7 0z
+ M938.666667 426.666667h-341.333334V85.333333c0-46.933333-38.4-85.333333-85.333333-85.333333s-85.333333 38.4-85.333333 85.333333v341.333334H85.333333c-46.933333 0-85.333333 38.4-85.333333 85.333333s38.4 85.333333 85.333333 85.333333h341.333334v341.333334c0 46.933333 38.4 85.333333 85.333333 85.333333s85.333333-38.4 85.333333-85.333333v-341.333334h341.333334c46.933333 0 85.333333-38.4 85.333333-85.333333s-38.4-85.333333-85.333333-85.333333z
+ M62.5797 488.9508c0.2632 42.5185 34.985 77.2116 77.5035 77.5035l743.0216-0.6728c42.5185 0.3215 76.7437-33.9333 76.4518-76.4805l0 0c-0.2918-42.5175-34.985-77.2106-77.5045-77.5035l-743.0216-0.087C96.513 411.4473 62.2879 446.4323 62.5797 488.9508L62.5797 488.9508z
+ M943.644188 827.215696l-351.176649-608.204749c-42.945473-74.36249-113.147387-74.36249-156.092861 0l-351.176649 608.204749c-42.946498 74.431167-7.811716 135.14955 78.012605 135.14955l702.420949 0C951.455904 962.36422 986.555836 901.645838 943.644188 827.215696zM466.187532 391.579035c12.621133-13.644108 28.66175-20.466675 48.233578-20.466675 19.580028 0 35.612444 6.75389 48.241778 20.194018 12.544256 13.473954 18.820484 30.325365 18.820484 50.587035 0 17.430551-26.19759 145.621205-34.929778 238.882082l-63.105666 0c-7.666162-93.259852-36.090106-221.450507-36.090106-238.882082C447.358847 421.938226 453.643275 405.155491 466.187532 391.579035zM561.76804 835.026386c-13.268949 12.928641-29.062535 19.375023-47.345906 19.375023-18.275171 0-34.076957-6.447407-47.346931-19.375023-13.235123-12.89379-19.818859-28.517221-19.818859-46.869269 0-18.249546 6.583736-34.043131 19.818859-47.278254 13.268949-13.235123 29.07176-19.852685 47.346931-19.852685 18.283371 0 34.076957 6.617562 47.345906 19.852685 13.235123 13.235123 19.827059 29.028709 19.827059 47.278254C581.595099 806.51019 575.003163 822.132597 561.76804 835.026386z
+ M505.6512 39.0144c-261.2224 3.4816-470.1184 218.112-466.6368 479.4368 3.4816 261.12 218.112 470.1184 479.3344 466.6368 261.2224-3.4816 470.1184-218.112 466.7392-479.3344C981.504 244.4288 766.8736 35.5328 505.6512 39.0144zM558.08 196.608c48.128 0 62.2592 27.9552 62.2592 59.8016 0 39.8336-31.9488 76.6976-86.3232 76.6976-45.568 0-67.1744-22.9376-65.9456-60.8256C468.0704 240.4352 494.7968 196.608 558.08 196.608zM434.7904 807.6288c-32.8704 0-56.9344-19.968-33.8944-107.6224l37.6832-155.5456c6.5536-24.8832 7.68-34.9184 0-34.9184-9.8304 0-52.5312 17.2032-77.7216 34.2016l-16.384-26.9312c79.9744-66.7648 171.8272-105.8816 211.2512-105.8816 32.8704 0 38.2976 38.912 21.9136 98.6112l-43.2128 163.5328c-7.68 28.8768-4.4032 38.912 3.2768 38.912 9.9328 0 42.1888-11.9808 73.9328-36.9664l18.6368 24.8832C552.5504 777.728 467.6608 807.6288 434.7904 807.6288z
+ M495.469714 0C224.621714 0 0 224.621714 0 495.469714c0 270.884571 224.621714 495.506286 495.469714 495.506286 270.884571 0 495.506286-224.621714 495.506286-495.506286C990.976 224.621714 766.354286 0 495.469714 0z m211.419429 634.221714c19.821714 19.821714 19.821714 46.226286 0 66.048s-46.226286 19.821714-66.048 0l-138.752-138.715428-145.334857 145.334857a51.858286 51.858286 0 0 1-72.667429 0 51.858286 51.858286 0 0 1 0-72.667429l145.334857-145.334857-138.752-138.752c-19.821714-19.821714-19.821714-46.226286 0-66.048s46.262857-19.821714 66.084572 0l138.715428 138.715429 145.371429-145.334857a51.858286 51.858286 0 0 1 72.667428 0 51.858286 51.858286 0 0 1 0 72.667428l-145.371428 145.334857 138.752 138.752z
+ M512.66048 64.64c-247.424 0-448 200.57728-448 448s200.576 448 448 448 448-200.57728 448-448c0-247.424-200.57728-448-448-448z m250.71232 334.86336L480.98176 681.89312c-15.49568 15.49696-40.61952 15.49696-56.11648 0l-162.9184-162.9184c-15.49568-15.49568-15.49568-40.61824 0-56.1152s40.61952-15.49568 56.11648 0l134.85952 134.85952L707.25504 343.3856c15.49568-15.49568 40.61952-15.49568 56.11648 0s15.49696 40.6208 0.00128 56.11776z
+ M716.8 375.466667l34.133333 34.133333c17.066667 17.066667 42.666667 17.066667 59.733334 0 17.066667-17.066667 17.066667-42.666667 0-59.733333l-34.133334-34.133334 34.133334-34.133333c17.066667-17.066667 17.066667-42.666667 0-59.733333-17.066667-17.066667-42.666667-17.066667-59.733334 0l-34.133333 34.133333-34.133333-34.133333c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733333l34.133334 34.133333-34.133334 34.133334c-17.066667 17.066667-17.066667 42.666667 0 59.733333 17.066667 17.066667 42.666667 17.066667 59.733334 0l34.133333-34.133333z m-426.666667 0l34.133334 34.133333c17.066667 17.066667 42.666667 17.066667 59.733333 0 17.066667-17.066667 17.066667-42.666667 0-59.733333l-34.133333-34.133334 34.133333-34.133333c17.066667-17.066667 17.066667-42.666667 0-59.733333-17.066667-17.066667-42.666667-17.066667-59.733333 0l-34.133334 34.133333-34.133333-34.133333c-17.066667-17.066667-42.666667-17.066667-59.733333 0-17.066667 17.066667-17.066667 42.666667 0 59.733333l34.133333 34.133333-34.133333 34.133334c-17.066667 17.066667-17.066667 42.666667 0 59.733333 17.066667 17.066667 42.666667 17.066667 59.733333 0l34.133333-34.133333zM0 85.333333c0-51.2 42.666667-85.333333 85.333333-85.333333h853.333334c51.2 0 85.333333 42.666667 85.333333 85.333333v853.333334c0 51.2-42.666667 85.333333-85.333333 85.333333H85.333333c-51.2 0-85.333333-42.666667-85.333333-85.333333V85.333333z m512 469.333334c-136.533333 0-230.4 68.266667-290.133333 196.266666-8.533333 17.066667 0 42.666667 17.066666 59.733334s42.666667 0 59.733334-17.066667c51.2-93.866667 110.933333-145.066667 221.866666-145.066667 102.4 0 170.666667 51.2 221.866667 145.066667 8.533333 17.066667 34.133333 25.6 59.733333 17.066667 17.066667-8.533333 25.6-34.133333 17.066667-59.733334-76.8-128-170.666667-196.266667-307.2-196.266666z
+ M512 0 30.11843 240.941297l0 542.117406 481.88157 240.941297 481.88157-240.941297L993.88157 240.941297 512 0zM575.776472 768.799969 460.188012 768.799969 460.188012 656.222073l115.588459 0L575.776472 768.799969zM623.335603 509.329685c-52.375829 36.723353-59.600363 55.988096-59.600363 84.885211l0 19.866447L468.616977 614.081343l0-26.489278c0-45.754021 13.846342-80.67124 61.406497-116.791866 46.957428-36.723353 57.79423-62.0082 57.79423-84.282484 0-25.284848-21.67258-54.181962-55.386393-54.181962-42.743457 0-70.436142 26.489278-82.477374 85.486914l-105.956088-21.67258c24.683144-111.976192 82.477374-157.127486 205.289345-157.127486 98.12985 0 157.72919 63.212631 157.72919 131.842639C707.017407 423.240044 688.956071 461.76953 623.335603 509.329685z
+ M 721.005 638.949 C 758.74 638.949 789.333 669.56 789.333 707.312 C 789.333 745.047 758.74 775.657 721.005 775.657 C 683.253 775.657 652.66 745.047 652.66 707.312 C 652.66 669.56 683.253 638.949 721.005 638.949 Z M 512.017 638.949 C 549.77 638.949 580.38 669.56 580.38 707.312 C 580.38 745.047 549.77 775.657 512.017 775.657 C 474.265 775.657 443.672 745.047 443.672 707.312 C 443.672 669.56 474.265 638.949 512.017 638.949 Z M 303.029 638.949 C 340.781 638.949 371.392 669.56 371.392 707.312 C 371.392 745.047 340.781 775.657 303.029 775.657 C 265.277 775.657 234.667 745.047 234.667 707.312 C 234.667 669.56 265.277 638.949 303.029 638.949 Z M 721.005 443.655 C 758.74 443.655 789.333 474.265 789.333 512.017 C 789.333 549.769 758.74 580.363 721.005 580.363 C 683.253 580.363 652.66 549.769 652.66 512.017 C 652.66 474.265 683.253 443.655 721.005 443.655 Z M 512.017 443.655 C 549.77 443.655 580.38 474.265 580.38 512.017 C 580.38 549.769 549.77 580.363 512.017 580.363 C 474.265 580.363 443.672 549.769 443.672 512.017 C 443.672 474.265 474.265 443.655 512.017 443.655 Z M 303.029 443.655 C 340.781 443.655 371.392 474.265 371.392 512.017 C 371.392 549.769 340.781 580.363 303.029 580.363 C 265.277 580.363 234.667 549.769 234.667 512.017 C 234.667 474.265 265.277 443.655 303.029 443.655 Z M 721.005 248.343 C 758.74 248.343 789.333 278.953 789.333 316.688 C 789.333 354.44 758.74 385.051 721.005 385.051 C 683.253 385.051 652.66 354.44 652.66 316.688 C 652.66 278.953 683.253 248.343 721.005 248.343 Z M 512.017 248.343 C 549.77 248.343 580.38 278.953 580.38 316.688 C 580.38 354.44 549.77 385.051 512.017 385.051 C 474.265 385.051 443.672 354.44 443.672 316.688 C 443.672 278.953 474.265 248.343 512.017 248.343 Z M 303.029 248.343 C 340.781 248.343 371.392 278.953 371.392 316.688 C 371.392 354.44 340.781 385.051 303.029 385.051 C 265.277 385.051 234.667 354.44 234.667 316.688 C 234.667 278.953 265.277 248.343 303.029 248.343 Z
+ M384 896C384 825.307552 440.814697 768 512 768 582.692448 768 640 824.814694 640 896 640 966.692448 583.185303 1024 512 1024 441.307552 1024 384 967.185306 384 896ZM384 512C384 441.307552 440.814697 384 512 384 582.692448 384 640 440.814697 640 512 640 582.692448 583.185303 640 512 640 441.307552 640 384 583.185303 384 512ZM384 128C384 57.307552 440.814697 0 512 0 582.692448 0 640 56.814697 640 128 640 198.692448 583.185303 256 512 256 441.307552 256 384 199.185303 384 128Z
+ M798.165333 97.834667a42.624 42.624 0 0 0-60.330666 0l-140.629334 140.629333-55.381333-55.296-60.330667 60.330667 55.381334 55.296-353.706667 353.706666a42.709333 42.709333 0 0 0-11.221333 19.84l-42.666667 170.666667a42.538667 42.538667 0 0 0 51.712 51.712l170.666667-42.666667c7.509333-1.877333 14.378667-5.76 19.84-11.221333l353.792-353.792 55.210666 55.125333 60.330667-60.330666-55.210667-55.125334 140.544-140.544a42.624 42.624 0 0 0 0-60.330666l-128-128zM319.488 772.138667l-90.197333 22.570666 22.570666-90.197333 345.386667-345.386667 67.669333 67.584-345.429333 345.429334z
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/NumericUpDownBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/NumericUpDownBaseStyle.xaml
index c69f0993..ae0f1b99 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/NumericUpDownBaseStyle.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/NumericUpDownBaseStyle.xaml
@@ -158,10 +158,10 @@
-
+
-
+
@@ -169,7 +169,7 @@
-
+
@@ -225,10 +225,10 @@
-
+
-
+
@@ -236,7 +236,7 @@
-
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/PinBoxBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/PinBoxBaseStyle.xaml
index 98d80b3f..a81214d7 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/PinBoxBaseStyle.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/PinBoxBaseStyle.xaml
@@ -2,8 +2,21 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls">
-
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ProgressBarBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ProgressBarBaseStyle.xaml
index 214e7556..4e5ac058 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ProgressBarBaseStyle.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ProgressBarBaseStyle.xaml
@@ -1,7 +1,8 @@
+ xmlns:shapes="clr-namespace:HandyControl.Expression.Shapes"
+ xmlns:system="clr-namespace:System;assembly=mscorlib">
@@ -33,18 +34,58 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -70,11 +111,19 @@
-
+
+
+
+
+
+
+
+
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/SeparatorBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/SeparatorBaseStyle.xaml
new file mode 100644
index 00000000..2b9f91b0
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/SeparatorBaseStyle.xaml
@@ -0,0 +1,8 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/SliderBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/SliderBaseStyle.xaml
index 9d71bc2a..d371ad3a 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/SliderBaseStyle.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/SliderBaseStyle.xaml
@@ -72,7 +72,7 @@
-
+
@@ -103,7 +103,7 @@
-
+
@@ -134,7 +134,7 @@
-
+
@@ -165,7 +165,7 @@
-
+
@@ -223,14 +223,14 @@
-
+
-
+
@@ -280,14 +280,14 @@
-
+
-
+
@@ -709,7 +709,7 @@
-
+
@@ -740,7 +740,7 @@
-
+
@@ -771,7 +771,7 @@
-
+
@@ -802,7 +802,7 @@
-
+
@@ -862,7 +862,7 @@
-
+
@@ -870,7 +870,7 @@
-
+
@@ -920,7 +920,7 @@
-
+
@@ -928,7 +928,7 @@
-
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/StatusBarBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/StatusBarBaseStyle.xaml
new file mode 100644
index 00000000..1da267ba
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/StatusBarBaseStyle.xaml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/TextBoxBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/TextBoxBaseStyle.xaml
index b2179bd3..97beb5d6 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/TextBoxBaseStyle.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/TextBoxBaseStyle.xaml
@@ -24,7 +24,7 @@
-
+
@@ -51,7 +51,7 @@
-
+
@@ -81,7 +81,7 @@
-
+
@@ -110,7 +110,7 @@
-
+
@@ -167,7 +167,7 @@
-
+
@@ -227,7 +227,7 @@
-
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml
new file mode 100644
index 00000000..e64aedab
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Image.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Image.xaml
index 5fd888c7..12c5dff7 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Image.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Image.xaml
@@ -2,7 +2,7 @@
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/ProgressBar.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/ProgressBar.xaml
index dba2c685..cb21a15c 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/ProgressBar.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/ProgressBar.xaml
@@ -1,6 +1,7 @@
+ xmlns:controls="clr-namespace:HandyControl.Controls"
+ xmlns:system="clr-namespace:System;assembly=mscorlib">
@@ -42,8 +43,8 @@
-
-
+
+
@@ -72,8 +73,8 @@
-
-
+
+
@@ -102,8 +103,8 @@
-
-
+
+
@@ -132,8 +133,8 @@
-
-
+
+
@@ -162,8 +163,8 @@
-
-
+
+
@@ -223,14 +224,43 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Separator.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Separator.xaml
new file mode 100644
index 00000000..f50f2ab3
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Separator.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/StatusBar.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/StatusBar.xaml
new file mode 100644
index 00000000..9f2a27b3
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/StatusBar.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
index 308b65d4..5a7386e4 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
@@ -79,6 +79,9 @@
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/TransitioningContentControl.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/TransitioningContentControl.xaml
index 8d7d7d4a..b9b21f96 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/TransitioningContentControl.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/TransitioningContentControl.xaml
@@ -1,5 +1,6 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:controls="clr-namespace:HandyControl.Controls">
@@ -73,4 +74,8 @@
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/DependencyObjectExtension.cs b/src/Shared/HandyControl_Shared/Tools/Extension/DependencyObjectExtension.cs
new file mode 100644
index 00000000..779d25bf
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Tools/Extension/DependencyObjectExtension.cs
@@ -0,0 +1,18 @@
+using System.Windows;
+using System.Windows.Media;
+
+namespace HandyControl.Tools.Extension
+{
+ public static class DependencyObjectExtension
+ {
+ public static DependencyObject GetVisualOrLogicalParent(this DependencyObject sourceElement)
+ {
+ return sourceElement switch
+ {
+ null => null,
+ Visual _ => (VisualTreeHelper.GetParent(sourceElement) ?? LogicalTreeHelper.GetParent(sourceElement)),
+ _ => LogicalTreeHelper.GetParent(sourceElement)
+ };
+ }
+ }
+}
diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/EnumerableExtension.cs b/src/Shared/HandyControl_Shared/Tools/Extension/EnumerableExtension.cs
index 68232166..3d5685db 100644
--- a/src/Shared/HandyControl_Shared/Tools/Extension/EnumerableExtension.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Extension/EnumerableExtension.cs
@@ -16,5 +16,16 @@ namespace HandyControl.Tools.Extension
return enumerable;
}
+
+ public static IEnumerable DoWithIndex(this IEnumerable source, Action predicate)
+ {
+ var enumerable = source as IList ?? source.ToList();
+ for (var i = 0; i < enumerable.Count; i++)
+ {
+ predicate.Invoke(enumerable[i], i);
+ }
+
+ return enumerable;
+ }
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/ConfigHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/ConfigHelper.cs
index 21357505..1e9fecf0 100644
--- a/src/Shared/HandyControl_Shared/Tools/Helper/ConfigHelper.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Helper/ConfigHelper.cs
@@ -6,6 +6,7 @@ using System.Runtime.CompilerServices;
#endif
using System.Windows;
using System.Windows.Markup;
+using System.Windows.Media.Animation;
using HandyControl.Controls;
using HandyControl.Data;
@@ -50,6 +51,19 @@ namespace HandyControl.Tools
{
SetSystemVersionInfo(config.SystemVersionInfo);
SetLang(config.Lang);
+ SetTimelineFrameRate(config.TimelineFrameRate);
+ }
+
+ public void SetTimelineFrameRate(int rate) =>
+ Timeline.DesiredFrameRateProperty.OverrideMetadata(typeof(Timeline), new FrameworkPropertyMetadata(rate));
+
+ public void SetWindowDefaultStyle(object resourceKey = null)
+ {
+ var metadata = resourceKey == null
+ ? new FrameworkPropertyMetadata(Application.Current.FindResource(typeof(System.Windows.Window)))
+ : new FrameworkPropertyMetadata(Application.Current.FindResource(resourceKey));
+
+ FrameworkElement.StyleProperty.OverrideMetadata(typeof(System.Windows.Window), metadata);
}
public event PropertyChangedEventHandler PropertyChanged;
diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/DpiHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/DpiHelper.cs
index 76134f6a..d7669756 100644
--- a/src/Shared/HandyControl_Shared/Tools/Helper/DpiHelper.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Helper/DpiHelper.cs
@@ -1,14 +1,54 @@
using System;
using System.Windows;
using System.Windows.Media;
+using HandyControl.Tools.Interop;
namespace HandyControl.Tools
{
- internal class DpiHelper
+ internal static class DpiHelper
{
- [ThreadStatic]
+ private const double LogicalDpi = 96.0;
+
+ [ThreadStatic]
private static Matrix _transformToDip;
+ static DpiHelper()
+ {
+ var dC = InteropMethods.GetDC(IntPtr.Zero);
+ if (dC != IntPtr.Zero)
+ {
+ DeviceDpiX = InteropMethods.GetDeviceCaps(dC, 88);
+ DeviceDpiY = InteropMethods.GetDeviceCaps(dC, 90);
+ InteropMethods.ReleaseDC(IntPtr.Zero, dC);
+ }
+ else
+ {
+ DeviceDpiX = LogicalDpi;
+ DeviceDpiY = LogicalDpi;
+ }
+
+ var identity = Matrix.Identity;
+ var identity2 = Matrix.Identity;
+ identity.Scale(DeviceDpiX / LogicalDpi, DeviceDpiY / LogicalDpi);
+ identity2.Scale(LogicalDpi / DeviceDpiX, LogicalDpi / DeviceDpiY);
+ TransformFromDevice = new MatrixTransform(identity2);
+ TransformFromDevice.Freeze();
+ TransformToDevice = new MatrixTransform(identity);
+ TransformToDevice.Freeze();
+ }
+
+ public static MatrixTransform TransformFromDevice { get; }
+
+ public static MatrixTransform TransformToDevice { get; }
+
+ public static double DeviceDpiX { get; }
+
+ public static double DeviceDpiY { get; }
+
+ public static double LogicalToDeviceUnitsScalingFactorX => TransformToDevice.Matrix.M11;
+
+ public static double LogicalToDeviceUnitsScalingFactorY => TransformToDevice.Matrix.M22;
+
public static Point DevicePixelsToLogical(Point devicePoint, double dpiScaleX, double dpiScaleY)
{
_transformToDip = Matrix.Identity;
@@ -18,9 +58,22 @@ namespace HandyControl.Tools
public static Size DeviceSizeToLogical(Size deviceSize, double dpiScaleX, double dpiScaleY)
{
- Point pt = DevicePixelsToLogical(new Point(deviceSize.Width, deviceSize.Height), dpiScaleX, dpiScaleY);
-
+ var pt = DevicePixelsToLogical(new Point(deviceSize.Width, deviceSize.Height), dpiScaleX, dpiScaleY);
return new Size(pt.X, pt.Y);
}
+
+ public static Rect LogicalToDeviceUnits(this Rect logicalRect)
+ {
+ var result = logicalRect;
+ result.Transform(TransformToDevice.Matrix);
+ return result;
+ }
+
+ public static Rect DeviceToLogicalUnits(this Rect deviceRect)
+ {
+ var result = deviceRect;
+ result.Transform(TransformFromDevice.Matrix);
+ return result;
+ }
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/IconHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/IconHelper.cs
index 225302dd..f5f1bfb4 100644
--- a/src/Shared/HandyControl_Shared/Tools/Helper/IconHelper.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Helper/IconHelper.cs
@@ -79,13 +79,13 @@ namespace HandyControl.Tools
try
{
- var bi = new BITMAPINFO(width, -height, 32)
+ var bi = new InteropValues.BITMAPINFO(width, -height, 32)
{
- bmiHeader_biCompression = NativeMethods.BI_RGB
+ biCompression = InteropValues.BI_RGB
};
var bits = IntPtr.Zero;
- colorBitmap = UnsafeNativeMethods.CreateDIBSection(new HandleRef(null, IntPtr.Zero), ref bi, NativeMethods.DIB_RGB_COLORS, ref bits, null, 0);
+ colorBitmap = InteropMethods.CreateDIBSection(new HandleRef(null, IntPtr.Zero), ref bi, InteropValues.DIB_RGB_COLORS, ref bits, null, 0);
if (colorBitmap.IsInvalid || bits == IntPtr.Zero)
{
@@ -95,13 +95,13 @@ namespace HandyControl.Tools
Marshal.Copy(colorArray, 0, bits, colorArray.Length);
var maskArray = GenerateMaskArray(width, height, colorArray);
- maskBitmap = UnsafeNativeMethods.CreateBitmap(width, height, 1, 1, maskArray);
+ maskBitmap = InteropMethods.CreateBitmap(width, height, 1, 1, maskArray);
if (maskBitmap.IsInvalid)
{
return IconHandle.GetInvalidIcon();
}
- var iconInfo = new ICONINFO
+ var iconInfo = new InteropValues.ICONINFO
{
fIcon = isIcon,
xHotspot = xHotspot,
@@ -110,7 +110,7 @@ namespace HandyControl.Tools
hbmColor = colorBitmap
};
- return UnsafeNativeMethods.CreateIconIndirect(iconInfo);
+ return InteropMethods.CreateIconIndirect(iconInfo);
}
finally
{
@@ -252,21 +252,21 @@ namespace HandyControl.Tools
{
if (SystemBitDepth == 0)
{
- var hdcDesktop = new HandleRef(null, UnsafeNativeMethods.GetDC(new HandleRef()));
+ var hdcDesktop = new HandleRef(null, InteropMethods.GetDC(new HandleRef()));
try
{
- var sysBitDepth = UnsafeNativeMethods.GetDeviceCaps(hdcDesktop, NativeMethods.BITSPIXEL);
- sysBitDepth *= UnsafeNativeMethods.GetDeviceCaps(hdcDesktop, NativeMethods.PLANES);
+ var sysBitDepth = InteropMethods.GetDeviceCaps(hdcDesktop, InteropValues.BITSPIXEL);
+ sysBitDepth *= InteropMethods.GetDeviceCaps(hdcDesktop, InteropValues.PLANES);
if (sysBitDepth == 8)
{
sysBitDepth = 4;
}
- var cxSmallIcon = UnsafeNativeMethods.GetSystemMetrics(SM.CXSMICON);
- var cySmallIcon = UnsafeNativeMethods.GetSystemMetrics(SM.CYSMICON);
- var cxIcon = UnsafeNativeMethods.GetSystemMetrics(SM.CXICON);
- var cyIcon = UnsafeNativeMethods.GetSystemMetrics(SM.CYICON);
+ var cxSmallIcon = InteropMethods.GetSystemMetrics(InteropValues.SM.CXSMICON);
+ var cySmallIcon = InteropMethods.GetSystemMetrics(InteropValues.SM.CYSMICON);
+ var cxIcon = InteropMethods.GetSystemMetrics(InteropValues.SM.CXICON);
+ var cyIcon = InteropMethods.GetSystemMetrics(InteropValues.SM.CYICON);
SmallIconSize = new Size(cxSmallIcon, cySmallIcon);
IconSize = new Size(cxIcon, cyIcon);
@@ -274,7 +274,7 @@ namespace HandyControl.Tools
}
finally
{
- UnsafeNativeMethods.ReleaseDC(new HandleRef(), hdcDesktop);
+ InteropMethods.ReleaseDC(new HandleRef(), hdcDesktop);
}
}
}
@@ -287,8 +287,8 @@ namespace HandyControl.Tools
SecurityHelper.DemandUIWindowPermission();
- var iconModuleFile = UnsafeNativeMethods.GetModuleFileName(new HandleRef());
- UnsafeNativeMethods.ExtractIconEx(iconModuleFile, 0, out largeIconHandle, out smallIconHandle, 1);
+ var iconModuleFile = InteropMethods.GetModuleFileName(new HandleRef());
+ InteropMethods.ExtractIconEx(iconModuleFile, 0, out largeIconHandle, out smallIconHandle, 1);
}
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/ScreenHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/ScreenHelper.cs
new file mode 100644
index 00000000..9bcfab2f
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Tools/Helper/ScreenHelper.cs
@@ -0,0 +1,85 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Windows;
+using HandyControl.Tools.Interop;
+
+namespace HandyControl.Tools
+{
+ internal class ScreenHelper
+ {
+ internal static void FindMaximumSingleMonitorRectangle(Rect windowRect, out Rect screenSubRect, out Rect monitorRect)
+ {
+ var windowRect2 = new InteropValues.RECT(windowRect);
+ FindMaximumSingleMonitorRectangle(windowRect2, out var rect, out var rect2);
+ screenSubRect = new Rect(rect.Position, rect.Size);
+ monitorRect = new Rect(rect2.Position, rect2.Size);
+ }
+
+ private static void FindMaximumSingleMonitorRectangle(InteropValues.RECT windowRect, out InteropValues.RECT screenSubRect, out InteropValues.RECT monitorRect)
+ {
+ var rects = new List();
+ InteropMethods.EnumDisplayMonitors(IntPtr.Zero, IntPtr.Zero,
+ delegate(IntPtr hMonitor, IntPtr hdcMonitor, ref InteropValues.RECT rect, IntPtr lpData)
+ {
+ var monitorInfo = default(InteropValues.MONITORINFO);
+ monitorInfo.cbSize = (uint) Marshal.SizeOf(typeof(InteropValues.MONITORINFO));
+ InteropMethods.GetMonitorInfo(hMonitor, ref monitorInfo);
+ rects.Add(monitorInfo.rcWork);
+ return true;
+ }, IntPtr.Zero);
+
+ var num = 0L;
+
+ screenSubRect = new InteropValues.RECT
+ {
+ Left = 0,
+ Right = 0,
+ Top = 0,
+ Bottom = 0
+ };
+
+ monitorRect = new InteropValues.RECT
+ {
+ Left = 0,
+ Right = 0,
+ Top = 0,
+ Bottom = 0
+ };
+
+ foreach (var current in rects)
+ {
+ var rect = current;
+ InteropMethods.IntersectRect(out var rECT2, ref rect, ref windowRect);
+ var num2 = (long) (rECT2.Width * rECT2.Height);
+ if (num2 > num)
+ {
+ screenSubRect = rECT2;
+ monitorRect = current;
+ num = num2;
+ }
+ }
+ }
+
+ internal static void FindMonitorRectsFromPoint(Point point, out Rect monitorRect, out Rect workAreaRect)
+ {
+ var intPtr = InteropMethods.MonitorFromPoint(new InteropValues.POINT
+ {
+ X = (int) point.X,
+ Y = (int) point.Y
+ }, 2);
+
+ monitorRect = new Rect(0.0, 0.0, 0.0, 0.0);
+ workAreaRect = new Rect(0.0, 0.0, 0.0, 0.0);
+
+ if (intPtr != IntPtr.Zero)
+ {
+ InteropValues.MONITORINFO monitorInfo = default;
+ monitorInfo.cbSize = (uint) Marshal.SizeOf(typeof(InteropValues.MONITORINFO));
+ InteropMethods.GetMonitorInfo(intPtr, ref monitorInfo);
+ monitorRect = new Rect(monitorInfo.rcMonitor.Position, monitorInfo.rcMonitor.Size);
+ workAreaRect = new Rect(monitorInfo.rcWork.Position, monitorInfo.rcWork.Size);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/VisualHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/VisualHelper.cs
index 489a0d49..b6351478 100644
--- a/src/Shared/HandyControl_Shared/Tools/Helper/VisualHelper.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Helper/VisualHelper.cs
@@ -3,6 +3,7 @@ using System.Linq;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
+using HandyControl.Tools.Interop;
namespace HandyControl.Tools
{
@@ -11,10 +12,7 @@ namespace HandyControl.Tools
internal static VisualStateGroup TryGetVisualStateGroup(DependencyObject d, string groupName)
{
var root = GetImplementationRoot(d);
- if (root == null)
- {
- return null;
- }
+ if (root == null) return null;
return VisualStateManager
.GetVisualStateGroups(root)?
@@ -31,10 +29,7 @@ namespace HandyControl.Tools
public static T GetChild(DependencyObject d) where T : DependencyObject
{
- if (d is T t)
- {
- return t;
- }
+ if (d is T t) return t;
for (var i = 0; i < VisualTreeHelper.GetChildrenCount(d); i++)
{
@@ -47,7 +42,34 @@ namespace HandyControl.Tools
return default;
}
- public static IntPtr GetHandle(this Visual visual) =>
- (PresentationSource.FromVisual(visual) as HwndSource)?.Handle ?? IntPtr.Zero;
+ public static IntPtr GetHandle(this Visual visual)
+ {
+ return (PresentationSource.FromVisual(visual) as HwndSource)?.Handle ?? IntPtr.Zero;
+ }
+
+ internal static void HitTestVisibleElements(Visual visual, HitTestResultCallback resultCallback,
+ HitTestParameters parameters)
+ {
+ VisualTreeHelper.HitTest(visual, ExcludeNonVisualElements, resultCallback, parameters);
+ }
+
+ private static HitTestFilterBehavior ExcludeNonVisualElements(DependencyObject potentialHitTestTarget)
+ {
+ if (!(potentialHitTestTarget is Visual)) return HitTestFilterBehavior.ContinueSkipSelfAndChildren;
+
+ if (!(potentialHitTestTarget is UIElement uIElement) || uIElement.IsVisible && uIElement.IsEnabled)
+ return HitTestFilterBehavior.Continue;
+
+ return HitTestFilterBehavior.ContinueSkipSelfAndChildren;
+ }
+
+ internal static bool ModifyStyle(IntPtr hWnd, int styleToRemove, int styleToAdd)
+ {
+ var windowLong = InteropMethods.GetWindowLong(hWnd, InteropValues.GWL.STYLE);
+ var num = (windowLong & ~styleToRemove) | styleToAdd;
+ if (num == windowLong) return false;
+ InteropMethods.SetWindowLong(hWnd, InteropValues.GWL.STYLE, num);
+ return true;
+ }
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs
index c606d165..23f73766 100644
--- a/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs
@@ -19,7 +19,7 @@ namespace HandyControl.Tools
///
public static Window GetActiveWindow() => Application.Current.Windows.OfType().SingleOrDefault(x => x.IsActive);
- private static readonly BitArray _cacheValid = new BitArray((int)CacheSlot.NumSlots);
+ private static readonly BitArray _cacheValid = new BitArray((int)InteropValues.CacheSlot.NumSlots);
private static bool _setDpiX = true;
@@ -43,7 +43,7 @@ namespace HandyControl.Tools
var desktopWnd = new HandleRef(null, IntPtr.Zero);
// Win32Exception will get the Win32 error code so we don't have to
- var dc = UnsafeNativeMethods.GetDC(desktopWnd);
+ var dc = InteropMethods.GetDC(desktopWnd);
// Detecting error case from unmanaged call, required by PREsharp to throw a Win32Exception
if (dc == IntPtr.Zero)
@@ -53,12 +53,12 @@ namespace HandyControl.Tools
try
{
- _dpi = UnsafeNativeMethods.GetDeviceCaps(new HandleRef(null, dc), NativeMethods.LOGPIXELSY);
+ _dpi = InteropMethods.GetDeviceCaps(new HandleRef(null, dc), InteropValues.LOGPIXELSY);
_dpiInitialized = true;
}
finally
{
- UnsafeNativeMethods.ReleaseDC(desktopWnd, new HandleRef(null, dc));
+ InteropMethods.ReleaseDC(desktopWnd, new HandleRef(null, dc));
}
}
}
@@ -82,19 +82,19 @@ namespace HandyControl.Tools
{
_setDpiX = false;
var desktopWnd = new HandleRef(null, IntPtr.Zero);
- var dc = UnsafeNativeMethods.GetDC(desktopWnd);
+ var dc = InteropMethods.GetDC(desktopWnd);
if (dc == IntPtr.Zero)
{
throw new Win32Exception();
}
try
{
- _dpiX = UnsafeNativeMethods.GetDeviceCaps(new HandleRef(null, dc), NativeMethods.LOGPIXELSX);
- _cacheValid[(int)CacheSlot.DpiX] = true;
+ _dpiX = InteropMethods.GetDeviceCaps(new HandleRef(null, dc), InteropValues.LOGPIXELSX);
+ _cacheValid[(int)InteropValues.CacheSlot.DpiX] = true;
}
finally
{
- UnsafeNativeMethods.ReleaseDC(desktopWnd, new HandleRef(null, dc));
+ InteropMethods.ReleaseDC(desktopWnd, new HandleRef(null, dc));
}
}
}
@@ -113,11 +113,11 @@ namespace HandyControl.Tools
{
lock (_cacheValid)
{
- while (!_cacheValid[(int)CacheSlot.WindowResizeBorderThickness])
+ while (!_cacheValid[(int)InteropValues.CacheSlot.WindowResizeBorderThickness])
{
- _cacheValid[(int)CacheSlot.WindowResizeBorderThickness] = true;
+ _cacheValid[(int)InteropValues.CacheSlot.WindowResizeBorderThickness] = true;
- var frameSize = new Size(NativeMethods.GetSystemMetrics(SM.CXSIZEFRAME), NativeMethods.GetSystemMetrics(SM.CYSIZEFRAME));
+ var frameSize = new Size(InteropMethods.GetSystemMetrics(InteropValues.SM.CXSIZEFRAME), InteropMethods.GetSystemMetrics(InteropValues.SM.CYSIZEFRAME));
var frameSizeInDips = DpiHelper.DeviceSizeToLogical(frameSize, DpiX / 96.0, Dpi / 96.0);
_windowResizeBorderThickness = new Thickness(frameSizeInDips.Width, frameSizeInDips.Height, frameSizeInDips.Width, frameSizeInDips.Height);
@@ -135,9 +135,9 @@ namespace HandyControl.Tools
#if netle40
return WindowResizeBorderThickness;
#elif Core
- var hdc = UnsafeNativeMethods.GetDC(IntPtr.Zero);
- var scale = UnsafeNativeMethods.GetDeviceCaps(hdc, NativeMethods.DESKTOPVERTRES) / (float)UnsafeNativeMethods.GetDeviceCaps(hdc, NativeMethods.VERTRES);
- UnsafeNativeMethods.ReleaseDC(IntPtr.Zero, hdc);
+ var hdc = InteropMethods.GetDC(IntPtr.Zero);
+ var scale = InteropMethods.GetDeviceCaps(hdc, InteropValues.DESKTOPVERTRES) / (float)InteropMethods.GetDeviceCaps(hdc, InteropValues.VERTRES);
+ InteropMethods.ReleaseDC(IntPtr.Zero, hdc);
return WindowResizeBorderThickness.Add(new Thickness(4 * scale));
#else
return WindowResizeBorderThickness.Add(new Thickness(4));
@@ -148,5 +148,7 @@ namespace HandyControl.Tools
public static IntPtr CreateHandle() => new WindowInteropHelper(new Window()).EnsureHandle();
public static IntPtr GetHandle(this Window window) => new WindowInteropHelper(window).EnsureHandle();
+
+ public static HwndSource GetHwndSource(this Window window) => HwndSource.FromHwnd(window.GetHandle());
}
}
diff --git a/src/Shared/HandyControl_Shared/Tools/Hook/ClipboardHook.cs b/src/Shared/HandyControl_Shared/Tools/Hook/ClipboardHook.cs
index b98bb50a..61c9fc8f 100644
--- a/src/Shared/HandyControl_Shared/Tools/Hook/ClipboardHook.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Hook/ClipboardHook.cs
@@ -24,19 +24,19 @@ namespace HandyControl.Tools
if (HWndSource != null)
{
HWndSource.AddHook(WinProc);
- NativeMethods.AddClipboardFormatListener(HookId);
+ InteropMethods.AddClipboardFormatListener(HookId);
}
}
public static void Stop()
{
HWndSource.RemoveHook(WinProc);
- NativeMethods.RemoveClipboardFormatListener(HookId);
+ InteropMethods.RemoveClipboardFormatListener(HookId);
}
private static IntPtr WinProc(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam, ref bool handled)
{
- if (msg == NativeMethods.WM_CLIPBOARDUPDATE)
+ if (msg == InteropValues.WM_CLIPBOARDUPDATE)
{
ContentChanged?.Invoke();
}
diff --git a/src/Shared/HandyControl_Shared/Tools/Hook/KeyboardHook.cs b/src/Shared/HandyControl_Shared/Tools/Hook/KeyboardHook.cs
index 07ce92b6..58388c83 100644
--- a/src/Shared/HandyControl_Shared/Tools/Hook/KeyboardHook.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Hook/KeyboardHook.cs
@@ -14,17 +14,17 @@ namespace HandyControl.Tools
private static IntPtr HookId = IntPtr.Zero;
- private static readonly UnsafeNativeMethods.HookProc Proc = HookCallback;
+ private static readonly InteropValues.HookProc Proc = HookCallback;
private static int VirtualKey;
- private static readonly IntPtr KeyDownIntPtr = (IntPtr)NativeMethods.WM_KEYDOWN;
+ private static readonly IntPtr KeyDownIntPtr = (IntPtr)InteropValues.WM_KEYDOWN;
- private static readonly IntPtr KeyUpIntPtr = (IntPtr)NativeMethods.WM_KEYUP;
+ private static readonly IntPtr KeyUpIntPtr = (IntPtr)InteropValues.WM_KEYUP;
- private static readonly IntPtr SyskeyDownIntPtr = (IntPtr)NativeMethods.WM_SYSKEYDOWN;
+ private static readonly IntPtr SyskeyDownIntPtr = (IntPtr)InteropValues.WM_SYSKEYDOWN;
- private static readonly IntPtr SyskeyUpIntPtr = (IntPtr)NativeMethods.WM_SYSKEYUP;
+ private static readonly IntPtr SyskeyUpIntPtr = (IntPtr)InteropValues.WM_SYSKEYUP;
public static void Start()
{
@@ -35,17 +35,17 @@ namespace HandyControl.Tools
HookId = SetHook(Proc);
}
- public static void Stop() => UnsafeNativeMethods.UnhookWindowsHookEx(HookId);
+ public static void Stop() => InteropMethods.UnhookWindowsHookEx(HookId);
- private static IntPtr SetHook(UnsafeNativeMethods.HookProc proc)
+ private static IntPtr SetHook(InteropValues.HookProc proc)
{
using (var curProcess = Process.GetCurrentProcess())
using (var curModule = curProcess.MainModule)
{
if (curModule != null)
{
- return UnsafeNativeMethods.SetWindowsHookEx((int)UnsafeNativeMethods.HookType.WH_KEYBOARD_LL, proc,
- UnsafeNativeMethods.GetModuleHandle(curModule.ModuleName), 0);
+ return InteropMethods.SetWindowsHookEx((int)InteropValues.HookType.WH_KEYBOARD_LL, proc,
+ InteropMethods.GetModuleHandle(curModule.ModuleName), 0);
}
return IntPtr.Zero;
}
@@ -86,7 +86,7 @@ namespace HandyControl.Tools
KeyUp?.Invoke(null, new KeyboardHookEventArgs(virtualKey, true));
}
}
- return UnsafeNativeMethods.CallNextHookEx(HookId, nCode, wParam, lParam);
+ return InteropMethods.CallNextHookEx(HookId, nCode, wParam, lParam);
}
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Hook/MouseHook.cs b/src/Shared/HandyControl_Shared/Tools/Hook/MouseHook.cs
index 5405c6cf..90b1f0d6 100644
--- a/src/Shared/HandyControl_Shared/Tools/Hook/MouseHook.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Hook/MouseHook.cs
@@ -12,7 +12,7 @@ namespace HandyControl.Tools
private static IntPtr HookId = IntPtr.Zero;
- private static readonly UnsafeNativeMethods.HookProc Proc = HookCallback;
+ private static readonly InteropValues.HookProc Proc = HookCallback;
public static void Start()
{
@@ -23,17 +23,17 @@ namespace HandyControl.Tools
HookId = SetHook(Proc);
}
- public static void Stop() => UnsafeNativeMethods.UnhookWindowsHookEx(HookId);
+ public static void Stop() => InteropMethods.UnhookWindowsHookEx(HookId);
- private static IntPtr SetHook(UnsafeNativeMethods.HookProc proc)
+ private static IntPtr SetHook(InteropValues.HookProc proc)
{
using (var curProcess = Process.GetCurrentProcess())
using (var curModule = curProcess.MainModule)
{
if (curModule != null)
{
- return UnsafeNativeMethods.SetWindowsHookEx((int) UnsafeNativeMethods.HookType.WH_MOUSE_LL, proc,
- UnsafeNativeMethods.GetModuleHandle(curModule.ModuleName), 0);
+ return InteropMethods.SetWindowsHookEx((int)InteropValues.HookType.WH_MOUSE_LL, proc,
+ InteropMethods.GetModuleHandle(curModule.ModuleName), 0);
}
return IntPtr.Zero;
}
@@ -41,15 +41,15 @@ namespace HandyControl.Tools
private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
{
- if (nCode < 0) return UnsafeNativeMethods.CallNextHookEx(HookId, nCode, wParam, lParam);
- var hookStruct = (UnsafeNativeMethods.MOUSEHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(UnsafeNativeMethods.MOUSEHOOKSTRUCT));
+ if (nCode < 0) return InteropMethods.CallNextHookEx(HookId, nCode, wParam, lParam);
+ var hookStruct = (InteropValues.MOUSEHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(InteropValues.MOUSEHOOKSTRUCT));
StatusChanged?.Invoke(null, new MouseHookEventArgs
{
Message = (MouseHookMessageType)wParam,
- Point = new NativeMethods.POINT(hookStruct.pt.X, hookStruct.pt.Y)
+ Point = new InteropValues.POINT(hookStruct.pt.X, hookStruct.pt.Y)
});
- return UnsafeNativeMethods.CallNextHookEx(HookId, nCode, wParam, lParam);
+ return InteropMethods.CallNextHookEx(HookId, nCode, wParam, lParam);
}
}
}
diff --git a/src/Shared/HandyControl_Shared/Tools/Hook/SystemMenuHook.cs b/src/Shared/HandyControl_Shared/Tools/Hook/SystemMenuHook.cs
index afe6f66b..af10084f 100644
--- a/src/Shared/HandyControl_Shared/Tools/Hook/SystemMenuHook.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Hook/SystemMenuHook.cs
@@ -19,14 +19,14 @@ namespace HandyControl.Tools
if (source != null)
{
DataDic[id] = source;
- NativeMethods.InsertMenu(NativeMethods.GetSystemMenu(hookId, false), index, NativeMethods.MF_BYPOSITION, id, text);
+ InteropMethods.InsertMenu(InteropMethods.GetSystemMenu(hookId, false), index, InteropValues.MF_BYPOSITION, id, text);
source.AddHook(WinProc);
}
}
- public static void InsertSeperator(int index, Window window) => NativeMethods.InsertMenu(
- NativeMethods.GetSystemMenu(window.GetHandle(), false), index,
- NativeMethods.MF_BYPOSITION | NativeMethods.MF_SEPARATOR, 0, "");
+ public static void InsertSeperator(int index, Window window) => InteropMethods.InsertMenu(
+ InteropMethods.GetSystemMenu(window.GetHandle(), false), index,
+ InteropValues.MF_BYPOSITION | InteropValues.MF_SEPARATOR, 0, "");
public static void Remove(int id)
{
@@ -39,7 +39,7 @@ namespace HandyControl.Tools
private static IntPtr WinProc(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam, ref bool handled)
{
- if (msg == NativeMethods.WM_SYSCOMMAND)
+ if (msg == InteropValues.WM_SYSCOMMAND)
{
var id = wparam.ToInt32();
if (DataDic.ContainsKey(id))
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/BITMAPINFO.cs b/src/Shared/HandyControl_Shared/Tools/Interop/BITMAPINFO.cs
deleted file mode 100644
index 4938fbdd..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/BITMAPINFO.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.InteropServices;
-using System.Security;
-
-namespace HandyControl.Tools.Interop
-{
- [StructLayout(LayoutKind.Sequential, Pack = 2)]
- [SuppressMessage("ReSharper", "InconsistentNaming")]
- internal struct BITMAPINFO
- {
- public int bmiHeader_biSize;
-
- public int bmiHeader_biWidth;
-
- public int bmiHeader_biHeight;
-
- public short bmiHeader_biPlanes;
-
- public short bmiHeader_biBitCount;
-
- public int bmiHeader_biCompression;
-
- public int bmiHeader_biSizeImage;
-
- public int bmiHeader_biXPelsPerMeter;
-
- public int bmiHeader_biYPelsPerMeter;
-
- public int bmiHeader_biClrUsed;
-
- public int bmiHeader_biClrImportant;
-
- public BITMAPINFO(int width, int height, short bpp)
- {
- bmiHeader_biSize = SizeOf();
- bmiHeader_biWidth = width;
- bmiHeader_biHeight = height;
- bmiHeader_biPlanes = 1;
- bmiHeader_biBitCount = bpp;
- bmiHeader_biCompression = 0;
- bmiHeader_biSizeImage = 0;
- bmiHeader_biXPelsPerMeter = 0;
- bmiHeader_biYPelsPerMeter = 0;
- bmiHeader_biClrUsed = 0;
- bmiHeader_biClrImportant = 0;
- }
-
- [SecuritySafeCritical]
- private static int SizeOf()
- {
- return Marshal.SizeOf(typeof(BITMAPINFO));
- }
- }
-}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/ExternDll.cs b/src/Shared/HandyControl_Shared/Tools/Interop/ExternDll.cs
deleted file mode 100644
index 81fa0c71..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/ExternDll.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace HandyControl.Tools.Interop
-{
- internal static class ExternDll
- {
- public const string
- User32 = "user32.dll",
- Gdi32 = "gdi32.dll",
- Kernel32 = "kernel32.dll",
- Shell32 = "shell32.dll";
- }
-}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/BitmapHandle.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/BitmapHandle.cs
similarity index 95%
rename from src/Shared/HandyControl_Shared/Tools/Interop/BitmapHandle.cs
rename to src/Shared/HandyControl_Shared/Tools/Interop/Handle/BitmapHandle.cs
index 1e893fa9..2fda6685 100644
--- a/src/Shared/HandyControl_Shared/Tools/Interop/BitmapHandle.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/BitmapHandle.cs
@@ -24,7 +24,7 @@ namespace HandyControl.Tools.Interop
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
protected override bool ReleaseHandle()
{
- return UnsafeNativeMethods.DeleteObject(handle);
+ return InteropMethods.DeleteObject(handle);
}
[SecurityCritical]
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/CommonHandles.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/CommonHandles.cs
similarity index 100%
rename from src/Shared/HandyControl_Shared/Tools/Interop/CommonHandles.cs
rename to src/Shared/HandyControl_Shared/Tools/Interop/Handle/CommonHandles.cs
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/HandleCollector.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/HandleCollector.cs
similarity index 100%
rename from src/Shared/HandyControl_Shared/Tools/Interop/HandleCollector.cs
rename to src/Shared/HandyControl_Shared/Tools/Interop/Handle/HandleCollector.cs
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/IconHandle.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/IconHandle.cs
similarity index 92%
rename from src/Shared/HandyControl_Shared/Tools/Interop/IconHandle.cs
rename to src/Shared/HandyControl_Shared/Tools/Interop/Handle/IconHandle.cs
index cbaec541..96de9b10 100644
--- a/src/Shared/HandyControl_Shared/Tools/Interop/IconHandle.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/IconHandle.cs
@@ -15,7 +15,7 @@ namespace HandyControl.Tools.Interop
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
protected override bool ReleaseHandle()
{
- return UnsafeNativeMethods.DestroyIcon(handle);
+ return InteropMethods.DestroyIcon(handle);
}
[SecurityCritical, SecuritySafeCritical]
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/SafeFileMappingHandle.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/SafeFileMappingHandle.cs
similarity index 95%
rename from src/Shared/HandyControl_Shared/Tools/Interop/SafeFileMappingHandle.cs
rename to src/Shared/HandyControl_Shared/Tools/Interop/Handle/SafeFileMappingHandle.cs
index ad26db90..c4aade37 100644
--- a/src/Shared/HandyControl_Shared/Tools/Interop/SafeFileMappingHandle.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/SafeFileMappingHandle.cs
@@ -43,7 +43,7 @@ namespace HandyControl.Tools.Interop
public static bool CloseHandleNoThrow(HandleRef handle)
{
HandleCollector.Remove((IntPtr)handle, CommonHandles.Kernel);
- var result = UnsafeNativeMethods.IntCloseHandle(handle);
+ var result = InteropMethods.IntCloseHandle(handle);
return result;
}
}
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/WpfSafeHandle.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/WpfSafeHandle.cs
similarity index 100%
rename from src/Shared/HandyControl_Shared/Tools/Interop/WpfSafeHandle.cs
rename to src/Shared/HandyControl_Shared/Tools/Interop/Handle/WpfSafeHandle.cs
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/ICONINFO.cs b/src/Shared/HandyControl_Shared/Tools/Interop/ICONINFO.cs
deleted file mode 100644
index 659c98e6..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/ICONINFO.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.InteropServices;
-
-namespace HandyControl.Tools.Interop
-{
- [StructLayout(LayoutKind.Sequential)]
- [SuppressMessage("ReSharper", "InconsistentNaming")]
- internal class ICONINFO
- {
- public bool fIcon = false;
- public int xHotspot = 0;
- public int yHotspot = 0;
- public BitmapHandle hbmMask = null;
- public BitmapHandle hbmColor = null;
- }
-}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs b/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs
new file mode 100644
index 00000000..06bfb21d
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs
@@ -0,0 +1,442 @@
+using System;
+using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
+using System.Runtime.InteropServices;
+using System.Runtime.Versioning;
+using System.Security;
+using System.Text;
+
+namespace HandyControl.Tools.Interop
+{
+ internal class InteropMethods
+ {
+ internal static readonly IntPtr HRGN_NONE = new IntPtr(-1);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto)]
+ [ResourceExposure(ResourceScope.None)]
+ internal static extern int RegisterWindowMessage(string msg);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ internal static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, out InteropValues.TBBUTTON lpBuffer,
+ int dwSize, out int lpNumberOfBytesRead);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, SetLastError = true)]
+ internal static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, out InteropValues.RECT lpBuffer,
+ int dwSize, out int lpNumberOfBytesRead);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, SetLastError = true)]
+ internal static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, out InteropValues.TRAYDATA lpBuffer,
+ int dwSize, out int lpNumberOfBytesRead);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto)]
+ internal static extern uint SendMessage(IntPtr hWnd, uint Msg, uint wParam, IntPtr lParam);
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto)]
+ internal static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ internal static extern IntPtr OpenProcess(InteropValues.ProcessAccess dwDesiredAccess,
+ [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, uint dwProcessId);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ internal static extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpAddress, int dwSize,
+ InteropValues.AllocationType flAllocationType, InteropValues.MemoryProtection flProtect);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ internal static extern int CloseHandle(IntPtr hObject);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ internal static extern bool VirtualFreeEx(IntPtr hProcess, IntPtr lpAddress, int dwSize, InteropValues.FreeType dwFreeType);
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true)]
+ internal static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true)]
+ internal static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass,
+ string lpszWindow);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ internal static extern int GetWindowRect(IntPtr hwnd, out InteropValues.RECT lpRect);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto)]
+ internal static extern bool GetCursorPos(out InteropValues.POINT pt);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ internal static extern IntPtr GetDesktopWindow();
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool AddClipboardFormatListener(IntPtr hwnd);
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool RemoveClipboardFormatListener(IntPtr hwnd);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ internal static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ internal static extern bool InsertMenu(IntPtr hMenu, int wPosition, int wFlags, int wIDNewItem, string lpNewItem);
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true, ExactSpelling = true, EntryPoint = nameof(GetDC),
+ CharSet = CharSet.Auto)]
+ internal static extern IntPtr IntGetDC(HandleRef hWnd);
+
+ [SecurityCritical]
+ internal static IntPtr GetDC(HandleRef hWnd)
+ {
+ var hDc = IntGetDC(hWnd);
+ if (hDc == IntPtr.Zero) throw new Win32Exception();
+
+ return HandleCollector.Add(hDc, CommonHandles.HDC);
+ }
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.User32, ExactSpelling = true, EntryPoint = nameof(ReleaseDC), CharSet = CharSet.Auto)]
+ internal static extern int IntReleaseDC(HandleRef hWnd, HandleRef hDC);
+
+ [SecurityCritical]
+ internal static int ReleaseDC(HandleRef hWnd, HandleRef hDC)
+ {
+ HandleCollector.Remove((IntPtr) hDC, CommonHandles.HDC);
+ return IntReleaseDC(hWnd, hDC);
+ }
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)]
+ internal static extern int GetDeviceCaps(HandleRef hDC, int nIndex);
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.User32)]
+ internal static extern int GetSystemMetrics(InteropValues.SM nIndex);
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.User32, EntryPoint = nameof(DestroyIcon), CharSet = CharSet.Auto, SetLastError = true)]
+ private static extern bool IntDestroyIcon(IntPtr hIcon);
+
+ [SecurityCritical]
+ internal static bool DestroyIcon(IntPtr hIcon)
+ {
+ var result = IntDestroyIcon(hIcon);
+ return result;
+ }
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.Gdi32, EntryPoint = nameof(DeleteObject), CharSet = CharSet.Auto, SetLastError = true)]
+ private static extern bool IntDeleteObject(IntPtr hObject);
+
+ [SecurityCritical]
+ internal static bool DeleteObject(IntPtr hObject)
+ {
+ var result = IntDeleteObject(hObject);
+ return result;
+ }
+
+ [SecurityCritical]
+ internal static BitmapHandle CreateDIBSection(HandleRef hdc, ref InteropValues.BITMAPINFO bitmapInfo, int iUsage,
+ ref IntPtr ppvBits, SafeFileMappingHandle hSection, int dwOffset)
+ {
+ if (hSection == null) hSection = new SafeFileMappingHandle(IntPtr.Zero);
+
+ var hBitmap = PrivateCreateDIBSection(hdc, ref bitmapInfo, iUsage, ref ppvBits, hSection, dwOffset);
+ return hBitmap;
+ }
+
+ [DllImport(InteropValues.ExternDll.Kernel32, EntryPoint = "CloseHandle", CharSet = CharSet.Auto, SetLastError = true)]
+ internal static extern bool IntCloseHandle(HandleRef handle);
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto,
+ EntryPoint = nameof(CreateDIBSection))]
+ private static extern BitmapHandle PrivateCreateDIBSection(HandleRef hdc, ref InteropValues.BITMAPINFO bitmapInfo, int iUsage,
+ ref IntPtr ppvBits, SafeFileMappingHandle hSection, int dwOffset);
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto,
+ EntryPoint = nameof(CreateIconIndirect))]
+ private static extern IconHandle PrivateCreateIconIndirect([In] [MarshalAs(UnmanagedType.LPStruct)]
+ InteropValues.ICONINFO iconInfo);
+
+ [SecurityCritical]
+ internal static IconHandle CreateIconIndirect([In] [MarshalAs(UnmanagedType.LPStruct)]
+ InteropValues.ICONINFO iconInfo)
+ {
+ var hIcon = PrivateCreateIconIndirect(iconInfo);
+ return hIcon;
+ }
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto,
+ EntryPoint = nameof(CreateBitmap))]
+ private static extern BitmapHandle PrivateCreateBitmap(int width, int height, int planes, int bitsPerPixel,
+ byte[] lpvBits);
+
+ [SecurityCritical]
+ internal static BitmapHandle CreateBitmap(int width, int height, int planes, int bitsPerPixel, byte[] lpvBits)
+ {
+ var hBitmap = PrivateCreateBitmap(width, height, planes, bitsPerPixel, lpvBits);
+ return hBitmap;
+ }
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.Kernel32, EntryPoint = "GetModuleFileName", CharSet = CharSet.Unicode,
+ SetLastError = true)]
+ private static extern int IntGetModuleFileName(HandleRef hModule, StringBuilder buffer, int length);
+
+ [SecurityCritical]
+ internal static string GetModuleFileName(HandleRef hModule)
+ {
+ var buffer = new StringBuilder(InteropValues.Win32Constant.MAX_PATH);
+ while (true)
+ {
+ var size = IntGetModuleFileName(hModule, buffer, buffer.Capacity);
+ if (size == 0) throw new Win32Exception();
+
+ if (size == buffer.Capacity)
+ {
+ buffer.EnsureCapacity(buffer.Capacity * 2);
+ continue;
+ }
+
+ return buffer.ToString();
+ }
+ }
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.Shell32, CharSet = CharSet.Auto, BestFitMapping = false, ThrowOnUnmappableChar = true)]
+ internal static extern int ExtractIconEx(string szExeFileName, int nIconIndex, out IconHandle phiconLarge,
+ out IconHandle phiconSmall, int nIcons);
+
+ [DllImport(InteropValues.ExternDll.Shell32, CharSet = CharSet.Auto)]
+ internal static extern int Shell_NotifyIcon(int message, InteropValues.NOTIFYICONDATA pnid);
+
+ [SecurityCritical]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "CreateWindowExW")]
+ internal static extern IntPtr CreateWindowEx(
+ int dwExStyle,
+ [MarshalAs(UnmanagedType.LPWStr)] string lpClassName,
+ [MarshalAs(UnmanagedType.LPWStr)] string lpWindowName,
+ int dwStyle,
+ int x,
+ int y,
+ int nWidth,
+ int nHeight,
+ IntPtr hWndParent,
+ IntPtr hMenu,
+ IntPtr hInstance,
+ IntPtr lpParam);
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false)]
+ internal static extern short RegisterClass(InteropValues.WNDCLASS wc);
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false)]
+ internal static extern short RegisterClass(InteropValues.WNDCLASS4ICON wc);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto)]
+ internal static extern IntPtr DefWindowProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
+
+ [DllImport(InteropValues.ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto)]
+ internal static extern bool SetForegroundWindow(IntPtr hWnd);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)]
+ internal static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, CharSet = CharSet.Auto, SetLastError = true)]
+ internal static extern IntPtr GetModuleHandle(string lpModuleName);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)]
+ internal static extern bool UnhookWindowsHookEx(IntPtr hhk);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)]
+ internal static extern IntPtr SetWindowsHookEx(int idHook, InteropValues.HookProc lpfn, IntPtr hMod, uint dwThreadId);
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true)]
+ internal static extern IntPtr GetWindowDC(IntPtr window);
+
+ [DllImport(InteropValues.ExternDll.Gdi32, SetLastError = true)]
+ internal static extern uint GetPixel(IntPtr dc, int x, int y);
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true)]
+ internal static extern int ReleaseDC(IntPtr window, IntPtr dc);
+
+ [DllImport(InteropValues.ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)]
+ internal static extern int GetDeviceCaps(IntPtr hdc, int nIndex);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto)]
+ internal static extern IntPtr GetDC(IntPtr ptr);
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ private static extern bool GetWindowPlacement(IntPtr hwnd, InteropValues.WINDOWPLACEMENT lpwndpl);
+
+ internal static InteropValues.WINDOWPLACEMENT GetWindowPlacement(IntPtr hwnd)
+ {
+ InteropValues.WINDOWPLACEMENT wINDOWPLACEMENT = new InteropValues.WINDOWPLACEMENT();
+ if (GetWindowPlacement(hwnd, wINDOWPLACEMENT))
+ {
+ return wINDOWPLACEMENT;
+ }
+ throw new Win32Exception(Marshal.GetLastWin32Error());
+ }
+
+ internal static int GetXLParam(int lParam) => LoWord(lParam);
+
+ internal static int GetYLParam(int lParam) => HiWord(lParam);
+
+ internal static int HiWord(int value) => (short)(value >> 16);
+
+ internal static int LoWord(int value) => (short)(value & 65535);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ internal static extern IntPtr MonitorFromWindow(IntPtr handle, int flags);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool EnumThreadWindows(uint dwThreadId, InteropValues.EnumWindowsProc lpfn, IntPtr lParam);
+
+ [DllImport(InteropValues.ExternDll.Gdi32)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool DeleteDC(IntPtr hdc);
+
+ [DllImport(InteropValues.ExternDll.Gdi32, SetLastError = true)]
+ internal static extern IntPtr CreateCompatibleDC(IntPtr hdc);
+
+ [DllImport(InteropValues.ExternDll.Gdi32, ExactSpelling = true, SetLastError = true)]
+ internal static extern IntPtr SelectObject(IntPtr hdc, IntPtr hgdiobj);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)]
+ internal static extern IntPtr SendMessage(IntPtr hWnd, int nMsg, IntPtr wParam, IntPtr lParam);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ internal static extern IntPtr MonitorFromPoint(InteropValues.POINT pt, int flags);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ internal static extern IntPtr GetWindow(IntPtr hwnd, int nCmd);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool IsWindowVisible(IntPtr hwnd);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool IsIconic(IntPtr hwnd);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool IsZoomed(IntPtr hwnd);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto, ExactSpelling = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, int flags);
+
+ internal static System.Windows.Point GetCursorPos()
+ {
+ var result = default(System.Windows.Point);
+ if (GetCursorPos(out var point))
+ {
+ result.X = point.X;
+ result.Y = point.Y;
+ }
+ return result;
+ }
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
+
+ internal static int GetWindowLong(IntPtr hWnd, InteropValues.GWL nIndex) => GetWindowLong(hWnd, (int)nIndex);
+
+ internal static IntPtr SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong)
+ {
+ if (IntPtr.Size == 4)
+ {
+ return SetWindowLongPtr32(hWnd, nIndex, dwNewLong);
+ }
+ return SetWindowLongPtr64(hWnd, nIndex, dwNewLong);
+ }
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto, EntryPoint = "SetWindowLong")]
+ internal static extern IntPtr SetWindowLongPtr32(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto, EntryPoint = "SetWindowLongPtr")]
+ internal static extern IntPtr SetWindowLongPtr64(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Unicode)]
+ private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Unicode)]
+ private static extern IntPtr SetWindowLongPtr(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
+
+ internal static IntPtr SetWindowLongPtr(IntPtr hWnd, InteropValues.GWLP nIndex, IntPtr dwNewLong)
+ {
+ if (IntPtr.Size == 8)
+ {
+ return SetWindowLongPtr(hWnd, (int)nIndex, dwNewLong);
+ }
+ return new IntPtr(SetWindowLong(hWnd, (int)nIndex, dwNewLong.ToInt32()));
+ }
+
+ internal static int SetWindowLong(IntPtr hWnd, InteropValues.GWL nIndex, int dwNewLong) => SetWindowLong(hWnd, (int)nIndex, dwNewLong);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Unicode)]
+ internal static extern ushort RegisterClass(ref InteropValues.WNDCLASS lpWndClass);
+
+ [DllImport(InteropValues.ExternDll.Kernel32)]
+ internal static extern uint GetCurrentThreadId();
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true)]
+ internal static extern IntPtr CreateWindowEx(int dwExStyle, IntPtr classAtom, string lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hWndParent, IntPtr hMenu, IntPtr hInstance, IntPtr lpParam);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool DestroyWindow(IntPtr hwnd);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool UnregisterClass(IntPtr classAtom, IntPtr hInstance);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool UpdateLayeredWindow(IntPtr hwnd, IntPtr hdcDest, ref InteropValues.POINT pptDest, ref InteropValues.SIZE psize, IntPtr hdcSrc, ref InteropValues.POINT pptSrc, uint crKey, [In] ref InteropValues.BLENDFUNCTION pblend, uint dwFlags);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ internal static extern bool RedrawWindow(IntPtr hWnd, IntPtr lprcUpdate, IntPtr hrgnUpdate, InteropValues.RedrawWindowFlags flags);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool EnumDisplayMonitors(IntPtr hdc, IntPtr lprcClip, InteropValues.EnumMonitorsDelegate lpfnEnum, IntPtr dwData);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool IntersectRect(out InteropValues.RECT lprcDst, [In] ref InteropValues.RECT lprcSrc1, [In] ref InteropValues.RECT lprcSrc2);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool GetMonitorInfo(IntPtr hMonitor, ref InteropValues.MONITORINFO monitorInfo);
+
+ [DllImport(InteropValues.ExternDll.Gdi32, SetLastError = true)]
+ internal static extern IntPtr CreateDIBSection(IntPtr hdc, ref InteropValues.BITMAPINFO pbmi, uint iUsage, out IntPtr ppvBits, IntPtr hSection, uint dwOffset);
+
+ [DllImport(InteropValues.ExternDll.MsImg)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool AlphaBlend(IntPtr hdcDest, int xoriginDest, int yoriginDest, int wDest, int hDest, IntPtr hdcSrc, int xoriginSrc, int yoriginSrc, int wSrc, int hSrc, InteropValues.BLENDFUNCTION pfn);
+
+ internal static int GET_SC_WPARAM(IntPtr wParam) => (int)wParam & 65520;
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs b/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs
new file mode 100644
index 00000000..eed8f91d
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs
@@ -0,0 +1,654 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Windows;
+
+namespace HandyControl.Tools.Interop
+{
+ internal class InteropValues
+ {
+ internal static class ExternDll
+ {
+ public const string
+ User32 = "user32.dll",
+ Gdi32 = "gdi32.dll",
+ Kernel32 = "kernel32.dll",
+ Shell32 = "shell32.dll",
+ MsImg = "msimg32.dll";
+ }
+
+ internal delegate IntPtr HookProc(int code, IntPtr wParam, IntPtr lParam);
+
+ internal delegate IntPtr WndProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
+
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal delegate bool EnumMonitorsDelegate(IntPtr hMonitor, IntPtr hdcMonitor, ref RECT lprcMonitor, IntPtr dwData);
+
+ internal delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
+
+ internal const int
+ BITSPIXEL = 12,
+ PLANES = 14,
+ BI_RGB = 0,
+ DIB_RGB_COLORS = 0,
+ NIF_MESSAGE = 0x00000001,
+ NIF_ICON = 0x00000002,
+ NIF_TIP = 0x00000004,
+ NIF_INFO = 0x00000010,
+ NIM_ADD = 0x00000000,
+ NIM_MODIFY = 0x00000001,
+ NIM_DELETE = 0x00000002,
+ NIIF_NONE = 0x00000000,
+ NIIF_INFO = 0x00000001,
+ NIIF_WARNING = 0x00000002,
+ NIIF_ERROR = 0x00000003,
+ WM_ACTIVATE = 0x0006,
+ WM_QUIT = 0x0012,
+ WM_WINDOWPOSCHANGING = 0x0046,
+ WM_WINDOWPOSCHANGED = 0x0047,
+ WM_SETICON = 0x0080,
+ WM_NCCREATE = 0x0081,
+ WM_NCDESTROY = 0x0082,
+ WM_NCACTIVATE = 0x0086,
+ WM_NCRBUTTONDOWN = 0x00A4,
+ WM_NCRBUTTONUP = 0x00A5,
+ WM_NCRBUTTONDBLCLK = 0x00A6,
+ WM_NCUAHDRAWCAPTION = 0x00AE,
+ WM_NCUAHDRAWFRAME = 0x00AF,
+ WM_KEYDOWN = 0x0100,
+ WM_KEYUP = 0x0101,
+ WM_SYSKEYDOWN = 0x0104,
+ WM_SYSKEYUP = 0x0105,
+ WM_SYSCOMMAND = 0x112,
+ WM_MOUSEMOVE = 0x0200,
+ WM_LBUTTONUP = 0x0202,
+ WM_LBUTTONDBLCLK = 0x0203,
+ WM_RBUTTONUP = 0x0205,
+ WM_CLIPBOARDUPDATE = 0x031D,
+ WM_USER = 0x0400,
+ WS_VISIBLE = 0x10000000,
+ MF_BYPOSITION = 0x400,
+ MF_SEPARATOR = 0x800,
+ TB_GETBUTTON = WM_USER + 23,
+ TB_BUTTONCOUNT = WM_USER + 24,
+ TB_GETITEMRECT = WM_USER + 29,
+ VERTRES = 10,
+ DESKTOPVERTRES = 117,
+ LOGPIXELSX = 88,
+ LOGPIXELSY = 90,
+ SC_SIZE = 0xF000,
+ SC_MOVE = 0xF010,
+ SC_MINIMIZE = 0xF020,
+ SC_MAXIMIZE = 0xF030,
+ SC_RESTORE = 0xF120;
+
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ internal class NOTIFYICONDATA
+ {
+ public int cbSize = Marshal.SizeOf(typeof(NOTIFYICONDATA));
+ public IntPtr hWnd;
+ public int uID;
+ public int uFlags;
+ public int uCallbackMessage;
+ public IntPtr hIcon;
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
+ public string szTip = string.Empty;
+ public int dwState = 0x01;
+ public int dwStateMask = 0x01;
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
+ public string szInfo = string.Empty;
+ public int uTimeoutOrVersion;
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
+ public string szInfoTitle = string.Empty;
+ public int dwInfoFlags;
+ }
+
+ [StructLayout(LayoutKind.Sequential, Pack = 1)]
+ internal struct TBBUTTON
+ {
+ public int iBitmap;
+ public int idCommand;
+ public IntPtr fsStateStylePadding;
+ public IntPtr dwData;
+ public IntPtr iString;
+ }
+
+ [Flags]
+ internal enum AllocationType
+ {
+ Commit = 0x1000,
+ Reserve = 0x2000,
+ Decommit = 0x4000,
+ Release = 0x8000,
+ Reset = 0x80000,
+ Physical = 0x400000,
+ TopDown = 0x100000,
+ WriteWatch = 0x200000,
+ LargePages = 0x20000000
+ }
+
+ [Flags]
+ internal enum MemoryProtection
+ {
+ Execute = 0x10,
+ ExecuteRead = 0x20,
+ ExecuteReadWrite = 0x40,
+ ExecuteWriteCopy = 0x80,
+ NoAccess = 0x01,
+ ReadOnly = 0x02,
+ ReadWrite = 0x04,
+ WriteCopy = 0x08,
+ GuardModifierflag = 0x100,
+ NoCacheModifierflag = 0x200,
+ WriteCombineModifierflag = 0x400
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct TRAYDATA
+ {
+ public IntPtr hwnd;
+ public uint uID;
+ public uint uCallbackMessage;
+ public uint bReserved0;
+ public uint bReserved1;
+ public IntPtr hIcon;
+ }
+
+ [Flags]
+ internal enum FreeType
+ {
+ Decommit = 0x4000,
+ Release = 0x8000,
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct POINT
+ {
+ public int X;
+ public int Y;
+
+ public POINT(int x, int y)
+ {
+ X = x;
+ Y = y;
+ }
+ }
+
+ internal enum HookType
+ {
+ WH_KEYBOARD_LL = 13,
+ WH_MOUSE_LL = 14
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct MOUSEHOOKSTRUCT
+ {
+ public POINT pt;
+ public IntPtr hwnd;
+ public uint wHitTestCode;
+ public IntPtr dwExtraInfo;
+ }
+
+ [Flags]
+ internal enum ProcessAccess
+ {
+ AllAccess = CreateThread | DuplicateHandle | QueryInformation | SetInformation | Terminate | VMOperation | VMRead | VMWrite | Synchronize,
+ CreateThread = 0x2,
+ DuplicateHandle = 0x40,
+ QueryInformation = 0x400,
+ SetInformation = 0x200,
+ Terminate = 0x1,
+ VMOperation = 0x8,
+ VMRead = 0x10,
+ VMWrite = 0x20,
+ Synchronize = 0x100000
+ }
+
+ [Serializable, StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ internal struct RECT
+ {
+ public int Left;
+ public int Top;
+ public int Right;
+ public int Bottom;
+
+ public RECT(Rect rect)
+ {
+ Left = (int)rect.Left;
+ Top = (int)rect.Top;
+ Right = (int)rect.Right;
+ Bottom = (int)rect.Bottom;
+ }
+
+ public Point Position => new Point(Left, Top);
+ public Size Size => new Size(Width, Height);
+
+ public int Height
+ {
+ get => Bottom - Top;
+ set => Bottom = Top + value;
+ }
+
+ public int Width
+ {
+ get => Right - Left;
+ set => Right = Left + value;
+ }
+ }
+
+ internal struct BLENDFUNCTION
+ {
+ public byte BlendOp;
+ public byte BlendFlags;
+ public byte SourceConstantAlpha;
+ public byte AlphaFormat;
+ }
+
+ internal enum GWL
+ {
+ STYLE = -16,
+ EXSTYLE = -20
+ }
+
+ internal enum GWLP
+ {
+ WNDPROC = -4,
+ HINSTANCE = -6,
+ HWNDPARENT = -8,
+ USERDATA = -21,
+ ID = -12
+ }
+
+ internal struct BITMAPINFOHEADER
+ {
+ internal uint biSize;
+ internal int biWidth;
+ internal int biHeight;
+ internal ushort biPlanes;
+ internal ushort biBitCount;
+ internal uint biCompression;
+ internal uint biSizeImage;
+ internal int biXPelsPerMeter;
+ internal int biYPelsPerMeter;
+ internal uint biClrUsed;
+ internal uint biClrImportant;
+ }
+
+ [Flags]
+ internal enum RedrawWindowFlags : uint
+ {
+ Invalidate = 1u,
+ InternalPaint = 2u,
+ Erase = 4u,
+ Validate = 8u,
+ NoInternalPaint = 16u,
+ NoErase = 32u,
+ NoChildren = 64u,
+ AllChildren = 128u,
+ UpdateNow = 256u,
+ EraseNow = 512u,
+ Frame = 1024u,
+ NoFrame = 2048u
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal class WINDOWPOS
+ {
+ public IntPtr hwnd;
+ public IntPtr hwndInsertAfter;
+ public int x;
+ public int y;
+ public int cx;
+ public int cy;
+ public uint flags;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal class WINDOWPLACEMENT
+ {
+ public int length = Marshal.SizeOf(typeof(WINDOWPLACEMENT));
+ public int flags;
+ public int showCmd;
+ public POINT ptMinPosition;
+ public POINT ptMaxPosition;
+ public RECT rcNormalPosition;
+ }
+
+ [StructLayout(LayoutKind.Sequential, Pack = 4)]
+ internal struct SIZE
+ {
+ [ComAliasName("Microsoft.VisualStudio.OLE.Interop.LONG")]
+ public int cx;
+ [ComAliasName("Microsoft.VisualStudio.OLE.Interop.LONG")]
+ public int cy;
+ }
+
+ internal struct MONITORINFO
+ {
+ public uint cbSize;
+ public RECT rcMonitor;
+ public RECT rcWork;
+ public uint dwFlags;
+ }
+
+ internal enum SM
+ {
+ CXSCREEN = 0,
+ CYSCREEN = 1,
+ CXVSCROLL = 2,
+ CYHSCROLL = 3,
+ CYCAPTION = 4,
+ CXBORDER = 5,
+ CYBORDER = 6,
+ CXFIXEDFRAME = 7,
+ CYFIXEDFRAME = 8,
+ CYVTHUMB = 9,
+ CXHTHUMB = 10,
+ CXICON = 11,
+ CYICON = 12,
+ CXCURSOR = 13,
+ CYCURSOR = 14,
+ CYMENU = 15,
+ CXFULLSCREEN = 16,
+ CYFULLSCREEN = 17,
+ CYKANJIWINDOW = 18,
+ MOUSEPRESENT = 19,
+ CYVSCROLL = 20,
+ CXHSCROLL = 21,
+ DEBUG = 22,
+ SWAPBUTTON = 23,
+ CXMIN = 28,
+ CYMIN = 29,
+ CXSIZE = 30,
+ CYSIZE = 31,
+ CXFRAME = 32,
+ CXSIZEFRAME = CXFRAME,
+ CYFRAME = 33,
+ CYSIZEFRAME = CYFRAME,
+ CXMINTRACK = 34,
+ CYMINTRACK = 35,
+ CXDOUBLECLK = 36,
+ CYDOUBLECLK = 37,
+ CXICONSPACING = 38,
+ CYICONSPACING = 39,
+ MENUDROPALIGNMENT = 40,
+ PENWINDOWS = 41,
+ DBCSENABLED = 42,
+ CMOUSEBUTTONS = 43,
+ SECURE = 44,
+ CXEDGE = 45,
+ CYEDGE = 46,
+ CXMINSPACING = 47,
+ CYMINSPACING = 48,
+ CXSMICON = 49,
+ CYSMICON = 50,
+ CYSMCAPTION = 51,
+ CXSMSIZE = 52,
+ CYSMSIZE = 53,
+ CXMENUSIZE = 54,
+ CYMENUSIZE = 55,
+ ARRANGE = 56,
+ CXMINIMIZED = 57,
+ CYMINIMIZED = 58,
+ CXMAXTRACK = 59,
+ CYMAXTRACK = 60,
+ CXMAXIMIZED = 61,
+ CYMAXIMIZED = 62,
+ NETWORK = 63,
+ CLEANBOOT = 67,
+ CXDRAG = 68,
+ CYDRAG = 69,
+ SHOWSOUNDS = 70,
+ CXMENUCHECK = 71,
+ CYMENUCHECK = 72,
+ SLOWMACHINE = 73,
+ MIDEASTENABLED = 74,
+ MOUSEWHEELPRESENT = 75,
+ XVIRTUALSCREEN = 76,
+ YVIRTUALSCREEN = 77,
+ CXVIRTUALSCREEN = 78,
+ CYVIRTUALSCREEN = 79,
+ CMONITORS = 80,
+ SAMEDISPLAYFORMAT = 81,
+ IMMENABLED = 82,
+ CXFOCUSBORDER = 83,
+ CYFOCUSBORDER = 84,
+ TABLETPC = 86,
+ MEDIACENTER = 87,
+ REMOTESESSION = 0x1000,
+ REMOTECONTROL = 0x2001
+ }
+
+ internal enum CacheSlot
+ {
+ DpiX,
+
+ FocusBorderWidth,
+ FocusBorderHeight,
+ HighContrast,
+ MouseVanish,
+
+ DropShadow,
+ FlatMenu,
+ WorkAreaInternal,
+ WorkArea,
+
+ IconMetrics,
+
+ KeyboardCues,
+ KeyboardDelay,
+ KeyboardPreference,
+ KeyboardSpeed,
+ SnapToDefaultButton,
+ WheelScrollLines,
+ MouseHoverTime,
+ MouseHoverHeight,
+ MouseHoverWidth,
+
+ MenuDropAlignment,
+ MenuFade,
+ MenuShowDelay,
+
+ ComboBoxAnimation,
+ ClientAreaAnimation,
+ CursorShadow,
+ GradientCaptions,
+ HotTracking,
+ ListBoxSmoothScrolling,
+ MenuAnimation,
+ SelectionFade,
+ StylusHotTracking,
+ ToolTipAnimation,
+ ToolTipFade,
+ UIEffects,
+
+ MinimizeAnimation,
+ Border,
+ CaretWidth,
+ ForegroundFlashCount,
+ DragFullWindows,
+ NonClientMetrics,
+
+ ThinHorizontalBorderHeight,
+ ThinVerticalBorderWidth,
+ CursorWidth,
+ CursorHeight,
+ ThickHorizontalBorderHeight,
+ ThickVerticalBorderWidth,
+ MinimumHorizontalDragDistance,
+ MinimumVerticalDragDistance,
+ FixedFrameHorizontalBorderHeight,
+ FixedFrameVerticalBorderWidth,
+ FocusHorizontalBorderHeight,
+ FocusVerticalBorderWidth,
+ FullPrimaryScreenWidth,
+ FullPrimaryScreenHeight,
+ HorizontalScrollBarButtonWidth,
+ HorizontalScrollBarHeight,
+ HorizontalScrollBarThumbWidth,
+ IconWidth,
+ IconHeight,
+ IconGridWidth,
+ IconGridHeight,
+ MaximizedPrimaryScreenWidth,
+ MaximizedPrimaryScreenHeight,
+ MaximumWindowTrackWidth,
+ MaximumWindowTrackHeight,
+ MenuCheckmarkWidth,
+ MenuCheckmarkHeight,
+ MenuButtonWidth,
+ MenuButtonHeight,
+ MinimumWindowWidth,
+ MinimumWindowHeight,
+ MinimizedWindowWidth,
+ MinimizedWindowHeight,
+ MinimizedGridWidth,
+ MinimizedGridHeight,
+ MinimumWindowTrackWidth,
+ MinimumWindowTrackHeight,
+ PrimaryScreenWidth,
+ PrimaryScreenHeight,
+ WindowCaptionButtonWidth,
+ WindowCaptionButtonHeight,
+ ResizeFrameHorizontalBorderHeight,
+ ResizeFrameVerticalBorderWidth,
+ SmallIconWidth,
+ SmallIconHeight,
+ SmallWindowCaptionButtonWidth,
+ SmallWindowCaptionButtonHeight,
+ VirtualScreenWidth,
+ VirtualScreenHeight,
+ VerticalScrollBarWidth,
+ VerticalScrollBarButtonHeight,
+ WindowCaptionHeight,
+ KanjiWindowHeight,
+ MenuBarHeight,
+ VerticalScrollBarThumbHeight,
+ IsImmEnabled,
+ IsMediaCenter,
+ IsMenuDropRightAligned,
+ IsMiddleEastEnabled,
+ IsMousePresent,
+ IsMouseWheelPresent,
+ IsPenWindows,
+ IsRemotelyControlled,
+ IsRemoteSession,
+ ShowSounds,
+ IsSlowMachine,
+ SwapButtons,
+ IsTabletPC,
+ VirtualScreenLeft,
+ VirtualScreenTop,
+
+ PowerLineStatus,
+
+ IsGlassEnabled,
+ UxThemeName,
+ UxThemeColor,
+ WindowCornerRadius,
+ WindowGlassColor,
+ WindowGlassBrush,
+ WindowNonClientFrameThickness,
+ WindowResizeBorderThickness,
+
+ NumSlots
+ }
+
+ internal static class Win32Constant
+ {
+ internal const int MAX_PATH = 260;
+ internal const int INFOTIPSIZE = 1024;
+ internal const int TRUE = 1;
+ internal const int FALSE = 0;
+ }
+
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ internal struct WNDCLASS
+ {
+ public uint style;
+ public Delegate lpfnWndProc;
+ public int cbClsExtra;
+ public int cbWndExtra;
+ public IntPtr hInstance;
+ public IntPtr hIcon;
+ public IntPtr hCursor;
+ public IntPtr hbrBackground;
+ [MarshalAs(UnmanagedType.LPWStr)]
+ public string lpszMenuName;
+ [MarshalAs(UnmanagedType.LPWStr)]
+ public string lpszClassName;
+ }
+
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ internal class WNDCLASS4ICON
+ {
+ public int style;
+ public WndProc lpfnWndProc;
+ public int cbClsExtra;
+ public int cbWndExtra;
+ public IntPtr hInstance;
+ public IntPtr hIcon;
+ public IntPtr hCursor;
+ public IntPtr hbrBackground;
+ public string lpszMenuName;
+ public string lpszClassName;
+ }
+
+ [StructLayout(LayoutKind.Sequential, Pack = 2)]
+ internal struct BITMAPINFO
+ {
+ public int biSize;
+
+ public int biWidth;
+
+ public int biHeight;
+
+ public short biPlanes;
+
+ public short biBitCount;
+
+ public int biCompression;
+
+ public int biSizeImage;
+
+ public int biXPelsPerMeter;
+
+ public int biYPelsPerMeter;
+
+ public int biClrUsed;
+
+ public int biClrImportant;
+
+ public BITMAPINFO(int width, int height, short bpp)
+ {
+ biSize = SizeOf();
+ biWidth = width;
+ biHeight = height;
+ biPlanes = 1;
+ biBitCount = bpp;
+ biCompression = 0;
+ biSizeImage = 0;
+ biXPelsPerMeter = 0;
+ biYPelsPerMeter = 0;
+ biClrUsed = 0;
+ biClrImportant = 0;
+ }
+
+ [SecuritySafeCritical]
+ private static int SizeOf()
+ {
+ return Marshal.SizeOf(typeof(BITMAPINFO));
+ }
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal class ICONINFO
+ {
+ public bool fIcon = false;
+ public int xHotspot = 0;
+ public int yHotspot = 0;
+ public BitmapHandle hbmMask = null;
+ public BitmapHandle hbmColor = null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/NOTIFYICONDATA.cs b/src/Shared/HandyControl_Shared/Tools/Interop/NOTIFYICONDATA.cs
deleted file mode 100644
index c57d604a..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/NOTIFYICONDATA.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.InteropServices;
-
-namespace HandyControl.Tools.Interop
-{
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
- [SuppressMessage("ReSharper", "InconsistentNaming")]
- public class NOTIFYICONDATA
- {
- public int cbSize = Marshal.SizeOf(typeof(NOTIFYICONDATA));
- public IntPtr hWnd;
- public int uID;
- public int uFlags;
- public int uCallbackMessage;
- public IntPtr hIcon;
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
- public string szTip = string.Empty;
- public int dwState = 0x01;
- public int dwStateMask = 0x01;
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
- public string szInfo = string.Empty;
- public int uTimeoutOrVersion;
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
- public string szInfoTitle = string.Empty;
- public int dwInfoFlags;
- }
-}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/NativeMethods.cs b/src/Shared/HandyControl_Shared/Tools/Interop/NativeMethods.cs
deleted file mode 100644
index b4885c5f..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/NativeMethods.cs
+++ /dev/null
@@ -1,246 +0,0 @@
-using System;
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.InteropServices;
-using System.Runtime.Versioning;
-using System.Security;
-
-namespace HandyControl.Tools.Interop
-{
- public delegate IntPtr WndProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
-
- [SuppressMessage("ReSharper", "InconsistentNaming")]
- [SuppressMessage("ReSharper", "IdentifierTypo")]
- internal class NativeMethods
- {
- public const int
- WS_CHILD = 0x40000000,
- BITSPIXEL = 12,
- PLANES = 14,
- BI_RGB = 0,
- DIB_RGB_COLORS = 0,
- NIF_MESSAGE = 0x00000001,
- NIF_ICON = 0x00000002,
- NIF_TIP = 0x00000004,
- NIF_INFO = 0x00000010,
- NIN_BALLOONSHOW = WM_USER + 2,
- NIN_BALLOONHIDE = WM_USER + 3,
- NIN_BALLOONTIMEOUT = WM_USER + 4,
- NIM_ADD = 0x00000000,
- NIM_MODIFY = 0x00000001,
- NIM_DELETE = 0x00000002,
- NIIF_NONE = 0x00000000,
- NIIF_INFO = 0x00000001,
- NIIF_WARNING = 0x00000002,
- NIIF_ERROR = 0x00000003,
- NIIF_LARGE_ICON = 0x00000020,
- WM_KEYDOWN = 0x0100,
- WM_KEYUP = 0x0101,
- WM_SYSKEYDOWN = 0x0104,
- WM_SYSKEYUP = 0x0105,
- WM_SYSCOMMAND = 0x112,
- WM_MOUSEMOVE = 0x0200,
- WM_LBUTTONDOWN = 0x0201,
- WM_LBUTTONUP = 0x0202,
- WM_LBUTTONDBLCLK = 0x0203,
- WM_RBUTTONDOWN = 0x0204,
- WM_RBUTTONUP = 0x0205,
- WM_RBUTTONDBLCLK = 0x0206,
- WM_MBUTTONDOWN = 0x0207,
- WM_MBUTTONUP = 0x0208,
- WM_MBUTTONDBLCLK = 0x0209,
- WM_CLIPBOARDUPDATE = 0x031D,
- WM_USER = 0x0400,
- MF_BYPOSITION = 0x400,
- MF_SEPARATOR = 0x800,
- TB_GETBUTTON = WM_USER + 23,
- TB_BUTTONCOUNT = WM_USER + 24,
- TB_GETITEMRECT = WM_USER + 29,
- STANDARD_RIGHTS_REQUIRED = 0x000F0000,
- SYNCHRONIZE = 0x00100000,
- PROCESS_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFF,
- MEM_COMMIT = 0x1000,
- MEM_RELEASE = 0x8000,
- PAGE_READWRITE = 0x04,
- TBSTATE_HIDDEN = 0x08,
- VERTRES = 10,
- HORZRES = 8,
- DESKTOPVERTRES = 117,
- DESKTOPHORZRES = 118,
- LOGPIXELSX = 88,
- LOGPIXELSY = 90,
- CXFRAME = 32,
- CXSIZEFRAME = CXFRAME,
- SW_HIDE = 0;
-
- [Flags]
- public enum ProcessAccess
- {
- AllAccess = CreateThread | DuplicateHandle | QueryInformation | SetInformation | Terminate | VMOperation | VMRead | VMWrite | Synchronize,
- CreateThread = 0x2,
- DuplicateHandle = 0x40,
- QueryInformation = 0x400,
- SetInformation = 0x200,
- Terminate = 0x1,
- VMOperation = 0x8,
- VMRead = 0x10,
- VMWrite = 0x20,
- Synchronize = 0x100000
- }
-
- [Serializable, StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
- public struct RECT
- {
- public int Left;
- public int Top;
- public int Right;
- public int Bottom;
-
- public RECT(int left, int top, int right, int bottom)
- {
- Left = left;
- Top = top;
- Right = right;
- Bottom = bottom;
- }
- }
-
- [StructLayout(LayoutKind.Sequential, Pack = 1)]
- public struct TBBUTTON
- {
- public int iBitmap;
- public int idCommand;
- public IntPtr fsStateStylePadding;
- public IntPtr dwData;
- public IntPtr iString;
- }
-
- [Flags]
- public enum AllocationType
- {
- Commit = 0x1000,
- Reserve = 0x2000,
- Decommit = 0x4000,
- Release = 0x8000,
- Reset = 0x80000,
- Physical = 0x400000,
- TopDown = 0x100000,
- WriteWatch = 0x200000,
- LargePages = 0x20000000
- }
-
- [Flags]
- public enum MemoryProtection
- {
- Execute = 0x10,
- ExecuteRead = 0x20,
- ExecuteReadWrite = 0x40,
- ExecuteWriteCopy = 0x80,
- NoAccess = 0x01,
- ReadOnly = 0x02,
- ReadWrite = 0x04,
- WriteCopy = 0x08,
- GuardModifierflag = 0x100,
- NoCacheModifierflag = 0x200,
- WriteCombineModifierflag = 0x400
- }
-
- [StructLayout(LayoutKind.Sequential)]
- public struct TRAYDATA
- {
- public IntPtr hwnd;
- public uint uID;
- public uint uCallbackMessage;
- public uint bReserved0;
- public uint bReserved1;
- public IntPtr hIcon;
- }
-
- [Flags]
- public enum FreeType
- {
- Decommit = 0x4000,
- Release = 0x8000,
- }
-
- [StructLayout(LayoutKind.Sequential)]
- public struct POINT
- {
- public int X;
- public int Y;
-
- public POINT(int x, int y)
- {
- X = x;
- Y = y;
- }
- }
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
- [ResourceExposure(ResourceScope.None)]
- public static extern int RegisterWindowMessage(string msg);
-
- [DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto)]
- public static extern int MapWindowPoints(IntPtr hWndFrom, IntPtr hWndTo, ref RECT lpPoints, uint cPoints);
-
- [DllImport(ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
- public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, out TBBUTTON lpBuffer, int dwSize, out int lpNumberOfBytesRead);
-
- [DllImport(ExternDll.Kernel32, SetLastError = true)]
- public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, out RECT lpBuffer, int dwSize, out int lpNumberOfBytesRead);
-
- [DllImport(ExternDll.Kernel32, SetLastError = true)]
- public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, out TRAYDATA lpBuffer, int dwSize, out int lpNumberOfBytesRead);
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
- public static extern uint SendMessage(IntPtr hWnd, uint Msg, uint wParam, IntPtr lParam);
-
- [DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto)]
- public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
-
- [DllImport(ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
- public static extern IntPtr OpenProcess(ProcessAccess dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, uint dwProcessId);
-
- [DllImport(ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
- public static extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpAddress, int dwSize, AllocationType flAllocationType, MemoryProtection flProtect);
-
- [DllImport(ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
- public static extern int CloseHandle(IntPtr hObject);
-
- [DllImport(ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
- public static extern bool VirtualFreeEx(IntPtr hProcess, IntPtr lpAddress, int dwSize, FreeType dwFreeType);
-
- [DllImport(ExternDll.User32, SetLastError = true)]
- public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
-
- [DllImport(ExternDll.User32, SetLastError = true)]
- public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
-
- [DllImport(ExternDll.User32)]
- public static extern int GetWindowRect(IntPtr hwnd, out RECT lpRect);
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
- public static extern bool GetCursorPos(out POINT pt);
-
- [SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- [DllImport(ExternDll.User32)]
- public static extern int GetSystemMetrics(SM nIndex);
-
- [DllImport(ExternDll.User32)]
- public static extern IntPtr GetDesktopWindow();
-
- [DllImport(ExternDll.User32, SetLastError = true)]
- [return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool AddClipboardFormatListener(IntPtr hwnd);
-
- [DllImport(ExternDll.User32, SetLastError = true)]
- [return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool RemoveClipboardFormatListener(IntPtr hwnd);
-
- [DllImport(ExternDll.User32)]
- public static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
-
- [DllImport(ExternDll.User32)]
- public static extern bool InsertMenu(IntPtr hMenu, int wPosition, int wFlags, int wIDNewItem, string lpNewItem);
- }
-}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/NativeValues.cs b/src/Shared/HandyControl_Shared/Tools/Interop/NativeValues.cs
deleted file mode 100644
index 94c1e09b..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/NativeValues.cs
+++ /dev/null
@@ -1,235 +0,0 @@
-// ReSharper disable InconsistentNaming
-
-namespace HandyControl.Tools.Interop
-{
- internal enum SM
- {
- CXSCREEN = 0,
- CYSCREEN = 1,
- CXVSCROLL = 2,
- CYHSCROLL = 3,
- CYCAPTION = 4,
- CXBORDER = 5,
- CYBORDER = 6,
- CXFIXEDFRAME = 7,
- CYFIXEDFRAME = 8,
- CYVTHUMB = 9,
- CXHTHUMB = 10,
- CXICON = 11,
- CYICON = 12,
- CXCURSOR = 13,
- CYCURSOR = 14,
- CYMENU = 15,
- CXFULLSCREEN = 16,
- CYFULLSCREEN = 17,
- CYKANJIWINDOW = 18,
- MOUSEPRESENT = 19,
- CYVSCROLL = 20,
- CXHSCROLL = 21,
- DEBUG = 22,
- SWAPBUTTON = 23,
- CXMIN = 28,
- CYMIN = 29,
- CXSIZE = 30,
- CYSIZE = 31,
- CXFRAME = 32,
- CXSIZEFRAME = CXFRAME,
- CYFRAME = 33,
- CYSIZEFRAME = CYFRAME,
- CXMINTRACK = 34,
- CYMINTRACK = 35,
- CXDOUBLECLK = 36,
- CYDOUBLECLK = 37,
- CXICONSPACING = 38,
- CYICONSPACING = 39,
- MENUDROPALIGNMENT = 40,
- PENWINDOWS = 41,
- DBCSENABLED = 42,
- CMOUSEBUTTONS = 43,
- SECURE = 44,
- CXEDGE = 45,
- CYEDGE = 46,
- CXMINSPACING = 47,
- CYMINSPACING = 48,
- CXSMICON = 49,
- CYSMICON = 50,
- CYSMCAPTION = 51,
- CXSMSIZE = 52,
- CYSMSIZE = 53,
- CXMENUSIZE = 54,
- CYMENUSIZE = 55,
- ARRANGE = 56,
- CXMINIMIZED = 57,
- CYMINIMIZED = 58,
- CXMAXTRACK = 59,
- CYMAXTRACK = 60,
- CXMAXIMIZED = 61,
- CYMAXIMIZED = 62,
- NETWORK = 63,
- CLEANBOOT = 67,
- CXDRAG = 68,
- CYDRAG = 69,
- SHOWSOUNDS = 70,
- CXMENUCHECK = 71,
- CYMENUCHECK = 72,
- SLOWMACHINE = 73,
- MIDEASTENABLED = 74,
- MOUSEWHEELPRESENT = 75,
- XVIRTUALSCREEN = 76,
- YVIRTUALSCREEN = 77,
- CXVIRTUALSCREEN = 78,
- CYVIRTUALSCREEN = 79,
- CMONITORS = 80,
- SAMEDISPLAYFORMAT = 81,
- IMMENABLED = 82,
- CXFOCUSBORDER = 83,
- CYFOCUSBORDER = 84,
- TABLETPC = 86,
- MEDIACENTER = 87,
- REMOTESESSION = 0x1000,
- REMOTECONTROL = 0x2001
- }
-
- internal enum CacheSlot
- {
- DpiX,
-
- FocusBorderWidth,
- FocusBorderHeight,
- HighContrast,
- MouseVanish,
-
- DropShadow,
- FlatMenu,
- WorkAreaInternal,
- WorkArea,
-
- IconMetrics,
-
- KeyboardCues,
- KeyboardDelay,
- KeyboardPreference,
- KeyboardSpeed,
- SnapToDefaultButton,
- WheelScrollLines,
- MouseHoverTime,
- MouseHoverHeight,
- MouseHoverWidth,
-
- MenuDropAlignment,
- MenuFade,
- MenuShowDelay,
-
- ComboBoxAnimation,
- ClientAreaAnimation,
- CursorShadow,
- GradientCaptions,
- HotTracking,
- ListBoxSmoothScrolling,
- MenuAnimation,
- SelectionFade,
- StylusHotTracking,
- ToolTipAnimation,
- ToolTipFade,
- UIEffects,
-
- MinimizeAnimation,
- Border,
- CaretWidth,
- ForegroundFlashCount,
- DragFullWindows,
- NonClientMetrics,
-
- ThinHorizontalBorderHeight,
- ThinVerticalBorderWidth,
- CursorWidth,
- CursorHeight,
- ThickHorizontalBorderHeight,
- ThickVerticalBorderWidth,
- MinimumHorizontalDragDistance,
- MinimumVerticalDragDistance,
- FixedFrameHorizontalBorderHeight,
- FixedFrameVerticalBorderWidth,
- FocusHorizontalBorderHeight,
- FocusVerticalBorderWidth,
- FullPrimaryScreenWidth,
- FullPrimaryScreenHeight,
- HorizontalScrollBarButtonWidth,
- HorizontalScrollBarHeight,
- HorizontalScrollBarThumbWidth,
- IconWidth,
- IconHeight,
- IconGridWidth,
- IconGridHeight,
- MaximizedPrimaryScreenWidth,
- MaximizedPrimaryScreenHeight,
- MaximumWindowTrackWidth,
- MaximumWindowTrackHeight,
- MenuCheckmarkWidth,
- MenuCheckmarkHeight,
- MenuButtonWidth,
- MenuButtonHeight,
- MinimumWindowWidth,
- MinimumWindowHeight,
- MinimizedWindowWidth,
- MinimizedWindowHeight,
- MinimizedGridWidth,
- MinimizedGridHeight,
- MinimumWindowTrackWidth,
- MinimumWindowTrackHeight,
- PrimaryScreenWidth,
- PrimaryScreenHeight,
- WindowCaptionButtonWidth,
- WindowCaptionButtonHeight,
- ResizeFrameHorizontalBorderHeight,
- ResizeFrameVerticalBorderWidth,
- SmallIconWidth,
- SmallIconHeight,
- SmallWindowCaptionButtonWidth,
- SmallWindowCaptionButtonHeight,
- VirtualScreenWidth,
- VirtualScreenHeight,
- VerticalScrollBarWidth,
- VerticalScrollBarButtonHeight,
- WindowCaptionHeight,
- KanjiWindowHeight,
- MenuBarHeight,
- VerticalScrollBarThumbHeight,
- IsImmEnabled,
- IsMediaCenter,
- IsMenuDropRightAligned,
- IsMiddleEastEnabled,
- IsMousePresent,
- IsMouseWheelPresent,
- IsPenWindows,
- IsRemotelyControlled,
- IsRemoteSession,
- ShowSounds,
- IsSlowMachine,
- SwapButtons,
- IsTabletPC,
- VirtualScreenLeft,
- VirtualScreenTop,
-
- PowerLineStatus,
-
- IsGlassEnabled,
- UxThemeName,
- UxThemeColor,
- WindowCornerRadius,
- WindowGlassColor,
- WindowGlassBrush,
- WindowNonClientFrameThickness,
- WindowResizeBorderThickness,
-
- NumSlots
- }
-
- internal static class Win32Constant
- {
- internal const int MAX_PATH = 260;
- internal const int INFOTIPSIZE = 1024;
- internal const int TRUE = 1;
- internal const int FALSE = 0;
- }
-}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/UnsafeNativeMethods.cs b/src/Shared/HandyControl_Shared/Tools/Interop/UnsafeNativeMethods.cs
deleted file mode 100644
index 378eab05..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/UnsafeNativeMethods.cs
+++ /dev/null
@@ -1,225 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.InteropServices;
-using System.Security;
-using System.Text;
-
-namespace HandyControl.Tools.Interop
-{
- [SuppressMessage("ReSharper", "InconsistentNaming")]
- internal class UnsafeNativeMethods
- {
- [SecurityCritical]
- [SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.User32, SetLastError = true, ExactSpelling = true, EntryPoint = nameof(GetDC), CharSet = CharSet.Auto)]
- public static extern IntPtr IntGetDC(HandleRef hWnd);
-
- [SecurityCritical]
- public static IntPtr GetDC(HandleRef hWnd)
- {
- var hDc = IntGetDC(hWnd);
- if (hDc == IntPtr.Zero)
- {
- throw new Win32Exception();
- }
-
- return HandleCollector.Add(hDc, CommonHandles.HDC);
- }
-
- [SecurityCritical]
- [SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.User32, ExactSpelling = true, EntryPoint = nameof(ReleaseDC), CharSet = CharSet.Auto)]
- public static extern int IntReleaseDC(HandleRef hWnd, HandleRef hDC);
-
- [SecurityCritical]
- public static int ReleaseDC(HandleRef hWnd, HandleRef hDC)
- {
- HandleCollector.Remove((IntPtr)hDC, CommonHandles.HDC);
- return IntReleaseDC(hWnd, hDC);
- }
-
- [SecurityCritical]
- [SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)]
- public static extern int GetDeviceCaps(HandleRef hDC, int nIndex);
-
- [SecurityCritical]
- [SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.User32)]
- public static extern int GetSystemMetrics(SM nIndex);
-
- [SecurityCritical]
- [SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.User32, EntryPoint = nameof(DestroyIcon), CharSet = CharSet.Auto, SetLastError = true)]
- private static extern bool IntDestroyIcon(IntPtr hIcon);
-
- [SecurityCritical]
- public static bool DestroyIcon(IntPtr hIcon)
- {
- var result = IntDestroyIcon(hIcon);
- return result;
- }
-
- [SecurityCritical]
- [SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.Gdi32, EntryPoint = nameof(DeleteObject), CharSet = CharSet.Auto, SetLastError = true)]
- private static extern bool IntDeleteObject(IntPtr hObject);
-
- [SecurityCritical]
- public static bool DeleteObject(IntPtr hObject)
- {
- var result = IntDeleteObject(hObject);
- return result;
- }
-
- [SecurityCritical]
- public static BitmapHandle CreateDIBSection(HandleRef hdc, ref BITMAPINFO bitmapInfo, int iUsage, ref IntPtr ppvBits, SafeFileMappingHandle hSection, int dwOffset)
- {
- if (hSection == null)
- {
- hSection = new SafeFileMappingHandle(IntPtr.Zero);
- }
-
- var hBitmap = PrivateCreateDIBSection(hdc, ref bitmapInfo, iUsage, ref ppvBits, hSection, dwOffset);
- return hBitmap;
- }
-
- [DllImport(ExternDll.Kernel32, EntryPoint = "CloseHandle", CharSet = CharSet.Auto, SetLastError = true)]
- public static extern bool IntCloseHandle(HandleRef handle);
-
- [SecurityCritical, SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto, EntryPoint = nameof(CreateDIBSection))]
- private static extern BitmapHandle PrivateCreateDIBSection(HandleRef hdc, ref BITMAPINFO bitmapInfo, int iUsage, ref IntPtr ppvBits, SafeFileMappingHandle hSection, int dwOffset);
-
- [SecurityCritical, SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.User32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto, EntryPoint = nameof(CreateIconIndirect))]
- private static extern IconHandle PrivateCreateIconIndirect([In, MarshalAs(UnmanagedType.LPStruct)]ICONINFO iconInfo);
-
- [SecurityCritical]
- public static IconHandle CreateIconIndirect([In, MarshalAs(UnmanagedType.LPStruct)]ICONINFO iconInfo)
- {
- var hIcon = PrivateCreateIconIndirect(iconInfo);
- return hIcon;
- }
-
- [SecurityCritical, SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto, EntryPoint = nameof(CreateBitmap))]
- private static extern BitmapHandle PrivateCreateBitmap(int width, int height, int planes, int bitsPerPixel, byte[] lpvBits);
-
- [SecurityCritical]
- internal static BitmapHandle CreateBitmap(int width, int height, int planes, int bitsPerPixel, byte[] lpvBits)
- {
- var hBitmap = PrivateCreateBitmap(width, height, planes, bitsPerPixel, lpvBits);
- return hBitmap;
- }
-
- [SecurityCritical, SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.Kernel32, EntryPoint = "GetModuleFileName", CharSet = CharSet.Unicode, SetLastError = true)]
- private static extern int IntGetModuleFileName(HandleRef hModule, StringBuilder buffer, int length);
-
- [SecurityCritical]
- internal static string GetModuleFileName(HandleRef hModule)
- {
- var buffer = new StringBuilder(Win32Constant.MAX_PATH);
- while (true)
- {
- var size = IntGetModuleFileName(hModule, buffer, buffer.Capacity);
- if (size == 0)
- {
- throw new Win32Exception();
- }
-
- if (size == buffer.Capacity)
- {
- buffer.EnsureCapacity(buffer.Capacity * 2);
- continue;
- }
-
- return buffer.ToString();
- }
- }
-
- [SecurityCritical, SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.Shell32, CharSet = CharSet.Auto, BestFitMapping = false, ThrowOnUnmappableChar = true)]
- internal static extern int ExtractIconEx(string szExeFileName, int nIconIndex, out IconHandle phiconLarge, out IconHandle phiconSmall, int nIcons);
-
- [DllImport(ExternDll.Shell32, CharSet = CharSet.Auto)]
- public static extern int Shell_NotifyIcon(int message, NOTIFYICONDATA pnid);
-
- [SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- [DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "CreateWindowExW")]
- public static extern IntPtr CreateWindowEx(
- int dwExStyle,
- [MarshalAs(UnmanagedType.LPWStr)] string lpClassName,
- [MarshalAs(UnmanagedType.LPWStr)] string lpWindowName,
- int dwStyle,
- int x,
- int y,
- int nWidth,
- int nHeight,
- IntPtr hWndParent,
- IntPtr hMenu,
- IntPtr hInstance,
- IntPtr lpParam);
-
- [SecurityCritical]
- [SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false)]
- public static extern short RegisterClass(WNDCLASS wc);
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
- public static extern IntPtr DefWindowProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
-
- [DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto)]
- public static extern bool SetForegroundWindow(IntPtr hWnd);
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)]
- public static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
-
- [DllImport(ExternDll.Kernel32, CharSet = CharSet.Auto, SetLastError = true)]
- public static extern IntPtr GetModuleHandle(string lpModuleName);
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)]
- public static extern bool UnhookWindowsHookEx(IntPtr hhk);
-
- public enum HookType
- {
- WH_KEYBOARD_LL = 13,
- WH_MOUSE_LL = 14
- }
-
- [StructLayout(LayoutKind.Sequential)]
- public struct MOUSEHOOKSTRUCT
- {
- public NativeMethods.POINT pt;
- public IntPtr hwnd;
- public uint wHitTestCode;
- public IntPtr dwExtraInfo;
- }
-
- public delegate IntPtr HookProc(int code, IntPtr wParam, IntPtr lParam);
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)]
- public static extern IntPtr SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hMod, uint dwThreadId);
-
- [DllImport(ExternDll.User32, SetLastError = true)]
- public static extern IntPtr GetDesktopWindow();
-
- [DllImport(ExternDll.User32, SetLastError = true)]
- public static extern IntPtr GetWindowDC(IntPtr window);
-
- [DllImport(ExternDll.Gdi32, SetLastError = true)]
- public static extern uint GetPixel(IntPtr dc, int x, int y);
-
- [DllImport(ExternDll.User32, SetLastError = true)]
- public static extern int ReleaseDC(IntPtr window, IntPtr dc);
-
- [DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)]
- public static extern int GetDeviceCaps(IntPtr hdc, int nIndex);
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
- public static extern IntPtr GetDC(IntPtr ptr);
- }
-}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/WNDCLASS.cs b/src/Shared/HandyControl_Shared/Tools/Interop/WNDCLASS.cs
deleted file mode 100644
index 33dd3903..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/WNDCLASS.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.InteropServices;
-
-namespace HandyControl.Tools.Interop
-{
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
- [SuppressMessage("ReSharper", "InconsistentNaming")]
- [SuppressMessage("ReSharper", "IdentifierTypo")]
- internal class WNDCLASS
- {
- public int style;
- public WndProc lpfnWndProc;
- public int cbClsExtra;
- public int cbWndExtra;
- public IntPtr hInstance;
- public IntPtr hIcon;
- public IntPtr hCursor;
- public IntPtr hbrBackground;
- public string lpszMenuName;
- public string lpszClassName;
- }
-}
\ No newline at end of file