|
-
Sep 18th, 2007, 02:38 AM
#1
[RESOLVED] [2005] Applying Themes
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.
VB.NET MVP 2008 - Present
-
Sep 18th, 2007, 06:30 AM
#2
Re: [2005] Applying Themes
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 :
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
I think.
What is hThemeFile here, and how can I use this function to apply a theme through the use of my code ¿
VB.NET MVP 2008 - Present
-
Sep 18th, 2007, 06:35 AM
#3
Re: [2005] Applying Themes
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
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 18th, 2007, 06:40 AM
#4
Re: [2005] Applying Themes
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!
VB.NET MVP 2008 - Present
-
Sep 19th, 2007, 01:37 AM
#5
Re: [2005] Applying Themes
I did manage to find a way to apply the Luna visual Style :
Declarations :
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
Useage :
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
VB.NET MVP 2008 - Present
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|