[SHELL32][CONTROL] Added basic IOpenControlPanel support (#6248)

Add a basic IOpenControlPanel implementation that supports Vista canonical registry names.

Implements `control.exe /name company.name [/page id]` and `IOpenControlPanel`
handling of Vista-style canonical registry names.

The documented `Microsoft.*` names don't work because they are simply not
in our registry but "[Executable Control Panel Items](https://learn.microsoft.com/en-us/windows/win32/shell/how-to-register-an-executable-control-panel-item-registration-)" registered by 3rd-party ISVs
will function correctly in control.exe and the COM API.

Notes:

- `IOpenControlPanel` is implemented in CControlPanelFolder.cpp because
  it is supposed to have tighter integration with that shell folder than
  it does in this PR.

- `IOpenControlPanel` is also supposed to handle .cpl files with canonical
  names registered under [`Extended Properties`](https://learn.microsoft.com/en-us/windows/win32/shell/how-to-register-dll-control-panel-item-registration-#step-3) but the control panel folder
  does not implement `IShellFolder2::GetDetailsEx` yet, so it will have to wait.

- These "Executable Control Panel Items" are also supposed to be displayed
  in the control panel itself but this PR does not address that. The
  `ITEMIDLIST` format for those needs investigation...

- The Wow64 handling is perhaps not correct but it does not matter,
  `ShellExecuteEx` gets to deal with whatever is in the `...\shell\open\command` key.
  `CControlPanelFolder` would have to take more care when it starts
  reading those keys so it knows when to append "(32-bit)" to the display name.

- `%s%s` because .cpl canonical names don't have the `::` prefix according
  to Geoff Chappell.

- Always returns `CPVIEW_CLASSIC` because our `CControlPanelFolder` does
  not support the category view.
This commit is contained in:
Whindmar Saksit 2024-01-17 17:07:21 +01:00 committed by GitHub
parent fb43301bad
commit d41dec2e07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 281 additions and 1 deletions

View file

@ -231,6 +231,7 @@ DEFINE_GUID(CLSID_NewMenu, 0xd969A300, 0xe7FF, 0x11D0, 0xA9, 0x3B,
DEFINE_GUID(IID_IShellFolderViewCB, 0x2047E320, 0xF2A9, 0x11CE, 0xAE, 0x65, 0x8, 0x00, 0x2B, 0x2E, 0x12, 0x62);
DEFINE_GUID(CLSID_InternetButtons, 0x1E796980, 0x9CC5, 0x11D1, 0xA8, 0x3F, 0x0, 0xC0, 0x4F, 0xC9, 0x9D, 0x61);
DEFINE_GUID(CLSID_MenuDeskBar, 0xECD4FC4F, 0x521C, 0x11D0, 0xB7, 0x92, 0x00, 0xA0, 0xC9, 0x03, 0x12, 0xE1);
DEFINE_GUID(CLSID_OpenControlPanel, 0x06622D85, 0x6856, 0x4460, 0x8D, 0xE1, 0xA8, 0x19, 0x21, 0xB4, 0x1C, 0x4B);
DEFINE_GUID(SID_SMenuBandChild, 0xed9cc020, 0x08b9, 0x11d1, 0x98, 0x23, 0x0, 0xc0, 0x4f, 0xd9, 0x19, 0x72);
DEFINE_GUID(SID_SMenuBandParent, 0x8c278eec, 0x3eab, 0x11d1, 0x8c, 0xb0, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0xd0);

View file

@ -2360,6 +2360,37 @@ interface IExplorerCommandProvider : IUnknown
[out, iid_is(riid)] void **ppv);
};
/*****************************************************************************
* IOpenControlPanel interface (Vista+)
*/
[
object,
uuid(D11AD862-66DE-4DF4-BF6C-1F5621996AF1),
pointer_default(unique)
]
interface IOpenControlPanel : IUnknown
{
typedef [v1_enum] enum CPVIEW
{
CPVIEW_CLASSIC = 0,
CPVIEW_CATEGORY = 1,
CPVIEW_ALLITEMS = CPVIEW_CLASSIC,
CPVIEW_HOME = CPVIEW_CATEGORY
} CPVIEW;
HRESULT Open(
[in, optional] LPCWSTR pszName,
[in, optional] LPCWSTR pszPage,
[in, optional] IUnknown *punkSite);
HRESULT GetPath(
[in, optional] LPCWSTR pszName,
[out, string, size_is(cchPath)] LPWSTR pszPath,
[in] UINT cchPath);
HRESULT GetCurrentView(
[out] CPVIEW *pView);
}
#endif // __REACTOS__
/*****************************************************************************