Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How to refresh Windows Explorer in C?

I have code to change the icon of a drive. However, if the user already has Windows Explorer open, he won't see the change unless he refreshes the view with F5.

How do I force Windows Explorer to refresh?

Update:

Since I want to refresh the drive icon, the only view I want to refresh is "My Computer". So, there is no way to delete or create a dummy file there. Any other suggestions?

Update 2:

Since I want to refresh the drive icon, the only view I want to refresh is "My Computer". So, there is no way to delete or create a dummy file there. Any other suggestions?

1 Answer

Relevance
  • 1 decade ago
    Favorite Answer

    A trick that often works is to have your C program attempt to delete a file in the desired folder that doesn't actually exist. This should cause Windows Explorer to refresh. If that doesn't work, have your C program create a temporary file in the desired directory, then delete it.

Still have questions? Get your answers by asking now.