|
-
Oct 9th, 2006, 12:13 PM
#1
Thread Starter
Member
[RESOLVED] Opening a Theme file
Shell "\Theme.theme", vbMinimizedFocus
This is what i currently have but this does not work for me, i'm sure that it cant be opened with shell so how can it be opened?
-
Oct 9th, 2006, 12:28 PM
#2
Re: Opening a Theme file
Hmm, to run the theme dialog under XP...
VB Code:
Option Explicit
Private Sub Form_Load()
Shell "rundll32.exe shell32.dll,Control_RunDLL DESK.cpl,,0" '0 designates the first tab
End Sub
Is that what your looking for?
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 
-
Oct 9th, 2006, 12:32 PM
#3
Re: Opening a Theme file
If you pass THEMES.CPL it wil also open up the theme dialog if that control panel icon exists under certain OS'.
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 
-
Oct 9th, 2006, 12:32 PM
#4
Thread Starter
Member
Re: Opening a Theme file
Not sure, i have a Theme file that i created in the "Display" panel, i need to open that when the application is run.
-
Oct 9th, 2006, 12:33 PM
#5
Fanatic Member
Re: Opening a Theme file
How about:
VB Code:
shell "control.exe desk.cpl,,2"
?
-
Oct 9th, 2006, 12:35 PM
#6
Thread Starter
Member
Re: Opening a Theme file
Yes but will it open the file i created? In fact its best if i tell you what i mean, if you go into the Display panel and then to Theme, click save as and save the file, thats the file i want to open. Its a file that contains information about the theme and where icons and skins are kept. Thats what i want to launch.
-
Oct 9th, 2006, 12:37 PM
#7
Re: Opening a Theme file
Try this ...
VB Code:
Option Explicit
Private Sub Form_Load()
Shell "rundll32.exe shell32.dll,Control_RunDLL C:\MyTheme.theme"
End Sub
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 
-
Oct 9th, 2006, 12:38 PM
#8
Fanatic Member
Re: Opening a Theme file
I think I just understood your post
you want to open theme files.
rundll32.exe shell32.dll,Control_RunDLL desk.cpl desk,@Themes /Action:OpenTheme /file:"%1"
Where "%1" is your theme file.
How to put it into VB:
VB Code:
Private Sub runtheme()
Dim strThemeFile As String
strThemeFile = InputBox("Type in the location of the theme file")
Shell ("rundll32.exe shell32.dll,Control_RunDLL desk.cpl desk,@Themes /Action:OpenTheme /file:" & Chr(34) & strThemeFile & Chr(34))
End Sub
Last edited by kregg; Oct 9th, 2006 at 12:51 PM.
-
Oct 9th, 2006, 12:52 PM
#9
Re: Opening a Theme file
Probably getting closer but doesnt pass the theme file. 
Running XP SP2.
I did get another error but fixed it by supplying a space between the "/Action: OpenTheme" part.
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 
-
Oct 9th, 2006, 12:55 PM
#10
Re: Opening a Theme file
Just noticed the edit kregg for the double quotes. 
VB Code:
Option Explicit
Private Sub Form_Load()
Shell "rundll32.exe shell32.dll,Control_RunDLL desk.cpl desk,@Themes /Action:OpenTheme /file:" & Chr(34) & "C:\MyTheme.theme" & Chr(34)
End Sub
Now since that only loads the theme in the dialog box I wonder if there is a way to apply the theme automatically.
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 
-
Oct 9th, 2006, 01:16 PM
#11
Re: Opening a Theme file
Now i think you've all understood the guy wrongly! or either i have understood him wrongly.!!
I think he doesnt want to dialogs and control panel stuff..
He just wants to run the .theme file... and this is what he has...
Shell "\Theme.theme", vbMinimizedFocus
...whis is wrong, because he hasnt got the full path to the THEME.theme file.
try n add the full path to your theme.theme file.
_____________________________________________________________________
----If this post has helped you. Please take time to Rate it.
----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.

-
Oct 9th, 2006, 01:19 PM
#12
Re: Opening a Theme file
No, you can not directly shell a .theme file with or without the complete path in VB.
Try it from the Run box too as the run box will only open the theme dialog box
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 
-
Oct 9th, 2006, 02:29 PM
#13
Fanatic Member
Re: Opening a Theme file
 Originally Posted by RobDog888
Now since that only loads the theme in the dialog box I wonder if there is a way to apply the theme automatically.
How about Hooking onto the window and then onto the OK button and send message to click on it? I have no idea on how to do it, but I'm going to do research.
-
Oct 9th, 2006, 03:40 PM
#14
Thread Starter
Member
Re: Opening a Theme file
I looked at all your posts, RobDog888 works best. So thanks.
-
Oct 10th, 2006, 04:55 AM
#15
Fanatic Member
Re: Opening a Theme file
If you're talking about Post 10, then that was another verison of post 8 
Please don't forget to set post as resolved by going to thread tools at the top and press resolve.
And If someone has helped you, it would be nice if you rate their posts *hint hint meee!
-
Oct 10th, 2006, 07:35 AM
#16
Fanatic Member
Re: Opening a Theme file
 Originally Posted by RobDog888
Now since that only loads the theme in the dialog box I wonder if there is a way to apply the theme automatically.
And just because I can't let down a gangsta Yoda,
VB Code:
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" ( _
ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const BM_CLICK = &HF5
Private Sub runtheme()
Dim strThemeFile As String
strThemeFile = InputBox("Type in the location of the theme file")
Shell ("rundll32.exe shell32.dll,Control_RunDLL desk.cpl desk,@Themes /Action:OpenTheme /file:" & Chr(34) & strThemeFile & Chr(34))
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
runtheme
Timer1.Interval = 2000
End Sub
Private Sub Timer1_Timer()
Dim lhWnd As Long
lhWnd = FindWindowEx(0&, 0&, "#32770", vbNullString)
lhWnd = FindWindowEx(lhWnd, 0&, "Button", "OK")
SendMessage lhWnd, BM_CLICK, 0&, 0&
End Sub
That oughta do it (see thread about closing the dialog box down)
-
Oct 10th, 2006, 10:50 AM
#17
Re: [RESOLVED] Opening a Theme file
I knew that was coming. I was meaning by automatically as in not displaying the dialog and applying the button click but rather an API or something that would just apply the theme file without loading it into the dialog. Good code though.
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 
-
Jan 3rd, 2007, 09:51 PM
#18
PowerPoster
Re: [RESOLVED] Opening a Theme file
Last edited by rory; Jan 3rd, 2007 at 11:10 PM.
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
|