Possible to detect Windows desktop style?

N

nobody

I need to pop up a modal JS-based dialog (for some reason can't use
popup window, much less so showModalDialog()), and I'd like to imitate
the system popup titlebar according to user's desktop settings
(classic, XP, Vista). No big deal to make it work, but how do I know
the style to display? Any chance to figure out these settings
programmatically either on the client (preferrable), or possibly in
asp.net from something like Request["ServerVariables"] (not the best
thing but will work for this project). Would prefer cross-browser
compatibility, but can use IE-specific solution (sorry, no client side
activeX may be used, just plain JS/DOM/DHTML). Asking the user to
manually select visual preferences is not an option.

Thanks

NNN
 
S

SAM

(e-mail address removed) a écrit :
I need to pop up a modal JS-based dialog (for some reason can't use
popup window, much less so showModalDialog()), and I'd like to imitate
the system popup titlebar according to user's desktop settings
(classic, XP, Vista).

and not Mac OS ? 9 or 10
No big deal to make it work,

Really ? fonts, colors, and so on, are probably fixed by the PC user
Where to find those settings (where and how are they saved)
but how do I know
the style to display? Any chance to figure out these settings
programmatically either on the client (preferrable), or possibly in
asp.net from something like Request["ServerVariables"] (not the best
thing but will work for this project). Would prefer cross-browser
compatibility, but can use IE-specific solution (sorry, no client side
activeX may be used, just plain JS/DOM/DHTML). Asking the user to
manually select visual preferences is not an option.

Dot not understand the need to display a desktop window that will be
different of navigator's one (and more: navigators can be skinned)?
It appears to me to be destabilizing

In XP or Vista wouldn't it be possible to choice :
- OS presentation
- Internet presentation
adding this choice to your project
 
N

nobody

(e-mail address removed) a écrit :

and not Mac OS ? 9 or 10
Mac users are not a targeted user base. The spec calls for full
functionality on IE6+, at least core functionality on FireFox, and
doesn't care about other browsers, including but not limited to
Safari. If Mac users really want to use the proposed site, they'll
have to run it on FireFox or IE/Windows emulation - or get a standard
PC.
Really ? fonts, colors, and so on, are probably fixed by the PC user
Where to find those settings (where and how are they saved)
For now, we are targeting only default XP, Vista, and Classic themes.
but how do I know
the style to display? Any chance to figure out these settings
programmatically either on the client (preferrable), or possibly in
asp.net from something like Request["ServerVariables"] (not the best
thing but will work for this project). Would prefer cross-browser
compatibility, but can use IE-specific solution (sorry, no client side
activeX may be used, just plain JS/DOM/DHTML). Asking the user to
manually select visual preferences is not an option.

Dot not understand the need to display a desktop window that will be
different of navigator's one (and more: navigators can be skinned)?
It appears to me to be destabilizing

In XP or Vista wouldn't it be possible to choice :
- OS presentation
- Internet presentation
adding this choice to your project
This is not in the spec. Even more so, the spec calls for the
interface _not_ to be user-customizable, and to be as close to the
standard Windows interface as it can get. Don't you get the
difference between programming for fun, and development of business
app that involves things like spec, deadline, etc.?

NNN
 
G

Gregor Kofler

(e-mail address removed) meinte:
This is not in the spec. Even more so, the spec calls for the
interface _not_ to be user-customizable, and to be as close to the
standard Windows interface as it can get. Don't you get the
difference between programming for fun, and development of business
app that involves things like spec, deadline, etc.?

Don't you get the idea, that there is a fundamental difference between
HTML documents shown in browsers and the UI of an OS? And don't babble
something about "specs" - it's your job to make things clear when
accepting those specs and tell the customer, that a 100%-something
integration won't be possible.

Anyway, since it is narrowed down to "standard or classic or Vista"
layout: Write the according CSS, have the user choose between the style
sheets mimicking the desktop appearance, store it in a cookie. Stop
whining. You can even use Opera or Firefox or another browser then. As
long as you don't have any form elements which are hard to impossible to
skin.

Gregor
 
N

nobody

(e-mail address removed) meinte:


Don't you get the idea, that there is a fundamental difference between
HTML documents shown in browsers and the UI of an OS? And don't babble
something about "specs" - it's your job to make things clear when
accepting those specs and tell the customer, that a 100%-something
integration won't be possible.
I do get the idea. However I'm not in the position to tell it to
non-techie customers, and I happen to have a boss that wouldn't take
"no" for an answer unless I prove "beyond any reasonable doubt" that I
really tried to solve it.
Anyway, since it is narrowed down to "standard or classic or Vista"
layout: Write the according CSS,
already done - that's the easy part
have the user choose between the style
sheets mimicking the desktop appearance,
This is what I can't do. It's not a technical decision, it's a
business decision, and it was not mine. If there's a way to find out
the setting by the means of coding, please let me know, I'll greatly
appreciate it. Or just confirm what I've suspected all along: it
can't be done.
store it in a cookie. Stop
whining. You can even use Opera or Firefox or another browser then. As
long as you don't have any form elements which are hard to impossible to
skin.

Gregor

Believe me or not, I'm not a novice in the business (almost 10 years
in Web dev, MCAD and stuff). Usually I've found the vay to solve
things without asking for help. But this time I have neither the
solution nor a solid proof that it's not doable the way it was
requested. If you have a direct answer to the question, it'd be
greatly appreciated. If you have nothing to say but personal insults,
please just stay away from the thread.

NNN
 
R

rf

If there's a way to find out
the setting by the means of coding, please let me know, I'll greatly
appreciate it. Or just confirm what I've suspected all along: it
can't be done.

It can't be done.
 
G

Gregor Kofler

(e-mail address removed) meinte:
This is what I can't do. It's not a technical decision, it's a
business decision, and it was not mine.

So your boss is promising things to customers without consulting his
developers first, plus having no clue about feasibility and technical
issues? Nice.
If there's a way to find out
the setting by the means of coding, please let me know, I'll greatly
appreciate it. Or just confirm what I've suspected all along: it
can't be done.

It can't be done.
If you have a direct answer to the question, it'd be
greatly appreciated. If you have nothing to say but personal insults,
please just stay away from the thread.

Well, that's usenet. Anything else would be support you most likely have
to pay for.

Gregor
 
S

SAM

(e-mail address removed) a écrit :
On Sat, 03 May 2008 11:49:26 +0200, SAM
(snip) something telling you only need to detect user's Win version
right ?
Mac users will have to do with it :-(
(I hate Windows and Windows hates me)
This is not in the spec. Even more so, the spec calls for the
interface _not_ to be user-customizable, and to be as close to the
standard Windows interface as it can get. Don't you get the
difference between programming for fun, and development of business
app that involves things like spec, deadline, etc.?

Developing for business ? Really ? Why won't you realize a real *.exe ?

Found that :
<http://jsbrwsniff.sourceforge.net/index.html>

HTH
 
L

Logos

I need to pop up a modal JS-based dialog (for some reason can't use
popup window, much less so showModalDialog()), and I'd like to imitate
the system popup titlebar according to user's desktop settings
(classic, XP, Vista). No big deal to make it work, but how do I know
the style to display? Any chance to figure out these settings
programmatically either on the client (preferrable), or possibly in
asp.net from something like Request["ServerVariables"] (not the best
thing but will work for this project). Would prefer cross-browser
compatibility, but can use IE-specific solution (sorry, no client side
activeX may be used, just plain JS/DOM/DHTML). Asking the user to
manually select visual preferences is not an option.

Thanks

NNN

You are correct - it can't be done. Their is no way for a browser to
access those system settings. You can get things like screen size and
so forth, but that is all.

Tyler
 
S

SAM

Logos a écrit :
I need to pop up a modal JS-based dialog (for some reason can't use
popup window, much less so showModalDialog()), and I'd like to imitate
the system popup titlebar according to user's desktop settings
(classic, XP, Vista). No big deal to make it work, but how do I know
the style to display? Any chance to figure out these settings
programmatically either on the client (preferrable), or possibly in
asp.net from something like Request["ServerVariables"] (not the best
thing but will work for this project). Would prefer cross-browser
compatibility, but can use IE-specific solution (sorry, no client side
activeX may be used, just plain JS/DOM/DHTML). Asking the user to
manually select visual preferences is not an option.

Thanks

NNN

You are correct - it can't be done. Their is no way for a browser to
access those system settings. You can get things like screen size and
so forth, but that is all.

in address bar :

javascript:w=window.open("");for(i in
navigator)w.document.write("<li>"+i+" = "+eval('navigator.'+i));

I obtain with my Mac :
Firefox :
appVersion = 5.0 (Macintosh; fr)
platform = MacIntel
oscpu = Intel Mac OS X
Safari :
appVersion = 5.0 (Macintosh; U; Intel Mac OS X; fr) ...etc
platform = MacIntel

I obtain with my Win XP and IE6 :
appMinorVersion = ;SP2;
cpuClass = x86
platform = Win32
opsProfile =
userProfile =
systemLanguage = fr
userLanguage = fr

Wouldn't all that be enough to detect the OS ?
 
G

Gregor Kofler

SAM meinte:
Wouldn't all that be enough to detect the OS ?

Detecting the OS is easy (both on client and server side; not really
reliable). Anyway, the OP wants to know the UI design settings of the
OS. And that's impossible.

Gregor
 
V

VK

I need to pop up a modal JS-based dialog (for some reason can't use
popup window, much less so showModalDialog()), and I'd like to imitate
the system popup titlebar according to user's desktop settings
(classic, XP, Vista). No big deal to make it work, but how do I know
the style to display? Any chance to figure out these settings
programmatically either on the client (preferrable), or possibly in
asp.net from something like Request["ServerVariables"] (not the best
thing but will work for this project). Would prefer cross-browser
compatibility, but can use IE-specific solution

CSS 2.x defines system color names besides explicit colors:
http://www.w3.org/TR/CSS21/ui.html#system-colors

It is marked as deprecated for CSS 3.x - but anyone ever implemented
it, it should be still here. I believe it worked for me for IE6 but I
never tested it intensively. You may try that.
 
L

Lasse Reichstein Nielsen

SAM said:
(snip) something telling you only need to detect user's Win version
right ?

Nope. I run Windows XP, but the first thing I turn off is themes,
so I have less than the "classic theme".

/L
 
N

nobody

Nope. I run Windows XP, but the first thing I turn off is themes,
so I have less than the "classic theme".

/L

You are not alone - the first thing I do with any PC with XP or Vista
I have to work on is setting it to "classic modified", no visual
effects whatsoever. And I know quite a few folks that are just as
paranoid about it. If only all the users were like that...
 
N

nobody

I need to pop up a modal JS-based dialog (for some reason can't use
popup window, much less so showModalDialog()), and I'd like to imitate
the system popup titlebar according to user's desktop settings
(classic, XP, Vista). No big deal to make it work, but how do I know
the style to display? Any chance to figure out these settings
programmatically either on the client (preferrable), or possibly in
asp.net from something like Request["ServerVariables"] (not the best
thing but will work for this project). Would prefer cross-browser
compatibility, but can use IE-specific solution (sorry, no client side
activeX may be used, just plain JS/DOM/DHTML). Asking the user to
manually select visual preferences is not an option.

Thanks

NNN

OK guys here's the hack that seems to differ between XP and classic
style on XP box. Tested with both IE and FF. Don't have Win2k and
Vista boxes to test - have to wait until get to the office, but sure
(well, almost) Vista will work similar to XP, so the scrollTop in
combination with client OS will give the needed result. If I'm not
mistaking, win2k is Classic by default. Wanna see how it's different?
remove "visibility:hidden;" from div style and see for yourself. It
is important that the img size is exactly 197x119 to work with the div
sized 190x139px; for any other image size the div needs to be resized
the same number of px as the img. Please note - this is 'quick and
dirty', surely not production quality but good enough as a concept
proof.
;)

Any comments will be greatly appreciated.

NNN



<html>
<head>
<script language="javascript" type="text/javascript">
function body_onload()
{
var isIE=(window.ActiveXObject);
var div=document.getElementById('splash');
if(isIE)div.style.height='142px';
try
{
div.scrollTop=1;
}
catch(err){;}//not sure if need try/catch - just in case
var thing=div.scrollTop;
div.style.display='none';
if(thing==0)alert('Classic');
else if(thing==1)alert('XP');
}
</script>
</head>

<body onload="body_onload();">
<div id="splash" style="width:190px;height:139px;overflow:auto;"><img
src="alertClassic.jpg" style="border:#dddddd 2px solid" height="119px"
width="197px"/> </div><!--picked the first image I had in the work
folder, 197x119 px. If you want to use any other image, size the div
accordingly /-->
</body>
</html>
 
R

rf

On Sat, 03 May 2008 02:02:11 GMT, "(e-mail address removed)"

OK guys here's the hack that seems to differ between XP and classic
style on XP box. Tested with both IE and FF.

Seamonkey gets it wrong.
Safari gets it wrong.
I wonder how many other browsers get it wrong.

What you persue will fail if I simply change my colour scheme. Your
"dialog" will *not* look like the rest of the stuff on my desktop.
 
N

nobody

Seamonkey gets it wrong.
Safari gets it wrong.
These browsers extremely rearly, if ever, are used in corporate
environment - and corp is the targeted audience. Besides, I don't
have a Mac to test it on Safari and have no plans to buy one - all
places where I've ever worked were Microsoft shops.
I wonder how many other browsers get it wrong.
The spec calls for full functionality in IE and core functionality in
Firefox. No other browser mentioned.
What you persue will fail if I simply change my colour scheme. Your
"dialog" will *not* look like the rest of the stuff on my desktop.
Corporate users rearly even know how to customize the desktop; besides
they oftentime don't have rights to do so. The ones who know and have
sufficient rights - they most of the time pick Classic desktop, no
color scheme, font, etc. modifications. Anyway, if somebody has a
preference for some crazy mix of pink and green - that's none of my
business, they'll get a standard XP or Classic popup.

NNN
 
R

rf

These browsers extremely rearly, if ever, are used in corporate
environment

How do you know?
have a Mac to test it on Safari and have no plans to buy one - all
places where I've ever worked were Microsoft shops.

All places *you* have ever worked. I'll bet the advertising corporations
have a few macks lying round.
The spec calls for full functionality in IE and core functionality in
Firefox. No other browser mentioned.

Where in your original post did you say this. The only mention I see
about browsers is "Would prefer cross browser compatility" and I have
shown your solution the be not cross browser compatible.
Corporate users rearly even know how to customize the desktop;

How do you know that? I have known since Windows 3.1 how to do that and I
was a corporate user at that time.
Anyway, if somebody has a
preference for some crazy mix of pink and green - that's none of my
business, they'll get a standard XP or Classic popup.

So why bother to distinguish between classic or not? Give them a dialog
that looks like the site, not the underlying operating system. Every time
I see something that looks like my operating system I instantly dismiss
it as advertising.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top