I been trying to hide my Desktop Icons similar to right clicking on Desktop > View Hide Desktop Icon. I found some ways to do it using C# or C++ but it does not take effect until you restart the computer.
Is there a way I could do it without restarting similar to how windows does it. Also I found some that used winAPI and shell, if you could help me use one of those too I would be grateful. Here's the many code I've tried so far:
private const int SW_HIDE = 0;
private const int SW_SHOW = 5;
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
[DllImport("user32.dll")]
public 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);
public static void Main( string[] args ){
//.... Irrelevant code ...
Console.Writeline(" Goodbye Icons ");
IntPtr hWnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Progman", null);
ShowWindow(hWnd, SW_HIDE);
//.... Irrelevant code....
// ShowWindow(hWnd, SW_SHOW); //This undoes the disable desktop
}