mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 18:08:58 +00:00
128667 - launch windows app picker dialog if file has no association. r=law sr=ben a=asa
This commit is contained in:
parent
80fab587b2
commit
4e4b80e712
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user