Possible to detect Windows desktop style?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nobody@nowhere.net

    #16
    Re: Possible to detect Windows desktop style?

    On Sun, 04 May 2008 19:48:45 +0200, Lasse Reichstein Nielsen
    <lrn@hotpop.com wrote:
    >SAM <stephanemoriau x.NoAdmin@wanad oo.fr.invalidwr ites:
    >
    >(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
    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...

    Comment

    • nobody@nowhere.net

      #17
      Re: Possible to detect Windows desktop style?

      On Sat, 03 May 2008 02:02:11 GMT, "nobody@nowhere .net"
      <mygarbage2000@ hotmail.comwrot e:
      >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
      >programmatical ly either on the client (preferrable), or possibly in
      >asp.net from something like Request["ServerVariable s"] (not the best
      >thing but will work for this project). Would prefer cross-browser
      >compatibilit y, 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:hid den;" 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="javas cript" type="text/javascript">
      function body_onload()
      {
      var isIE=(window.Ac tiveXObject);
      var div=document.ge tElementById('s plash');
      if(isIE)div.sty le.height='142p x';
      try
      {
      div.scrollTop=1 ;
      }
      catch(err){;}//not sure if need try/catch - just in case
      var thing=div.scrol lTop;
      div.style.displ ay='none';
      if(thing==0)ale rt('Classic');
      else if(thing==1)ale rt('XP');
      }
      </script>
      </head>

      <body onload="body_on load();">
      <div id="splash" style="width:19 0px;height:139p x;overflow:auto ;"><img
      src="alertClass ic.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>



      Comment

      • rf

        #18
        Re: Possible to detect Windows desktop style?

        "nobody@nowhere .net" <mygarbage2000@ hotmail.comwrot e in
        news:b5ns149b7v d57oiis2agn7gu4 5pq6qmuh1@4ax.c om:
        On Sat, 03 May 2008 02:02:11 GMT, "nobody@nowhere .net"
        <mygarbage2000@ hotmail.comwrot e:
        >
        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.

        --
        Richard
        Killing all google groups posts
        The Usenet Improvement Project: http://improve-usenet.org

        Comment

        • nobody@nowhere.net

          #19
          Re: Possible to detect Windows desktop style?

          On Mon, 05 May 2008 03:02:08 GMT, rf <rf@x.invalidwr ote:
          >"nobody@nowher e.net" <mygarbage2000@ hotmail.comwrot e in
          >news:b5ns149b7 vd57oiis2agn7gu 45pq6qmuh1@4ax. com:
          >
          >On Sat, 03 May 2008 02:02:11 GMT, "nobody@nowhere .net"
          ><mygarbage2000 @hotmail.comwro te:
          >>
          >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.
          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

          Comment

          • rf

            #20
            Re: Possible to detect Windows desktop style?

            "nobody@nowhere .net" <mygarbage2000@ hotmail.comwrot e in
            news:jq1t14hdsb dvu0u7vrq7i0t01 ci2p2pkir@4ax.c om:
            On Mon, 05 May 2008 03:02:08 GMT, rf <rf@x.invalidwr ote:
            >
            >>"nobody@nowhe re.net" <mygarbage2000@ hotmail.comwrot e in
            >>news:b5ns149b 7vd57oiis2agn7g u45pq6qmuh1@4ax .com:
            >>
            >>On Sat, 03 May 2008 02:02:11 GMT, "nobody@nowhere .net"
            >><mygarbage200 0@hotmail.comwr ote:
            >>>
            >>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.
            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.
            >>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.
            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.
            >>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;
            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.

            --
            Richard
            Killing all google groups posts
            The Usenet Improvement Project: http://improve-usenet.org

            Comment

            • Jorge

              #21
              Re: Possible to detect Windows desktop style?

              On May 5, 6:25 am, "nob...@nowhere .net" <mygarbage2...@ hotmail.com>
              wrote:
              > Besides, I don't
              have a Mac to test it on Safari and have no plans to buy one
              Safari is a free download for Windows XP and Vista: http://apple.com/safari

              --Jorge.

              Comment

              • Andreas M.

                #22
                Re: Possible to detect Windows desktop style?

                Am 03.05.2008 04:02 nobody@nowhere. net 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).
                Not sure, whether this helps you.

                There is at least two Javascript frameworks/toolkits, that do something
                similare. The one has native WinXP and Vista skins, so I would assume
                the company behind it found some way to do this.


                (but it has a price...)

                The other one seems to be the Dojo toolkit (http://dojotoolkit.org)

                --
                Bye,
                Andreas M.

                Comment

                • Andreas M.

                  #23
                  Re: Possible to detect Windows desktop style?

                  Am 03.05.2008 04:02 nobody@nowhere. net 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
                  Also, I think for questions like these the following groups may be more
                  helpful. I am pretty sure, somewhere, deep in the MS API, there may be
                  some special functions, that can help you. If I remember correctly,
                  there is access to the Windows Themeing via ActiveX.

                  microsoft.publi c.inetexplorer. scripting
                  microsoft.publi c.scripting.jsc ript
                  microsoft.publi c.scripting.hos ting
                  microsoft.publi c.dotnet.langua ges.jscript
                  microsoft.publi c.scripting.wsh

                  --
                  Bye,
                  Andreas M.

                  Comment

                  • Gregor Kofler

                    #24
                    Re: Possible to detect Windows desktop style?

                    Andreas M. meinte:
                    Am 03.05.2008 04:02 nobody@nowhere. net 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).
                    >
                    Not sure, whether this helps you.
                    >
                    There is at least two Javascript frameworks/toolkits, that do something
                    similare. The one has native WinXP and Vista skins, so I would assume
                    the company behind it found some way to do this.
                    Sigh. No they don't. They can't detect my desktop design settings.
                    They've "build" elements mimicking form elements, but unfortunately,
                    these don't match my "Win 2000" settings. Even worse: Since they don't
                    use standard elements, their fake form elements are quite off.

                    Gregor



                    --
                    http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
                    http://web.gregorkofler.com ::: meine JS-Spielwiese
                    http://www.image2d.com ::: Bildagentur für den alpinen Raum

                    Comment

                    • nobody@nowhere.net

                      #25
                      Re: Possible to detect Windows desktop style?

                      On Mon, 05 May 2008 15:11:18 +0200, "Andreas M."
                      <foobar@invalid .invalidwrote:
                      >Am 03.05.2008 04:02 nobody@nowhere. net 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
                      >
                      >Also, I think for questions like these the following groups may be more
                      >helpful. I am pretty sure, somewhere, deep in the MS API, there may be
                      >some special functions, that can help you. If I remember correctly,
                      >there is access to the Windows Themeing via ActiveX.
                      >
                      >microsoft.publ ic.inetexplorer .scripting
                      >microsoft.publ ic.scripting.js cript
                      >microsoft.publ ic.scripting.ho sting
                      >microsoft.publ ic.dotnet.langu ages.jscript
                      >microsoft.publ ic.scripting.ws h
                      Thanks but...
                      Most corporate IT or users with at least a bit of brain disable
                      activex - and I quite understand why. ActiveX are not only security
                      threat, but also a source of all sort of instability, and also
                      bandwidth hoggers, and so on and on and on. In other words, for this
                      project it's not an option.
                      But thanks anyway
                      NNN

                      Comment

                      • nobody@nowhere.net

                        #26
                        Re: Possible to detect Windows desktop style?

                        On Mon, 05 May 2008 05:43:20 GMT, rf <rf@x.invalidwr ote:
                        >All places *you* have ever worked. I'll bet the advertising corporations
                        >have a few macks lying round.
                        >
                        >>>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.
                        >
                        >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.
                        Admittedly it was misleading. But then, for a mostly MS - IE only
                        guy, the phrase "Would be nice if this feature also worked in Firefox"
                        means cross-browser compatibility.
                        ;-)
                        >
                        >>>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;
                        >
                        >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.
                        You don't seem to be a plain vanilla corporate user. Think "bean
                        counter" or "sales rep" - these usually have no clue how to do it or
                        even if it's possible at all. I also happened to have been worked in
                        a few places where access to these facilities in Windows was disabled
                        for all but admins, and the only available screensaver was the
                        corporate logo.
                        >
                        >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.
                        This app is ment only for the users who intended to get there, paid
                        for access rights, and they'd expect the popup screen to appear in
                        response to their actions (after all, that'll be put in the user
                        manual). But this is something to think of before applying this
                        technique to sites open to general public.

                        Anyway the hack that I posted does the job, and most importantly was
                        approved by the boss. Not that I like to base the logic on some
                        display quirks, but there's nothing else to go by, and it seems to
                        work reliably on all target systems.

                        NNN


                        Comment

                        • nobody@nowhere.net

                          #27
                          Re: Possible to detect Windows desktop style?

                          On Sun, 4 May 2008 22:58:32 -0700 (PDT), Jorge
                          <jorge@jorgecha morro.comwrote:
                          >On May 5, 6:25 am, "nob...@nowhere .net" <mygarbage2...@ hotmail.com>
                          >wrote:
                          >> Besides, I don't
                          >have a Mac to test it on Safari and have no plans to buy one
                          >
                          >Safari is a free download for Windows XP and Vista: http://apple.com/safari
                          >
                          >--Jorge.
                          OMG, Steve Jobs finally made another piece of brilliant Apple
                          engineering available to us lowly slaves of evil Bill Gates!

                          Jokes aside, I will install anything Apple branded only if I really
                          _have to_ - or if somebody pays me real money to do so. I will never
                          forget how their piece of $h!t quicktime forced me to reinstall
                          Windows a while ago to get rid of it. I don't care if they simply
                          screwed up or ment to demonstrate how prone was Windows to BSOD and
                          how bad it was comparing to their then latest and greatest os9 - I'm
                          just not using their crap period.

                          NNN

                          Comment

                          • Thomas 'PointedEars' Lahn

                            #28
                            Re: Possible to detect Windows desktop style?

                            nobody@nowhere. net wrote:
                            [...] I will install anything Apple branded only if I really
                            _have to_ - or if somebody pays me real money to do so. I will never
                            forget how their piece of $h!t quicktime forced me to reinstall
                            Windows a while ago to get rid of it. I don't care if they simply
                            screwed up or ment to demonstrate how prone was Windows to BSOD and
                            how bad it was comparing to their then latest and greatest os9 -
                            You are not thinking clearly enough to realize that it might have been
                            your fault. QuickTime never broke anything on my Wintel platforms.
                            I'm just not using their crap period.
                            Not using a well-known user agent for everyday navigation is a personal
                            choice; not testing on a well-known user agent is a stupid choice.


                            PointedEars
                            --
                            realism: HTML 4.01 Strict
                            evangelism: XHTML 1.0 Strict
                            madness: XHTML 1.1 as application/xhtml+xml
                            -- Bjoern Hoehrmann

                            Comment

                            • The Magpie

                              #29
                              Re: Possible to detect Windows desktop style?

                              nobody@nowhere. net wrote:
                              On Mon, 05 May 2008 03:02:08 GMT, rf <rf@x.invalidwr ote:
                              >
                              >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.
                              >
                              Wrong. Seamonkey is *the* most commonly used - and it is not a
                              browser, it is the Javascript engine.
                              >
                              The spec calls for full functionality in IE and core functionality
                              in Firefox.
                              >
                              And Firefox uses Seamonkey. One hurdle fallen already.
                              >
                              Corporate users rearly even know how to customize the desktop;
                              besides they oftentime don't have rights to do so.
                              >
                              That was perhaps true of your particular clients yesterday. What about
                              tomorrow?
                              >
                              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.
                              >
                              So - according to your own rather silly spec - your solution already
                              doesn't work for some people. This *is* what we have been telling you.

                              Comment

                              • The Magpie

                                #30
                                Re: Possible to detect Windows desktop style?

                                nobody@nowhere. net wrote:
                                >
                                Thanks but...
                                Most corporate IT or users with at least a bit of brain disable
                                activex - and I quite understand why.
                                >
                                Indeed they do. And your "hack" relies upon it. That's another hurdle
                                where it fails.

                                Comment

                                Working...