4

I use a standard application manifest to enable visual styles in my window controls (that is, I am using comctl32.dll v6).

Now for some compatibility reason I want some particular tooltip control to be created without visual styles. Turning off the visual styles for it using either CCM_SETVERSION, SetWindowTheme(m_hWnd,"","") or even SetThemeAppProperties(0) doesn't solve my problem

What I need is to load the old v5.x comctl32.dll and use it to instantiate that particular tooltip control. Supposedly mixing v5 and v6 controls is perfectly allowable, but all samples I found work for the premise that the application does NOT have a manifest and show how to use an activation context to force the v6 of common controls. I want the OPPOSITE, that is force v5.

I cannot find any v5 manifest I can use to instantiate the older version (using CreateActCtx as in this example). As the old comctl32.dll is just in the SYSTEM32 folder and not in winSXS, it should be easy to use it, but how?

thanks, nikos

Community
  • 1
  • 1
nikos
  • 532
  • 3
  • 10
  • As far as I can tell, you have to remove the v6 comctl32 dependency from the default manifest. Then when you want v6 comctl32 you activate a v6 comctl32 manifest using the activation context API. And when you want v5, you revert to your default manifest. To the best of my knowledge, you cannot specify v5 comctl32 in a manifest. – David Heffernan Jun 04 '14 at 11:03
  • this would be a solution but I wouldn't want to add activation contexts in the hundreds other places in my code where a "normal" control is created just to create one v5 control. I tried to use ZombifyActCtx on the default (v6) context but that threw up an exception. Also some v5 manifests I found e.g. %WINDIR%\WinSxS\Manifests\x86_microsoft-windows-shell-comctl32-v5_xxx cannot be instantiated giving an error 14001 – nikos Jun 04 '14 at 12:12
  • You can install the v6 manifest at app startup. Then when you need to revert to v5, the default manifest, you just activate the NULL manifest. That returns you to default state. When you are done with v5, switch back to v6. – David Heffernan Jun 04 '14 at 12:14
  • you mean call ActivateActCtx(0, &cookie)? That "succeeds" but even after a second InitCommonControls, the v5 dll isn't loaded and CreateWindowEx still creates the v6 of the tooltip control – nikos Jun 04 '14 at 12:25
  • That's odd. My reading of the docs say that should do what you need. – David Heffernan Jun 04 '14 at 12:27
  • I wish it worked but it doesn't. I even did a forced LoadLibrary("comctl32.dll") after resetting the activation context but it doesn't load anything, just returns the cached v6 handle. I guess that ActivateActCtx(0) doesn't do anything – nikos Jun 04 '14 at 13:13
  • 2
    http://blogs.msdn.com/b/oldnewthing/archive/2014/05/08/10523522.aspx – Hans Passant Jun 04 '14 at 15:31
  • I linked to this article further up. It doesn't have anything about the question I'm asking – nikos Jun 06 '14 at 11:23

0 Answers0