128667 - launch windows app picker dialog if file has no association. r=law sr=ben a=asa

git-svn-id: svn://10.0.0.236/trunk@115898 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
blakeross%telocity.com 2002-03-06 01:11:34 +00:00
parent 74d223827d
commit a7f45cbbc0

View File

@ -2113,10 +2113,19 @@ nsLocalFile::Launch()
// use the app registry name to launch a shell execute....
LONG r = (LONG) ::ShellExecute( NULL, NULL, (const char *) path, NULL, NULL, SW_SHOWNORMAL);
// if the file has no association, we launch windows' "what do you want to do" dialog
if (r == SE_ERR_NOASSOC) {
nsCAutoString shellArg;
shellArg.Assign(NS_LITERAL_CSTRING("shell32.dll,OpenAs_RunDLL "));
shellArg.Append(path);
r = (LONG) ::ShellExecute(NULL, NULL, "RUNDLL32.EXE", shellArg.get(),
NULL, SW_SHOWNORMAL);
}
if (r < 32)
rv = NS_ERROR_FAILURE;
else
rv = NS_OK;
rv = NS_OK;
return rv;
}