Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide Windows 8 Desktop Icons

Tags:

c#

windows-8

For a while now I've used the following Win32 code to Hide the desktop (hide all the desktop Icons). The following is in my Win32_Window class, as the Desktop is just a window.

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

With Windows 8 the above not only hides the desktop but it makes it go completely blank. Now I suppose that could be considered normal, as the command is to hide, but up until now that hasn't been a problem as the desktop's background image would still be visible (which was the intention).

I've tried this to toggle the icons: https://stackoverflow.com/a/6403014/353147 but it doesn't work in Windows 8.

Anyone found a solution to this?

like image 217
Chuck Savage Avatar asked Dec 04 '12 04:12

Chuck Savage


People also ask

How do I completely hide desktop icons?

To show or hide desktop iconsRight-click (or press and hold) the desktop, point to View, and then select Show desktop icons to add or clear the check mark. Note: Hiding all the icons on your desktop doesn't delete them, it just hides them until you choose to show them again.

Is there a button to hide desktop icons?

Press the Windows key + D on your keyboard to display the Windows desktop. Right-click the desktop shortcut icon you'd like to hide.


1 Answers

You can do this in RegEdit HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced change HideIcons to 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();
        }
    }

Use the Registry class as described here.

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

like image 117
Jan-Fokke Avatar answered Oct 04 '22 22:10

Jan-Fokke