Monday, April 2, 2012

How to refresh desktop using c# ?

Code :

[System.Runtime.InteropServices.DllImport("Shell32.dll")]
private static extern int SHChangeNotify(int eventId, int flags, IntPtr item1, IntPtr item2);

public static void Refresher()
{
    // Refresh the desktop
    SHChangeNotify(0x8000000, 0x1000, IntPtr.Zero, IntPtr.Zero);
}

No comments:

Post a Comment