refershing the desktop

  • Thread starter Thread starter Duncan Winn
  • Start date Start date
Duncan,

You will have to make calls to the Win32 API to do this. However, it
should be simple. Basically, you will get the handle to the desktop window
with GetDesktopWindow. Once you have that, you pass that to the
InvalidateRgn API function, to tell the desktop to repaint itself, or a
section of itself.

Hope this helps.
 
Declare this class somewhere

public class Win32API
{
[System.Runtime.InteropServices.DllImport("user32.dll")]
public extern static IntPtr GetDesktopWindow();

[System.Runtime.InteropServices.DllImport("user32.dll")]
public extern static bool UpdateWindow(IntPtr wnd);

public static void UpdateDesktop()
{
UpdateWindow(GetDesktopWindow());
}
}

and call Win32API.UpdateDesktop( )

-vJ
 
Back
Top