Refresh Desktop or fileexplorer

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
 
N

Newbie Coder

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top