title: Hiding desktop items in Windows 7 - not working
body: <p>In a previous question, there was an explanation how to hide desktop items:</p>
  
  <p><a href="https://stackoverflow.com/questions/6402834/how-to-hide-desktop-icons-programatically">How to hide desktop icons programatically?</a></p>
  
  <p>For some reason, this code doesn't work for me.</p>
  
  <p>I would have simply commented on the above link, but I don't have enough privileges to comment on other people's questions...</p>
  
  <p>Any ideas what's going wrong? The desktop simply doesn't hide.</p>
  
  <p>UPDATE: Additionally, I tried using the following code (as was suggested <a href="https://stackoverflow.com/questions/1638471/show-hide-desktop-icons-from-c-application">here</a>), but still no effect:</p>
  
  <pre><code>struct SHELLSTATE
  {
        bool fShowAllObjects;
        bool fShowExtensions;
        bool fNoConfirmRecycle;
        bool fShowSysFiles;
        bool fShowCompColor;
        bool fDoubleClickInWebView;
        bool fDesktopHTML;
        bool fWin95Classic;
        bool fDontPrettyPath;
        bool fShowAttribCol;
        bool fMapNetDrvBtn;
        bool fShowInfoTip1;
        bool fHideIcons1;
        bool fWebView1;
        bool fFilter1;
        bool fShowSuperHidden1;
        bool fNoNetCrawling1;
        UInt32 dwWin95Unused;
        uint uWin95Unused;
        long lParamSort;
        int   iSortDirection;
        uint version;
        uint uNotUsed;
        bool fSepProcess;
        bool fStartPanelOn;
        bool fShowStartPage;
        bool fAutoCheckSelect;
        bool fIconsOnly;
        bool fShowTypeOverlay;
        uint fSpareFlags;
  }
  
  class MyClass
  {
      const UInt32 SSF_HIDEICONS = 0x00004000;
  
      [DllImport("Shell32.dll")]
      static extern void SHGetSetSettings(ref SHELLSTATE state, UInt32 dwMask, bool bSet);
      static void Foobar()
      {
          SHELLSTATE stateOfMind = new SHELLSTATE();
          Console.WriteLine("Set to true:");
          SHGetSetSettings(ref stateOfMind, SSF_HIDEICONS, true);
          Console.ReadKey();
          Console.WriteLine("Set to false:");
          SHGetSetSettings(ref stateOfMind, SSF_HIDEICONAS, false);
          Console.ReadKey();
      }
  }
  </code></pre>