我正在为客户编写一个屏幕捕获应用程序.捕获部分很好,但他想获取捕获所在文件的名称和路径.
使用system.diagnostics.process我能够获得捕获所在的进程,并且可以获取EXE的完整路径,但不能获取打开的文件.
即.记事本打开时,"TextFile1.txt"作为其文档.我可以从进程中获取MainWindowTitle,它将是'TextFile1.txt - Notepad',但我需要的更像是'c:\ users ....\TextFile1.txt'
有没有办法从流程中获取更多信息?
我确信有办法,但我无法弄清楚
任何帮助非常感谢.
我有一个WPF Scrollviewer,其内容为Items Control,显示图像列表.然后,我有另一个带有项目控件的滚动查看器,用于保存所选图像.我需要做的是当一些人点击所选图像时,所有图像中的项目应滚动进入查看.
我搜索过,但找不到任何如何实现这一目标的例子.
有人有任何例子或建议吗?
我正在尝试绑定 ColorAnimation TO={Binding Source={StaticResource Test1}, Path=Color}
我可以使用 SolidColorBrush 执行此操作,但是在尝试在颜色动画中使用它时出现“System.Windows.Markup.XamlParseException”异常。
这是我所拥有的:
<SolidColorBrush x:Key="Test1" Color="{Binding Source={x:Static self:MySettings.Default}, Path=HighlightColor}"/>
<SolidColorBrush x:Key="Test2" Color="{Binding Source={x:Static self:MySettings.Default}, Path=TextColor}"/>
<Style x:Key="WindowLabel" TargetType="Border" BasedOn="{StaticResource HighlightBorder}">
<Setter Property="Background" Value="{StaticResource Test2}"/>
<Setter Property="Height" Value="50"/>
<Style.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard>
<Storyboard>
<ColorAnimation To="{Binding Source={StaticResource Test1}, Path=Color}"
Duration="{StaticResource AnimSpeed}"
Storyboard.TargetProperty="Background.Color"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave">
<BeginStoryboard>
<Storyboard>
<ColorAnimation To="{Binding Source={StaticResource Test2}, Path=Color}"
Duration="{StaticResource AnimSpeed}"
Storyboard.TargetProperty="Background.Color"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Style.Triggers>
</Style>
Run Code Online (Sandbox Code Playgroud)
Test2 SolidColorBrush 工作正常,为什么动画不正常?
vb.net ×2
wpf ×2
animation ×1
colors ×1
filenames ×1
itemscontrol ×1
path ×1
process ×1
scrollviewer ×1