隐藏Windows 8桌面图标

16

最近我一直使用以下Win32代码来隐藏桌面(隐藏所有桌面图标)。 以下代码在我的Win32_Window类中,因为桌面只是一个窗口。

public bool Visible
{
    get { return IsWindowVisible(Handle); }
    set
    {
        ShowWindow(Handle, value ? ShowWindowConsts.SW_SHOW :
            ShowWindowConsts.SW_HIDE);
    }
}

在Windows 8中,上述方法不仅隐藏了桌面,而且使其完全变空。现在我认为这可能被认为是正常的,因为该命令是隐藏,但直到现在,这并不是一个问题,因为桌面的背景图像仍然可见(这是意图)。

我尝试过以下方法来切换图标:https://dev59.com/VWw15IYBdhLWcg3wxurL#6403014 ,但在Windows 8中无效。

有人找到解决方法了吗?


你可以在这里找到答案 :-) https://dev59.com/VWw15IYBdhLWcg3wxurL - Eranga Heshan
1个回答

1
您可以在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();
        }
    }

使用如下所述的Registry类。

http://msdn.microsoft.com/en-us/library/microsoft.win32.registry.aspx


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接