I need to use Windows Common Controls v6.0 to see new style UIs. I know I can do it by a manifest dependency but when I haven't access to the manifest (or source code... it's not my app but I have a DLL which will be attached to the process and every CommCtrls I need will be called from that DLL) what should I do to specify Windows Common Controls version for that process? Is there any API or someway to do it? [By the way, I'm using C++ & VS2015]
Asked
Active
Viewed 1,179 times
0
-
Why would you not have access to the manifest? And why would you think you can do it with the API if in fact you cannot access the manifest? (Not being able to access the manifest implies that it's someone else's app you're trying to alter, and if that app has already loaded a different version of ComCtrls there's no way you can replace it while the app is running.) There is a way to do it in code, but it's a lot more work than simply adding a manifest. – Ken White Sep 03 '16 at 15:00
-
3Yes you can. Look up isolation awareness. Your DLL will still need a manifest resource for this to work, but it will exist independently of the host program otherwise. [More information.](https://msdn.microsoft.com/en-us/library/windows/desktop/ms649781(v=vs.85).aspx#extensions) – andlabs Sep 03 '16 at 15:39
-
Yes @Ken has this wrong. You need a manifest resource and an activation context. – David Heffernan Sep 03 '16 at 15:45
-
@David: I stand corrected. Comment removed. – Ken White Sep 03 '16 at 15:47
-
I tried and it worked, thank you all. – rez Sep 03 '16 at 15:51
1 Answers
-1
Try this in your DLL:
#if defined(_M_IX86) #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") #elif defined(_M_X64) #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") #else #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") #endif

iFarbod
- 639
- 11
- 26
-
Not enough to add a manifest. And in any case it's probably more normal to link the manifest as a resource. What else is needed? And why did the asker accept this deficient answer? – David Heffernan Sep 03 '16 at 16:39
-
Because this solved his problem? He said he can inject a dll to that process, so doing this in a DLL that loads very late would solve the problem. – iFarbod Sep 03 '16 at 17:56
-
No it hasn't. Do you know about isolation and activation contexts? – David Heffernan Sep 03 '16 at 17:58