Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 658507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:56:28+00:00 2026-05-13T22:56:28+00:00

Is there any way to detect which windows XP theme is in use? I

  • 0

Is there any way to detect which windows XP theme is in use?

I suspect that there is no specific api call you can make, but you may be able to figure it out by checking something on some DOM element, ie feature detection.

Another question: does the classic theme even exist on windows vista or windows 7?

edit – this is my solution:

function isXpTheme() {
  var rgb;
  var map = { "rgb(212,208,200)" : false,
              "rgb(236,233,216)" : true };
  var $elem = $("<button>");
  $elem.css("backgroundColor", "ButtonFace");
  $("body").append($elem);
  var elem = $elem.get(0);
  if (document.defaultView && document.defaultView.getComputedStyle) {
    s = document.defaultView.getComputedStyle(elem, "");
    rgb = s && s.getPropertyValue("background-color");
  } else if (elem.currentStyle) {
    rgb = (function (el) { // get a rgb based color on IE
    var oRG =document.body.createTextRange();
    oRG.moveToElementText(el);
    var iClr=oRG.queryCommandValue("BackColor");
      return "rgb("+(iClr & 0xFF)+","+((iClr & 0xFF00)>>8)+","+
                  ((iClr & 0xFF0000)>>16)+")";
    })(elem);
  } else if (elem.style["backgroundColor"]) {
    rgb = elem.style["backgroundColor"];
  } else  {
    rgb = null;
  }
  $elem.remove();
  rgb = rgb.replace(/[ ]+/g,"")
  if(rgb){;
    return map[rgb];
  }
}

Next step is to figure out what this function returns on non-xp machines and/or figure out how to detect windows boxes. I have tested this in windows XP only, so vista and windows 7 might give different color values, it should be easy to add though.

Here is a demo page of this in action:

http://programmingdrunk.com/current-projects/isXpTheme/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:56:29+00:00Added an answer on May 13, 2026 at 10:56 pm

    Interesting question. The only thing that comes to mind is checking the size of a default button. It is styled differently in both themes, and I suppose it has a different size. This could be half-way reliable if you give the button a fixed text size.

    I’ll start the XP virtual machine and check whether the sizes actually differ.

    Update: They do differ.

    Google “I’m feeling lucky” button

    • in classic skin: 99 x 23.75 (sic!) pixels
    • in XP skin: 97 x 21.75 pixels

    A second, less reliable approach that comes to mind is giving an element a CSS system colour and then parsing the resulting computed colour. In classic mode, the ButtonFace property will have a specific shade of grey and I think a different one in the default skin. Again, would have to be tested.

    Update: they differ, too.

    ButtonFace CSS system colour

    • in Windows classic skin: #D4D0C8
    • in XP skin: #ECE9D8

    Obviously, both approaches will break if the user did any customization to colours and/or font sizes. The font size approach is the more reliable IMO, as there are fewer people playing around with that.

    You would, of course, have to have comparison tables for all Windows generations, as presumably, the values for classic and default skin will differ.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way that you can detect the resizeHandlers moment of completion? something
Is there any way to detect when an app is no longer active? That
Is there any way I can detect when a line break has been erased
Is there any way to detect which keys are currently pressed using Tkinter? I
Is there any way to detect whenever a copy operation starts in Windows Explorer.
Is there any way to detect to which direction the phone was shaked? For
Are there any C++ compile time macros which exists to detect which Windows OS
Is there any way to detect if a commercial is playing? I'm using player.observe(models.EVENT.CHANGE,
Is there any way to detect whether an android phone is in sleep mode
is there any way to detect device with xcode ? i mean when my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.