简体   繁体   English

Windows eventtriggers可以用于微不足道的事件吗?

[英]Can windows eventtriggers be used for trivial events?

In an application I am making, I want to know when a user copies a file or clicks the start button. 在我正在制作的应用程序中,我想知道用户何时复制文件或单击“开始”按钮。 Those actions would be considered too trivial but they carry some importance in my application. 这些动作被认为是微不足道的,但是它们在我的应用程序中具有重要意义。

Yesterday, I received a comment Getting notified of any action taken by user on windows on a similar question so I am hesitating to switch the entire auditing infrastructure. 昨天,我收到一条评论,该通知将用户在Windows上针对类似问题采取的任何操作通知我,因此我犹豫要切换整个审核基础结构。

Going as per explanation of eventtriggers http://technet.microsoft.com/en-us/library/bb490901.aspx 按照事件触发的解释进行操作http://technet.microsoft.com/zh-cn/library/bb490901.aspx

Creates a new event trigger that monitors and acts upon the occurrence of log events of given criteria. 创建一个新的事件触发器,该触发器监视给定条件的日志事件的发生并采取措施。

I am not sure what the limits of eventtriggers and how it can help me achieve my goal without so much overhead. 我不确定事件触发的局限性是什么,以及它如何在没有太多开销的情况下帮助我实现目标。 Can eventtriggers help me set a trigger that notifies me when the start button is clicked?. 事件触发程序可以帮助我设置一个触发器,当单击“开始”按钮时通知我吗?

Not possible, to my knowledge, unless you poll to find out the status. 据我所知,除非您进行投票以找出状态,否则这是不可能的。 This example was already brought up in a previous question on SO: How can I detect when the Windows 7 start menu opens 该示例已在先前关于SO的问题中提出: 如何检测Windows 7开始菜单何时打开

Theoretically you could write something that lives on a different thread that queries the start menu at given intervals. 从理论上讲,您可以编写驻留在不同线程上的东西,这些线程以给定的时间间隔查询开始菜单。 Then, if the start menu was detected as open you could trigger the code you want done. 然后,如果开始菜单被检测为打开,则可以触发您想要完成的代码。 Just a thought... 只是一个想法...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何声明可以在其他事件中使用的对象? - how to declare an object that can be used in Other events? 如何使用CancelEventArgs之类的事件? - How events like CancelEventArgs can be used? 天蓝色存储事件可以用于网络农场吗 - can azure storage events be used for web farm WPF EventTriggers-在Visual Studio 2008中无法将属性'RoutedEvent'中的字符串'DragOver'转换为类型'System.Windows.RoutedEvent'的对象 - WPF EventTriggers - Cannot convert string 'DragOver' in attribute 'RoutedEvent' to object of type 'System.Windows.RoutedEvent' in Visual Studio 2008 XAML绑定在自定义EventTriggers中不起作用 - XAML Bindings not working in custom EventTriggers Windows Phone 8中可以使用的方法的大小是否有限制? - Is there a limit to the size of a method that can be used in Windows Phone 8? Winforms数据绑定:可以使用TypeConverter而不是Format / Parse事件吗? - Winforms data binding: Can a TypeConverter be used instead of the Format/Parse events? 事件可以在多线程应用程序中安全使用吗 - Can events be used in a multi-threaded application safely C#:什么是虚拟事件以及如何使用它们? - C#: What are virtual events and how can they be used? Windows服务可以在Silverlight网站上使用吗? - Can a windows service be used on a Silverlight website?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM