Module: wine Branch: master Commit: f612ed1fcbdf67830f5598dbb08c627a92a46ea7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f612ed1fcbdf67830f5598dbb0...
Author: Damjan Jovanovic damjan.jov@gmail.com Date: Thu Jun 11 20:52:03 2009 +0200
shell32: Update file type associations when requested.
---
dlls/shell32/changenotify.c | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/dlls/shell32/changenotify.c b/dlls/shell32/changenotify.c index 96345b6..43a5fb8 100644 --- a/dlls/shell32/changenotify.c +++ b/dlls/shell32/changenotify.c @@ -105,6 +105,31 @@ static const char * DumpEvent( LONG event ) #undef DUMPEV }
+static BOOL RefreshFileTypeAssociations(void) +{ + static WCHAR szWinemenubuilder[] = { + 'w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e', + ' ','-','a',0 }; + STARTUPINFOW si; + PROCESS_INFORMATION pi; + BOOL ret; + + TRACE("starting %s\n",debugstr_w(szWinemenubuilder)); + + memset(&si, 0, sizeof(si)); + si.cb = sizeof(si); + + ret = CreateProcessW( NULL, szWinemenubuilder, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ); + + if (ret) + { + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + } + + return ret; +} + static const char * NodeName(const NOTIFICATIONLIST *item) { const char *str; @@ -397,6 +422,12 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID } TRACE("notify Done\n"); LeaveCriticalSection(&SHELL32_ChangenotifyCS); + + if (wEventId & SHCNE_ASSOCCHANGED) + { + TRACE("refreshing file type associations\n"); + RefreshFileTypeAssociations(); + }
/* if we allocated it, free it. The ANSI flag is also set in its Unicode sibling. */ if ((typeFlag & SHCNF_PATHA) || (typeFlag & SHCNF_PRINTERA))