Refresh Desktop or fileexplorer

  • Thread starter Thread starter Manfred Meier
  • Start date Start date
M

Manfred Meier

Hello

In my code I create a folder on the desktop or any other folder
location.

Unless I press F5 while the Desktop or the Explorer containing the
created folder has the focus this new folder will not show up.

Is there a solution to do a refresh programatically?

I tried

AppActivate("Desktop")
SendKeys.Send("{F5}")

The problem seems to get the right explorer.

Thank you for any help in advance.

Regards

Manfred
 
Manfred,

' Declaration

Private Declare Function SHChangeNotify Lib "Shell32.dll" (ByVal wEventID As
Int32, ByVal uFlags As Int32, ByVal dwItem1 As Int32, ByVal dwItem2 As Int32) As
Int32

The line below is used to refresh the Desktop:

' Refresh
SHChangeNotify(&H8000000, &H0, 0, 0)
 
Back
Top