Handle SEE_MASK_CLASSKEY case for ShellExecute.
This commit is contained in:
parent
3e53d11efe
commit
52b732dd0d
|
@ -144,6 +144,31 @@ BOOL HCR_GetExecuteCommandA(LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD l
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL HCR_GetExecuteCommandEx( HKEY hkeyClass, LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD len )
|
||||
{
|
||||
BOOL ret = FALSE;
|
||||
|
||||
TRACE("%p %s %s\n", hkeyClass, szClass, szVerb );
|
||||
|
||||
if (szClass)
|
||||
RegOpenKeyExA(hkeyClass,szClass,0,0x02000000,&hkeyClass);
|
||||
|
||||
if (hkeyClass)
|
||||
{
|
||||
char sTemp[MAX_PATH];
|
||||
|
||||
snprintf(sTemp, MAX_PATH, "shell\\%s\\command", szVerb);
|
||||
|
||||
ret = (ERROR_SUCCESS == SHGetValueA(hkeyClass, sTemp, NULL, NULL, szDest, &len));
|
||||
|
||||
if (szClass)
|
||||
RegCloseKey(hkeyClass);
|
||||
}
|
||||
|
||||
TRACE("-- %s\n", szDest );
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***************************************************************************************
|
||||
* HCR_GetDefaultIcon [internal]
|
||||
*
|
||||
|
|
|
@ -68,6 +68,7 @@ BOOL HCR_GetExecuteCommandA(LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD l
|
|||
BOOL HCR_GetDefaultIconA(LPCSTR szClass, LPSTR szDest, DWORD len, LPDWORD dwNr);
|
||||
BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len);
|
||||
|
||||
BOOL HCR_GetExecuteCommandEx ( HKEY hkeyClass, LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD len );
|
||||
BOOL HCR_GetFolderAttributes(REFIID riid, LPDWORD szDest);
|
||||
|
||||
INT_PTR CALLBACK AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
|
||||
|
|
|
@ -582,8 +582,7 @@ BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, SHELL_ExecuteA1632 execf
|
|||
if (sei->lpParameters)
|
||||
strcpy(szCommandline, sei->lpParameters);
|
||||
|
||||
if (sei->fMask & ((SEE_MASK_CLASSKEY & ~SEE_MASK_CLASSNAME) |
|
||||
SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY |
|
||||
if (sei->fMask & (SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY |
|
||||
SEE_MASK_CONNECTNETDRV | SEE_MASK_FLAG_DDEWAIT |
|
||||
SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI | SEE_MASK_UNICODE |
|
||||
SEE_MASK_NO_CONSOLE | SEE_MASK_ASYNCOK | SEE_MASK_HMONITOR ))
|
||||
|
@ -618,12 +617,19 @@ BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, SHELL_ExecuteA1632 execf
|
|||
}
|
||||
}
|
||||
|
||||
if (sei->fMask & SEE_MASK_CLASSNAME)
|
||||
if (sei->fMask & (SEE_MASK_CLASSNAME | SEE_MASK_CLASSKEY))
|
||||
{
|
||||
/* launch a document by fileclass like 'WordPad.Document.1' */
|
||||
/* the Commandline contains 'c:\Path\wordpad.exe "%1"' */
|
||||
/* FIXME: szCommandline should not be of a fixed size. Plus MAX_PATH is way too short! */
|
||||
HCR_GetExecuteCommandA(sei->lpClass, (sei->lpVerb) ? sei->lpVerb : "open", szCommandline, sizeof(szCommandline));
|
||||
if (sei->fMask & SEE_MASK_CLASSKEY)
|
||||
HCR_GetExecuteCommandEx(sei->hkeyClass,
|
||||
(sei->fMask & SEE_MASK_CLASSNAME) ? sei->lpClass: NULL,
|
||||
(sei->lpVerb) ? sei->lpVerb : "open", szCommandline, sizeof(szCommandline));
|
||||
else if (sei->fMask & SEE_MASK_CLASSNAME)
|
||||
HCR_GetExecuteCommandA(sei->lpClass, (sei->lpVerb) ? sei->lpVerb :
|
||||
"open", szCommandline, sizeof(szCommandline));
|
||||
|
||||
/* FIXME: get the extension of lpFile, check if it fits to the lpClass */
|
||||
TRACE("SEE_MASK_CLASSNAME->'%s', doc->'%s'\n", szCommandline, szApplicationName);
|
||||
|
||||
|
|
Loading…
Reference in New Issue