I am attempting to change the windows theme when my app starts and revert back when app closes (Uses custom messagebox sizes and scroll bar sizes)
I can do this quite easily with a couple of batch files, but the themes control panel displays
I would like to do this silently and prefer all in VFP
I found a script in VB. Can anyone help me convert to VFP?
This is as far as I got. I can't get it to work and don't know how to finish this off:
I can do this quite easily with a couple of batch files, but the themes control panel displays
I would like to do this silently and prefer all in VFP
I found a script in VB. Can anyone help me convert to VFP?
Code:
'SCRIPT CONTENTS:
'Define Variables :
Set ShellApp = CreateObject("Shell.Application")
Set WsShell = CreateObject("Wscript.Shell")
'
'Define path for your file theme (put it on a network share and don't forget to apply "read and execute" ACL for your Users)
Theme = "typeyoursharepath\typeyourtheme.theme"
Theme = """" + Theme + """"
'Open Display Properties Windows, Select your theme and apply with keep focus on Windows
ShellApp.ControlPanelItem cstr("desk.cpl desk,@Themes /Action:OpenTheme /file:" & Theme)
Wscript.Sleep 100
WsShell.SendKeys "{ENTER}"
While WsShell.AppActivate ("Display Properties") = TRUE
WsShell.AppActivate "Display Properties"
Wend
This is as far as I got. I can't get it to work and don't know how to finish this off:
Code:
&& Change theme in Windows XP or Windows 7 (silently)
&& Object: Automate without command prompt the application of a Windows Theme by a script
ShellApp = CreateObject("Shell.Application")
oControlPanel = shellApp.Namespace('cstr')
WsShell = CreateObject("Wscript.Shell")
Theme = "%windir%\Resources\Ease of Access Themes\classic.theme"
&& Open Display Properties Windows, Select your theme and apply with keep focus on Windows
ShellApp.oControlPanel("desk.cpl desk,@Themes /Action:OpenTheme /file:" & Theme)
Wscript.Sleep 100
WsShell.SendKeys "{ENTER}"
DO While WsShell.AppActivate ("Display Properties") = .t.
WsShell.AppActivate "Display Properties"
ENDDO