Reputation: 4665
I'm trying to refresh desktop, tried this,
Private Declare Function SHChangeNotify Lib "Shell32.dll" (ByVal wEventID As Long,
ByVal uFlags As Long, ByVal dwItem1 As Long, ByVal dwItem2 As Long) As Long
call SHChangeNotify(&H8000000&, &H0, vbNullString, vbNullString)
But it gives me error
What is the correct way to refresh desktop ?
Upvotes: 0
Views: 1375
Reputation: 1178
You need to call SHCangeNotify(&H8000000, &H0, Nothing, Nothing) from within a method for example:
Public Class example
Private Declare Function SHChangeNotify Lib "Shell32.dll" (ByVal wEventID As Long, _
ByVal uFlags As Long, _
ByVal dwitem1 As Long, _
ByVal deitem2 As Long) As Long
Private Sub refreshWindow()
SHCangeNotify(SHChangeNotify(&H8000000, &H0, Nothing, Nothing)
End Sub
End Class
Upvotes: 1