From dca8e2561d1495e09cfb582bf49ad814a6f32967 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Thu, 14 Apr 2022 15:26:11 +0800 Subject: [PATCH] ieframe: Enable visual styles. ieframe.dll uses manifest at ID 123. However, IEWinMain() is not called from rundll32.exe or Control_RunDLL() so the manifest needs to be activated in IEWinMain(). This allows iexplore.exe to enable theming. Signed-off-by: Zhiyi Zhang Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/ieframe/ieframe.manifest | 16 ++++++++++++++++ dlls/ieframe/ieframe.rc | 3 +++ dlls/ieframe/iexplore.c | 33 ++++++++++++++++++++++----------- 3 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 dlls/ieframe/ieframe.manifest diff --git a/dlls/ieframe/ieframe.manifest b/dlls/ieframe/ieframe.manifest new file mode 100644 index 00000000000..c8fd3eb4dce --- /dev/null +++ b/dlls/ieframe/ieframe.manifest @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/dlls/ieframe/ieframe.rc b/dlls/ieframe/ieframe.rc index aed8483e4ce..eb05a98dbc4 100644 --- a/dlls/ieframe/ieframe.rc +++ b/dlls/ieframe/ieframe.rc @@ -108,6 +108,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "wine/wine_common_ver.rc" +/* @makedep: ieframe.manifest */ +123 RT_MANIFEST ieframe.manifest + /* @makedep: ietoolbar.bmp */ IDB_IETOOLBAR BITMAP ietoolbar.bmp diff --git a/dlls/ieframe/iexplore.c b/dlls/ieframe/iexplore.c index 27b72a64fa7..1616d4d7f84 100644 --- a/dlls/ieframe/iexplore.c +++ b/dlls/ieframe/iexplore.c @@ -1125,10 +1125,13 @@ static void release_dde(void) */ DWORD WINAPI IEWinMain(const WCHAR *cmdline, int nShowWindow) { + BOOL embedding = FALSE, nohome = FALSE, manager = FALSE, activated = FALSE; MSG msg; HRESULT hres; - BOOL embedding = FALSE, nohome = FALSE, manager = FALSE; - DWORD reg_cookie; + HANDLE context = INVALID_HANDLE_VALUE; + DWORD reg_cookie, ret = 1; + ULONG_PTR context_cookie; + ACTCTXW actctx; static const WCHAR embeddingW[] = {'-','e','m','b','e','d','d','i','n','g',0}; static const WCHAR nohomeW[] = {'-','n','o','h','o','m','e',0}; @@ -1138,6 +1141,15 @@ DWORD WINAPI IEWinMain(const WCHAR *cmdline, int nShowWindow) CoInitialize(NULL); + memset(&actctx, 0, sizeof(actctx)); + actctx.cbSize = sizeof(actctx); + actctx.hModule = ieframe_instance; + actctx.lpResourceName = MAKEINTRESOURCEW(123); + actctx.dwFlags = ACTCTX_FLAG_HMODULE_VALID | ACTCTX_FLAG_RESOURCE_NAME_VALID; + context = CreateActCtxW(&actctx); + if (context != INVALID_HANDLE_VALUE) + activated = ActivateActCtx(context, &context_cookie); + init_dde(); while (*cmdline) @@ -1173,17 +1185,13 @@ DWORD WINAPI IEWinMain(const WCHAR *cmdline, int nShowWindow) if (FAILED(hres)) { ERR("failed to register CLSID_InternetExplorer%s: %08lx\n", manager ? "Manager" : "", hres); - CoUninitialize(); - ExitProcess(1); + goto done; } if (!embedding) { if(!create_ie_window(nohome, cmdline)) - { - CoUninitialize(); - ExitProcess(1); - } + goto done; } /* run the message loop for this thread */ @@ -1196,8 +1204,11 @@ DWORD WINAPI IEWinMain(const WCHAR *cmdline, int nShowWindow) CoRevokeClassObject(reg_cookie); release_dde(); + ret = 0; +done: CoUninitialize(); - - ExitProcess(0); - return 0; + if (activated) + DeactivateActCtx(0, context_cookie); + ReleaseActCtx(context); + ExitProcess(ret); }