简体   繁体   English

如何从部分受信任的 .NET 应用程序中 flash 任务栏?

[英]How can I flash the taskbar from a partial trusted .NET application?

I'd like to flash the taskbar ( as described here for example ), but I can't P/Invoke FlashWindowEx (or anything else, for that matter) in the security context my application is running in.我想 flash 任务栏( 例如这里描述的),但我不能在我的应用程序运行的安全上下文中P/Invoke FlashWindowEx (或其他任何东西)。

Is there another way to get the taskbar to flash?有没有其他方法可以让任务栏到达 flash? If not, what are my options for getting the user's attention?如果没有,我有哪些选择来吸引用户的注意力?

I'm afraid there is no other way to make the window flash from partially trusted code.恐怕没有其他方法可以从部分受信任的代码中制作 window flash 。 You can't raise the form to the front either as there is no way to steal the focus like this.您也不能将表格提升到前面,因为没有办法像这样窃取焦点。 You can't use a NotifyIcon, or even a MessageBox from partial trust either, so it seems you are out of luck.您也不能使用 NotifyIcon,甚至是来自部分信任的 MessageBox,所以您似乎不走运。

Here is a list of things you can't do in WinForms .这是您在 WinForms 中不能做的事情的列表

It looks like your only option is to find a way to elevate your code's privileges (perhaps get it signed and ask the user to trust your certificate).看起来你唯一的选择是找到一种方法来提升你的代码的权限(也许让它签名并要求用户信任你的证书)。 Aside from that, just wait until the user clicks on your app!除此之外,只需等到用户点击您的应用!

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM