473,405 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Theme question.

pnp
Hi all,
Could I use an external dll (that windows also use for it's themes) from
which my application could load it's graphics at runtime? Basically I wan't
to be able to select the styles for my application without changing the
windows general appearance.

Thanks,
Peter.
Nov 16 '05 #1
3 1517
Hi pnp,

I believe you mean by skins / style.

Well you can write something that can control which skins you one. One good example of a .net skin / styles you can use.

http://www.dotnetmagic.com/

I believe there is more.

Good Luck. Correct me if i am wrong.
--
Regards,
Chua Wen Ching :)
"pnp" wrote:
Hi all,
Could I use an external dll (that windows also use for it's themes) from
which my application could load it's graphics at runtime? Basically I wan't
to be able to select the styles for my application without changing the
windows general appearance.

Thanks,
Peter.

Nov 16 '05 #2
pnp
Thanks Chua on your so soon reply, but I wondered if I could use the windows
theme files...
"Chua Wen Ching" <ch************@nospam.hotmail.com> wrote in message
news:1D**********************************@microsof t.com...
Hi pnp,

I believe you mean by skins / style.

Well you can write something that can control which skins you one. One good example of a .net skin / styles you can use.
http://www.dotnetmagic.com/

I believe there is more.

Good Luck. Correct me if i am wrong.
--
Regards,
Chua Wen Ching :)
"pnp" wrote:
Hi all,
Could I use an external dll (that windows also use for it's themes) from which my application could load it's graphics at runtime? Basically I wan't to be able to select the styles for my application without changing the
windows general appearance.

Thanks,
Peter.

Nov 16 '05 #3
Hi pnp,

I never tried before. But you should look into uxtheme.dll. For more info how to call them, check this.

http://pinvoke.net

To get what is the current UI, at least i know how to do a bit.. ee.. actually learn it from codeproject.

I believe if you can do it if you know the right way to call it. Below is an example of getting what are the styles using for the current windows.

The themes are stored in the registery part of windows.

//references: http://www.thecodeproject.com/csharp/xptheme.asp
using System;
using System.Runtime.InteropServices;
using Microsoft.Win32;

namespace TestVisualStyles
{

class CheckThemeClass
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("Current Windows Theme = {0}", CurrentTheme());
Console.WriteLine("Windows Theme Active = {0}", IsThemeActive());
Console.WriteLine("Application Theme Active = {0}", IsAppThemed());
Console.ReadLine();

}

public enum Themes

{
WindowsClassic,
XPBlue,
XPGreen,
XPSilver
}

public static Themes CurrentTheme()
{
RegistryKey key =
Registry.CurrentUser.OpenSubKey(
@"Software\Microsoft\Windows\CurrentVersion\ThemeM anager");
if (key != null)
{
if ("1" == (string) key.GetValue("ThemeActive"))
{
string s = (string) key.GetValue("ColorName");
if (s != null)
{
if (String.Compare(s, "NormalColor", true) == 0)
return Themes.XPBlue;
if (String.Compare(s, "HomeStead", true) == 0)
return Themes.XPGreen;
if (String.Compare(s, "Metallic", true) == 0)
return Themes.XPSilver;
}
}
}
return Themes.WindowsClassic;

}

[DllImport("uxtheme.dll", SetLastError=true)]
public static extern bool IsThemeActive();

[DllImport("uxtheme.dll", SetLastError=true)]
public static extern bool IsAppThemed();
}
}

Hope it helps.
--
Regards,
Chua Wen Ching :)
"pnp" wrote:
Thanks Chua on your so soon reply, but I wondered if I could use the windows
theme files...
"Chua Wen Ching" <ch************@nospam.hotmail.com> wrote in message
news:1D**********************************@microsof t.com...
Hi pnp,

I believe you mean by skins / style.

Well you can write something that can control which skins you one. One

good example of a .net skin / styles you can use.

http://www.dotnetmagic.com/

I believe there is more.

Good Luck. Correct me if i am wrong.
--
Regards,
Chua Wen Ching :)
"pnp" wrote:
Hi all,
Could I use an external dll (that windows also use for it's themes) from which my application could load it's graphics at runtime? Basically I wan't to be able to select the styles for my application without changing the
windows general appearance.

Thanks,
Peter.


Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tom | last post by:
is it possible to create xp style theme with vs2003 on windows 2003 ? thanks Tom
0
by: Chenghui Li | last post by:
We have a problem with the Windows XP theme: We have a IDE which allows other developers to develop visual programs for their customers. Our IDE allow them to set font for window captions easyly...
1
by: Patrick.O.Ige | last post by:
Any ideas how to have users select different color for a website in ASP.NET? Any artticles would be appreciated!
1
by: kfc1976 | last post by:
Hi All, First of all, following are the facts 1) I've been trying to solve the following issue for the past 8 hours (Not Kidding) 2) If I can't find the answer, It will drive me completely crazy...
4
by: Ben | last post by:
Hi, I'm using images in my menu control. I have my menu setup based on this example: http://msdn2.microsoft.com/en-US/library/system.web.ui.webcontrols.menuitembinding.imageurlfield(VS.80).aspx ...
1
by: Joey | last post by:
Hello, I have tried to programmatically set the theme for my master page by putting code in a "Page_PreInit" fuction in the master page's code behind. However, when I set a breakpoint there and...
0
by: Brant Estes | last post by:
So try this. Create a new ASP.NET 2.0 website. Add a theme. Add a skin to the theme. In your web.config, add the <pages theme="MyTheme" styleSheetTheme="MyTheme" /tag under your system.web...
0
by: =?Utf-8?B?SGFyZHkgV2FuZw==?= | last post by:
Hi all, I am building a web site with theme support, under each theme's folder there are some images. Some of my images need to be skinned, I know I can build a skin file with line like ...
4
by: Ben | last post by:
Hi, I'm testing theme and dtylesheettheme properties of 'Page' like this: ('test' is a directory of App_Themes). Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.