Private Const RDW_INVALIDATE As Integer = &H1
<System.Runtime.InteropServices.DllImport("user32.dll", SetLastError:=True)> _
Private Shared Function GetDesktopWindow() As IntPtr
End Function
<System.Runtime.InteropServices.DllImport("user32.dll", SetLastError:=True)> _
Private Shared Function LockWindowUpdate(ByVal hwndLock As IntPtr) As Integer
End Function
<System.Runtime.InteropServices.DllImport("user32.dll", SetLastError:=True)> _
Private Shared Function RedrawWindow(ByVal hwnd As IntPtr, ByVal lprcUpdate As Integer, ByVal hrgnUpdate As Integer, ByVal fuRedraw As Integer) As Integer
End Function
Public Sub RefreshDesktop()
Dim hDesk As IntPtr = GetDesktopWindow()
LockWindowUpdate(hDesk)
RedrawWindow(hDesk, 0, 0, RDW_INVALIDATE)
LockWindowUpdate(IntPtr.Zero)
End Sub