0

I have an MFC GUI application having a listview control( Report view), which was developed in VC6.0. I ported the project to VS2010. Now I need to make the listview ctrl transparent. So I tried the LVS_EX_TRANSPARENTBKGND extended style. It showed a compilation error. So I set _WIN32_WINNT to 0x0601 in project settings to resolve the compilation error. However the list control is not becoming transparent.

I tried the LVS_EX_TRANSPARENTBKGND extended style in a newly created sample VS2010 MFC project and it works fine. However it is not working in the ported MFC project.

Looking forward for a solution!

aks
  • 302
  • 2
  • 10
  • Have you [enabled visual styles](https://msdn.microsoft.com/en-us/library/windows/desktop/bb773175.aspx) in your ported project? – IInspectable Sep 30 '16 at 16:21
  • Nothing done specifically :(. Which is the best way for enabling the visual styles? – aks Sep 30 '16 at 16:25
  • 1
    By embedding the appropriate manifest. This is conveniently done using a `#pragma comment` directive, as outlined in the link I posted in my previous comment. – IInspectable Sep 30 '16 at 16:35
  • I tried, adding the #pragma comment in the stdafx.h for creating the manifest and also called the SetWindowTheme() API for the list control in OnInitDialog(). However the result is same :( – aks Sep 30 '16 at 16:37
  • sorry, it was my mistake. Its working properly after embedding the manisfest using #pragma comment. The list control was in another dll. And I applied the #pragma comment modification the dll's stdafx.h only. I modified teh main application's stdafx.g with the #pragma comment and its wroking fine. Thank you. – aks Oct 03 '16 at 05:52
  • Adding visual styles support to a DLL requires a different procedure, that's also explained in the link I posted in my first comment. – IInspectable Oct 03 '16 at 06:33

0 Answers0