views:

44

answers:

0

Hi,

I want to hide the desktop icons, am able to do with following code but the problem is if i press windows+D keys and try to hide the desktop icons, it is not happening. Can you please help on this?

[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, 
    string lpszClass, string lpszWindow);

IntPtr hWnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Progman", null);
ShowWindow(hWnd, 5); //show
ShowWindow(hWnd, 0); // hide