I'm having difficulty applying themes to a listview control.
The MSDN description of SetWindowTheme is at (
http://msdn.microsoft.com/en-us/library/bb759827(VS.85).aspx).
It actually has an example of exactly what I want to do (make a listview look like Windows Explorer does in Vista), but when I adapt their example it it doesn't do anything. Their codes reads:
SetWindowTheme(hwndList, L"Explorer", NULL);
I replaced hwndList with a handle to my listview (generated by GetDlgItem()), and checked the return value. The function is supposed to return S_OK ( = 0) if it succeeds, and mine does, even though it doesn't actually change the theme. The listview has the simple pre-XP style.
I'm kind of new to Pelles, and C in general. MSDN says the function relies on Uxtheme.h, UxTheme.lib, and UxTheme.dll, so I added #include "Uxtheme.h" at the top of my code and put UxTheme.lib in the list of "Library and object files" under the "Linker" tab of Project Options. I have tried placing UxTheme.dll on the same page under "DLL files with delayed loading" but it didn't change anything. Is there a step I'm missing?
As a separate but related point, I notice that when I generate and test dialogs in the Resource Editor, they appear with the vista-like theme, but when I actually compile my code they appear with the older pre-XP styles. Is there a simple way that I can apply the newer styles to my entire program all at once?