Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Windows XP Manifest for .exe
#1
Hi Gintaras,
I am running a dialog from exe on computers that are set to classic windows style buttons/themes. I was wondering if there was any way to apply a WindowsXP theme/style to a dialog (or perhaps other custom themes) that would run on these same computers. I think this would be via the manifest file. I tried adding a Windows XP manifest document that I found on the web (see below) but it didn't work. I think the buttons have to be flat and set to SYSTEM style but I couldn't figure out how to do that.
Any ideas?
Thanks,
STuart

Code:
Copy      Help
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Courier New;}{\f1\froman\fcharset0 Times New Roman;}{\f2\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\sb100\sa100\f0\fs20 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <description>Windows forms common control manifest</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> </assembly> \f1\fs24\par
\pard\f2\fs20\par
}
#2
Try theme API functions, such as SetWindowTheme. I don't know is it possible.
#3
Thanks Gintaras,
I found
Code:
Copy      Help
dll- uxtheme #SetWindowTheme hwnd @*pszSubAppName @*pszSubIdList

but don't really know how to set thevariables.
I started off with NoVisualStyles but don't know where to go from there.
Is this something that needs to be applied to each element of the dialog or something that can be applied to hDlg?

Stuart
#4
Don't know, need to read everything about changing window theme (MSDN), or find source code example.
#5
You probably already saw this: http://msdn.microsoft.com/en-us/library/...s.85).aspx
Can't get things to work using it though.
Thanks....
S
#6
Need to use more theme functions. Load theme, etc. But I don't know is it possible if current theme is classic.
#7
This also looks like it could be helpful.. (partly because they say what doesn't work! Big Grin
http://www.pcreview.co.uk/forums/selecti...95289.html

Don't know if it makes a difference but I'm using Windows Standard instead of Classic theme...

S
#8
I think I will try something easier and just have different dialog settings (size, bmp's etc) for different themes that might be running on the computer. I just need to find out how to programatically determine the theme.

I found this

http://blog.shekharpro.com/2010/12/get-c...theme.html

and tried to implement their code example

Code:
Copy      Help
public string GetTheme() {   string RegistryKey = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes";   string theme;   theme = (string) Registry.GetValue(RegistryKey, "CurrentTheme", string.Empty);   theme = theme.Split('\\').Last().Split('.').First().ToString();   return theme;

in QM like this:

Code:
Copy      Help
str CurrentTheme
str RegistryKey = "\Software\Microsoft\Windows\CurrentVersion\Themes"
_i = rget(CurrentTheme "CurrentTheme" RegistryKey "HKEY_CURRENT_USER")
out _i
out CurrentTheme
but fails to return anything.
Any thoughts?
Thanks,
S
#9
Macro Macro1756
Code:
Copy      Help
str CurrentTheme
str RegistryKey = "Software\Microsoft\Windows\CurrentVersion\Themes"
_i = rget(CurrentTheme "CurrentTheme" RegistryKey HKEY_CURRENT_USER)
out _i
out CurrentTheme


Forum Jump:


Users browsing this thread: 1 Guest(s)