[SHELL32] Minimal SHRunControlPanel implementation (#3095)

CORE-9215
Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
This commit is contained in:
Kyle Katarn 2020-09-19 16:23:44 +02:00 committed by GitHub
parent ab115e30fe
commit da36f799c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 1 deletions

View file

@ -1472,10 +1472,29 @@ HRESULT WINAPI SHWinHelp(HWND hwnd, LPCWSTR pszHelp, UINT uCommand, ULONG_PTR dw
* SHRunControlPanel [SHELL32.161]
*
*/
BOOL WINAPI SHRunControlPanel (LPCWSTR commandLine, HWND parent)
BOOL WINAPI SHRunControlPanel (_In_ LPCWSTR commandLine, _In_opt_ HWND parent)
{
#ifdef __REACTOS__
/*
* TODO: Run in-process when possible, using
* HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\InProcCPLs
* and possibly some extra rules.
* See also https://docs.microsoft.com/en-us/windows/win32/api/shlobj/nf-shlobj-shruncontrolpanel
* "If the specified Control Panel item is already running, SHRunControlPanel
* attempts to switch to that instance rather than opening a new instance."
* This function is not supported as of Windows Vista, where it always returns FALSE.
* However we need to keep it "alive" even when ReactOS is compliled as NT6+
* in order to keep control panel elements launch commands.
*/
TRACE("(%s, %p)n", debugstr_w(commandLine), parent);
WCHAR parameters[MAX_PATH] = L"shell32.dll,Control_RunDLL ";
wcscat(parameters, commandLine);
return ((INT_PTR)ShellExecuteW(parent, L"open", L"rundll32.exe", parameters, NULL, SW_SHOWNORMAL) > 32);
#else
FIXME("(%s, %p): stub\n", debugstr_w(commandLine), parent);
return FALSE;
#endif
}
static LPUNKNOWN SHELL32_IExplorerInterface=0;

View file

@ -2466,6 +2466,16 @@ HRESULT WINAPI CIDLData_CreateFromIDArray(
_In_reads_opt_(cidl) PCUIDLIST_RELATIVE_ARRAY apidl,
_Outptr_ IDataObject **ppdtobj);
/****************************************************************************
* SHRunControlPanel
*/
BOOL
WINAPI
SHRunControlPanel(
_In_ LPCWSTR commandLine,
_In_opt_ HWND parent);
/****************************************************************************
* SHOpenWithDialog
*/