From e5733424ba8d15a4e0b6af6a4b3d70344547a46d Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Fri, 4 Aug 2017 08:53:06 +0000 Subject: [PATCH] [DESK.CPL] -Improve the hack that lets it process arguments by using the process command line instead of the one shell32 gives to the cpl. -Implement a new action called ActivateMSTheme that activates an msstyle file without showing any gui. If no file is passed, the classic theme is activated thus making it possible to switch themes from command line (or any other application may need to switch themes by launching desk.cpl). svn path=/trunk/; revision=75476 --- reactos/dll/cpl/desk/appearance.h | 1 + reactos/dll/cpl/desk/desk.c | 33 +++++++++++---------- reactos/dll/cpl/desk/theme.c | 48 +++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 15 deletions(-) diff --git a/reactos/dll/cpl/desk/appearance.h b/reactos/dll/cpl/desk/appearance.h index 7bbdb264f27..9f56ad3bedc 100644 --- a/reactos/dll/cpl/desk/appearance.h +++ b/reactos/dll/cpl/desk/appearance.h @@ -147,6 +147,7 @@ VOID ApplyScheme(PCOLOR_SCHEME scheme, PTHEME_SELECTION pSelectedTheme); BOOL ActivateTheme(PTHEME_SELECTION pSelectedTheme); void CleanupThemes(IN PTHEME pThemeList); BOOL DrawThemePreview(HDC hdcMem, PCOLOR_SCHEME scheme, PTHEME_SELECTION pSelectedTheme, PRECT prcWindow); +BOOL ActivateThemeFile(LPCWSTR pwszFile); /* prototypes for appearance.c */ INT_PTR CALLBACK AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); diff --git a/reactos/dll/cpl/desk/desk.c b/reactos/dll/cpl/desk/desk.c index 3bb931e0255..fa59d1733d3 100644 --- a/reactos/dll/cpl/desk/desk.c +++ b/reactos/dll/cpl/desk/desk.c @@ -124,7 +124,7 @@ DisplayApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) { HPROPSHEETPAGE hpsp[MAX_DESK_PAGES]; PROPSHEETHEADER psh; - HPSXA hpsxa; + HPSXA hpsxa = NULL; TCHAR Caption[1024]; UINT i; LPWSTR *argv = NULL; @@ -140,36 +140,38 @@ DisplayApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) { int argc; int i; - LPCWSTR pszCommandLine = (LPCWSTR)lParam; - argv = CommandLineToArgvW(pszCommandLine, &argc); +#if 0 + argv = CommandLineToArgvW((LPCWSTR)lParam, &argc); +#else + argv = CommandLineToArgvW(GetCommandLineW(), &argc); +#endif if (argv && argc) { for (i = 0; i