Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Windows XP Manifest for .exe
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?

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;}\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="" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> </assembly> \f1\fs24\par
Try theme API functions, such as SetWindowTheme. I don't know is it possible.
Thanks Gintaras,
I found
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?

Don't know, need to read everything about changing window theme (MSDN), or find source code example.
You probably already saw this:
Can't get things to work using it though.
Need to use more theme functions. Load theme, etc. But I don't know is it possible if current theme is classic.
This also looks like it could be helpful.. (partly because they say what doesn't work! Big Grin

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

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

and tried to implement their code example

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:

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?
Macro Macro1756
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)