# HG changeset patch # User Daniel Atallah # Date 1266130673 0 # Node ID 2fc38fb61418befd97a2064aa80df1ad814d4878 # Parent f6cc979020494db11cc6f6f635690d216187d00d Make the "Execute a command" buddy pounce action use ShellExecute() on Windows so that it can open files of all types (e.g. MP3s) with their default associated application. Fixes #11333. diff -r f6cc97902049 -r 2fc38fb61418 pidgin/gtkpounce.c --- a/pidgin/gtkpounce.c Sun Feb 14 05:55:46 2010 +0000 +++ b/pidgin/gtkpounce.c Sun Feb 14 06:57:53 2010 +0000 @@ -1546,53 +1546,7 @@ g_free(localecmd); } #else /* !_WIN32 */ - PROCESS_INFORMATION pi; - BOOL retval; - gchar *message = NULL; - - memset(&pi, 0, sizeof(pi)); - - if (G_WIN32_HAVE_WIDECHAR_API ()) { - STARTUPINFOW si; - wchar_t *wc_cmd = g_utf8_to_utf16(command, - -1, NULL, NULL, NULL); - - memset(&si, 0 , sizeof(si)); - si.cb = sizeof(si); - - retval = CreateProcessW(NULL, wc_cmd, NULL, - NULL, 0, 0, NULL, NULL, - &si, &pi); - g_free(wc_cmd); - } else { - STARTUPINFOA si; - char *l_cmd = g_locale_from_utf8(command, - -1, NULL, NULL, NULL); - - memset(&si, 0 , sizeof(si)); - si.cb = sizeof(si); - - retval = CreateProcessA(NULL, l_cmd, NULL, - NULL, 0, 0, NULL, NULL, - &si, &pi); - g_free(l_cmd); - } - - if (retval) { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - } else { - message = g_win32_error_message(GetLastError()); - } - - purple_debug_info("pounce", - "Pounce execute command called for: " - "%s\n%s%s%s", - command, - retval ? "" : "Error: ", - retval ? "" : message, - retval ? "" : "\n"); - g_free(message); + winpidgin_shell_execute(command, "open", NULL); #endif /* !_WIN32 */ } } diff -r f6cc97902049 -r 2fc38fb61418 pidgin/win32/gtkwin32dep.c --- a/pidgin/win32/gtkwin32dep.c Sun Feb 14 05:55:46 2010 +0000 +++ b/pidgin/win32/gtkwin32dep.c Sun Feb 14 06:57:53 2010 +0000 @@ -157,6 +157,7 @@ wsinfo.lpVerb = w_verb; wsinfo.lpFile = w_uri; wsinfo.nShow = SW_SHOWNORMAL; + wsinfo.fMask |= SEE_MASK_FLAG_NO_UI; if (clazz != NULL) { w_clazz = g_utf8_to_utf16(clazz, -1, NULL, NULL, NULL); wsinfo.fMask |= SEE_MASK_CLASSNAME; @@ -181,6 +182,7 @@ sinfo.lpVerb = verb; sinfo.lpFile = locale_uri; sinfo.nShow = SW_SHOWNORMAL; + sinfo.fMask |= SEE_MASK_FLAG_NO_UI; if (clazz != NULL) { sinfo.fMask |= SEE_MASK_CLASSNAME; sinfo.lpClass = clazz;