CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2007
    Posts
    42

    One question of registry(file asociation,I need update icons without reboot computer)

    Hi,
    I have implemented one method that you can associate one extension file with our application with her icon (I am modifying the registry of windows). If I apply this method and after I execute one file with this extension I can see that our application run, this is correct, but I only can see the icon in the file with the especific extension if I restart the computer. What is the problem? How I can see the icon after to apply my method?
    Thanks.
    Last edited by molistok; March 26th, 2009 at 06:41 AM.

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: One question of registry (file association)

    The OS icon cache probably needs to be rebuild... but this is a OS problem, not some problem in your software, so there is nothing you can do to fix it from inside your software.

  3. #3
    Join Date
    Feb 2002
    Posts
    3,788

    Re: One question of registry (file association)

    i think WM_SETTINGCHANGE could be of help. send it after you've modified the registry.

  4. #4
    Join Date
    Feb 2007
    Posts
    42

    Re: One question of registry (file association)

    Hi,
    thanks for the replies, I think that this is possible to do, because for example you can change the icons of one extension manually and you don't reboot your computer to see the changes.

    I have tried to send a message WM_SETTINGCHANGE with this function:

    PDWORD_PTR TEMP=0;
    if (SendMessageTimeout(HWND_BROADCAST,WM_SETTINGCHANGE,0,0,SMTO_NORMAL,5000,TEMP)!=0)

    but I can't see any change, I don't know if the params (or the correct function)that I pass to the function SendMessageTimeout are corrects, can any help me please?

    Thanks.

  5. #5
    Join Date
    Feb 2007
    Posts
    42

    Re: One question of registry (file association)

    Can any help me?

  6. #6
    Join Date
    Nov 2007
    Posts
    613

    Re: One question of registry (file association)

    I'm not sure this will help you but you should try to use it after you write to the registry, the RegFlushKey function.

    Something that would probably solve your problem would be to stop, then restart the explorer.exe process. But this will close all Windows Explorer windows opened on the screen.

  7. #7
    Join Date
    Feb 2007
    Posts
    42

    Re: One question of registry (file association)

    Hi,
    thanks for the reply.
    I have tried this: RegFlushKey(HKEY_CLASSES_ROOT);
    But I need reboot the computer to see any change. I see that the association don't need reboot the computer instead to see the correct icons I need reboot.

    Can any help me? Thanks.

  8. #8
    Join Date
    Dec 2008
    Posts
    114

    Re: One question of registry (file association)

    It's a very classic question for ages. See on Google Groups ( win32 group and others)
    (Shell)

  9. #9
    Join Date
    Feb 2007
    Posts
    42

    [SOLVED] One question of registry (file association)

    Thanks for all replies, Finally I can solved the problem, I after of modify the registry I call this function:

    SHChangeNotify(SHCNE_ASSOCCHANGED,SHCNF_IDLIST,NULL,NULL);

    When I change the icon after to call this function the icon is ipdated.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured