Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > JavaScript > Re: Possible to...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 17 of 37 Topic 35467 of 37133
Post > Topic >>

Re: Possible to detect Windows desktop style?

by "nobody@[EMAIL PROTECTED] " <mygarbage2000@[EMAIL PROTECTED] > May 5, 2008 at 02:09 AM

On Sat, 03 May 2008 02:02:11 GMT, "nobody@[EMAIL PROTECTED]
"
<mygarbage2000@[EMAIL PROTECTED]
> wrote:

>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 im****tant 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=do***ent.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>
 




 37 Posts in Topic:
Possible to detect Windows desktop style?
"nobody@[EMAIL PROTE  2008-05-03 02:02:11 
Re: Possible to detect Windows desktop style?
SAM <stephanemoriaux.N  2008-05-03 11:49:26 
Re: Possible to detect Windows desktop style?
"nobody@[EMAIL PROTE  2008-05-03 19:57:00 
Re: Possible to detect Windows desktop style?
Gregor Kofler <usenet@  2008-05-03 22:13:31 
Re: Possible to detect Windows desktop style?
"nobody@[EMAIL PROTE  2008-05-04 03:12:55 
Re: Possible to detect Windows desktop style?
rf <rf@[EMAIL PROTECTE  2008-05-04 03:43:12 
Re: Possible to detect Windows desktop style?
Gregor Kofler <usenet@  2008-05-04 13:55:56 
Re: Possible to detect Windows desktop style?
"Brett Merkey"   2008-05-04 08:22:08 
Re: Possible to detect Windows desktop style?
rf <rf@[EMAIL PROTECTE  2008-05-04 13:01:01 
Re: Possible to detect Windows desktop style?
SAM <stephanemoriaux.N  2008-05-04 15:55:50 
Re: Possible to detect Windows desktop style?
Lasse Reichstein Nielsen   2008-05-04 19:48:45 
Re: Possible to detect Windows desktop style?
"nobody@[EMAIL PROTE  2008-05-04 23:51:51 
Re: Possible to detect Windows desktop style?
Logos <tyler.style@[EM  2008-05-04 07:33:01 
Re: Possible to detect Windows desktop style?
SAM <stephanemoriaux.N  2008-05-04 17:09:34 
Re: Possible to detect Windows desktop style?
Gregor Kofler <usenet@  2008-05-04 17:18:03 
Re: Possible to detect Windows desktop style?
VK <schools_ring@[EMAI  2008-05-04 09:17:09 
Re: Possible to detect Windows desktop style?
"nobody@[EMAIL PROTE  2008-05-05 02:09:08 
Re: Possible to detect Windows desktop style?
rf <rf@[EMAIL PROTECTE  2008-05-05 03:02:08 
Re: Possible to detect Windows desktop style?
"nobody@[EMAIL PROTE  2008-05-05 04:25:04 
Re: Possible to detect Windows desktop style?
rf <rf@[EMAIL PROTECTE  2008-05-05 05:43:20 
Re: Possible to detect Windows desktop style?
"nobody@[EMAIL PROTE  2008-05-05 23:23:41 
Re: Possible to detect Windows desktop style?
The Magpie <usenet@[EM  2008-05-07 11:57:09 
Re: Possible to detect Windows desktop style?
Thomas 'PointedEars' Lahn  2008-05-07 23:55:44 
Re: Possible to detect Windows desktop style?
The Magpie <usenet@[EM  2008-05-10 00:35:16 
Re: Possible to detect Windows desktop style?
Thomas 'PointedEars' Lahn  2008-05-10 11:24:36 
Re: Possible to detect Windows desktop style?
The Magpie <usenet@[EM  2008-05-10 13:09:31 
Re: Possible to detect Windows desktop style?
Jorge <jorge@[EMAIL PR  2008-05-04 22:58:32 
Re: Possible to detect Windows desktop style?
"nobody@[EMAIL PROTE  2008-05-06 00:51:28 
Re: Possible to detect Windows desktop style?
Thomas 'PointedEars' Lahn  2008-05-06 20:46:55 
Re: Possible to detect Windows desktop style?
Jorge <jorge@[EMAIL PR  2008-05-07 05:36:32 
Re: Possible to detect Windows desktop style?
Jorge <jorge@[EMAIL PR  2008-05-07 05:47:37 
Re: Possible to detect Windows desktop style?
"Andreas M." &l  2008-05-05 15:01:26 
Re: Possible to detect Windows desktop style?
Gregor Kofler <usenet@  2008-05-05 15:12:23 
Re: Possible to detect Windows desktop style?
"Andreas M." &l  2008-05-05 15:11:18 
Re: Possible to detect Windows desktop style?
"nobody@[EMAIL PROTE  2008-05-05 23:02:03 
Re: Possible to detect Windows desktop style?
The Magpie <usenet@[EM  2008-05-07 11:59:14 
Re: Possible to detect Windows desktop style?
"Andreas M." &l  2008-06-03 02:42:40 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 2:03:40 CDT 2008.