Hello guys!
I have an application that must be able to list & change the windows themes, basically similar to what Desktop properties does. What function in uxtheme.dll must I use to achieve this ¿
Thanx for any help.
Printable View
Hello guys!
I have an application that must be able to list & change the windows themes, basically similar to what Desktop properties does. What function in uxtheme.dll must I use to achieve this ¿
Thanx for any help.
An update.
It seems as if I can either use the ApplyTheme or SetWindowTheme ( not 100 % sure about that one ).
The problem is that if I were to use them, I'll need some sort of handle to a theme file. Here is the ApplyTheme API declaration :
I think.Code:<DllImport("uxtheme")> _
Protected Shared Function SetWindowTheme(ByVal hWnd As IntPtr, ByVal pszSubAppName As String, ByVal pszSubIdList As String) As Integer
End Function
<DllImportAttribute("uxtheme")> _
Protected Shared Function ApplyTheme(ByVal hThemeFile As IntPtr, ByVal something As String, ByVal hWnd As IntPtr) As Integer
End Function
What is hThemeFile here, and how can I use this function to apply a theme through the use of my code ¿
I have some threads on visual styles. They are not fun but not impossible either. Its been a while but I it was something to do with theme parts which get applied to your controls parts. Sorry cant be of more help. Going to bed. Its 4:30 am :(
Hey Rob!
Thanx, I'll have a look, and see what goes for what.
I just want to kick myself for always trying to do "the impossible"!
Sleep well!
I did manage to find a way to apply the Luna visual Style :
Declarations :
Useage :Code:<DllImport("UxTheme.DLL", BestFitMapping:=False, CallingConvention:=CallingConvention.Winapi, CharSet:=CharSet.Unicode, EntryPoint:="#65")> _
Shared Function SetSystemVisualStyle(ByVal pszFilename As String, ByVal pszColor As String, ByVal pszSize As String, ByVal dwReserved As Integer) As Integer
End Function
Code:Private Sub btnSetTheme_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSetTheme.Click
SetSystemVisualStyle("C:\WINDOWS\resources\Themes\Luna\Luna.msstyles", "Metallic", "NormalSize", 0)
End Sub