C# Windows 安全中心设置 [英] C# Windows Security Center Settings
问题描述
我想在 Windows 中禁用操作中心消息.我知道注册表在哪里保存这些检查的值,但这些值是特定于机器的.而且我知道我可以禁用完整的服务.但我不想禁用该服务,我只想不显示通知/警报/消息.
I would like to disable the Action Center messages in Windows. I know where the registry holds the values for these checks but those are machine specific. And I know that I can disable the complete service. But I do not want to disable the service, I only want to not show the notifications/alerts/messages.
要查看我所说的这些选项,请转到:cmd.exe -> RunDll32.exe shell32.dll,Control_RunDLL wscui.cpl
To see these options I am talking about goto: cmd.exe -> RunDll32.exe shell32.dll,Control_RunDLL wscui.cpl
将启动安全中心并点击左侧的更改操作中心设置".
The security center will be started and click on the left on "Change Action Center settings".
现在我在我的 C# 项目中引用了C:\Windows\System32\wscui.cpl"并添加了
Now I have referenced "C:\Windows\System32\wscui.cpl" in my C# project and added
using SecurityCenterAdmin;
我知道我可以创建这个对象
I see I can create this object
SecurityCenterAdmin.WscAdmin admin = new WscAdmin();
admin.DoModalSecurityAction();
但是我找不到关于它的参考资料.在 Google 上搜索WscAdmin msdn"或SecurityCenterAdmin"没有结果.
But I can find no references about it. Searching on Google for "WscAdmin msdn" or "SecurityCenterAdmin" yields no results.
有什么提示吗?
提前致谢.迈克
推荐答案
如果您不愿意通过适当的渠道访问 API (wscisv@microsoft.com).你可以随时尝试机器人处理这个过程.
If you're unwilling to go through the proper channels to get access to the API (wscisv@microsoft.com). You can always try robot-ting the process.
- 使用Process.Start打开操作中心,你好像已经有了命令行RunDll32.exe shell32.dll,Control_RunDLL wscui.cpl".
- 使用 FindWindow 和 FindWindowEx API 函数来获取窗口和控件句柄.http://msdn.microsoft.com/en-us/library/windows/desktop/ms633499%28v=vs.85%29.aspx 您需要使用Microsoft SPY++"Windows SDK 工具来获取类名等.
- 使用 SendMessage API 将鼠标消息模拟到窗口/控件http://msdn.microsoft.com/en-us/library/windows/desktop/ms644950%28v=vs.85%29.aspx WM_LBUTTONDOWN、WM_LBUTTONUP、WM_MOUSEMOVE 等等等.使用 SPY++ 也将有助于这个过程.
- Use Process.Start to open the action center, you seem to already have the command line "RunDll32.exe shell32.dll,Control_RunDLL wscui.cpl".
- Use the FindWindow and FindWindowEx API functions to get window and control handles. http://msdn.microsoft.com/en-us/library/windows/desktop/ms633499%28v=vs.85%29.aspx You'll want to make use of the "Microsoft SPY++" Windows SDK tool for getting class names etc.
- Use the SendMessage API to simulate mouse messages to the window/controls http://msdn.microsoft.com/en-us/library/windows/desktop/ms644950%28v=vs.85%29.aspx WM_LBUTTONDOWN, WM_LBUTTONUP, WM_MOUSEMOVE etc etc. Using SPY++ will also help with this process.
如果您在没有正确通知用户的情况下执行此操作,那么您的软件就非常可疑 - 恶意软件.我可以看到实际用途,作为贵公司可能用来快速配置独立桌面或其他东西的内部程序,但这真的很困难.
If you're doing this without properly notifying the user then your software is pretty shady - maleware. I could see practical uses, as an internal program your company may use to quickly configure stand alone desktops or something, but it's really a stretch.
这篇关于C# Windows 安全中心设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!