Refresh exporer based displays

This is a discussion on Refresh exporer based displays within the Windows Programming forums, part of the Platform Specific Boards category; When I programmaticly delete a file on the desktop, the image of it remains there until I manually refresh it. ...

  1. #1
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,691

    Refresh exporer based displays

    When I programmaticly delete a file on the desktop, the image of it remains there until I manually refresh it. Is there an API or something that will cause all explorer-based displays (like the desktop, explorer, open file dialog boxes, etc.) to refresh?
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  2. #2
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,266
    Hmm. The FolderView class, which is what Explorer uses, normally opens a directory change notification handle (e.g. FindFirstChangeNotification) for the path that it's looking at, so that the file system driver tells it when something changes.

    Not sure why it wouldn't be tracking your deletion though.

  3. #3
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,691
    Well, that happens on a Vista system, so I wouldn't be surprised if that has anything to do with it.
    What ever the cause, I need to manually refresh it somehow.
    Is there a MC WM of some kind I can send the desktop?
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  4. #4
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,308
    There is an API to refresh the desktop. I know because we used it in our product once. However it rearranges all your icons as well so users may not like it.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  5. #5
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Quote Originally Posted by iMalc View Post
    There is an API to refresh the desktop. I know because we used it in our product once. However it rearranges all your icons as well so users may not like it.
    but i thougth change was good lol
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  6. #6
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059
    Is there an API or something that will cause all explorer-based displays (like the desktop, explorer, open file dialog boxes, etc.) to refresh?
    Code:
    #pragma comment( lib, "shell32.lib" ) 
    #include <windows.h>
    #include <shlobj.h>
    
    int main(void)
    {
        SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
        return 0;
    }
    If a desktop item is properly deleted using the shell api, the desktop will be automatically updated. So, the issue may be with how you delete the file on the desktop

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. why page based I/O can improve performance?
    By George2 in forum C Programming
    Replies: 1
    Last Post: 06-12-2006, 08:42 AM
  2. Monitor Refresh Rates
    By SlyMaelstrom in forum Tech Board
    Replies: 4
    Last Post: 05-24-2006, 02:08 PM
  3. I Need To Know Some Things That I Can Put Into A Batch File
    By TheRealNapster in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-20-2003, 09:12 PM
  4. curses problem
    By rajesh23 in forum Linux Programming
    Replies: 2
    Last Post: 10-07-2003, 08:27 AM
  5. Dos commands hehe
    By Carp in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 01-17-2003, 02:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21