有一段时间我现在使用以下Win32代码隐藏桌面(隐藏所有桌面图标).以下是我的Win32_Window类,因为桌面只是一个窗口.
public bool Visible
{
get { return IsWindowVisible(Handle); }
set
{
ShowWindow(Handle, value ? ShowWindowConsts.SW_SHOW :
ShowWindowConsts.SW_HIDE);
}
}
Run Code Online (Sandbox Code Playgroud)
使用Windows 8,上面不仅隐藏了桌面,而且使它完全空白.现在我认为这可以被认为是正常的,因为命令是隐藏的,但到目前为止还没有问题,因为桌面的背景图像仍然可见(这是意图).
我试过这个来切换图标:https://stackoverflow.com/a/6403014/353147但它在Windows 8中不起作用.
有人找到了解决方案吗?
您可以在 RegEdit HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced 中执行此操作,将 HideIcons 更改为 1
static void HideIcons()
{
RegistryKey myKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced", true);
if (myKey != null)
{
myKey.SetValue("HideIcons", 1);
myKey.Close();
}
}
Run Code Online (Sandbox Code Playgroud)
按照此处所述使用Registry 类。
http://msdn.microsoft.com/en-us/library/microsoft.win32.registry.aspx