DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: How to tell if new UI in WinXP is on

  1. #1
    Boris F. Guest

    How to tell if new UI in WinXP is on

    I am trying to tweak one of my apps to make it blend with the new UI look in
    WinXP and have a couple of questions.

    I am using a .manifest file and that seems to work ok but it looks like I
    need to programatically change the background color of some of my dialog
    boxes to use WindowBackground instead of ButtonFace. Is this right? If so,
    does anyone know how to tell (using an API call, I assume) if the new UI is
    on in WinXP? I am currently testing for WinXP (aka NT 5.1) using
    GetVersionEx but I just realized that it's possible to turn off the new UI.
    As a result, just testing for WinXP is not good enough, I want my app to
    look good regardless.

    Thanks in advance,
    Boris.



  2. #2
    Mattias Sjögren Guest

    Re: How to tell if new UI in WinXP is on

    Boris,

    >does anyone know how to tell (using an API call, I assume) if the new UI is on in WinXP?


    Declare Function IsAppThemed Lib "uxtheme.dll" () As Long

    Returns non-zero if it's turned on, zero if it's off.


    Note that this checks if the running app should use visual styles, not
    what the system default is. You can for example disable visual styles
    for a specific app.

    And since uxtheme.dll isn't available on pre-XP platforms, you should
    only call it when you know you're running on XP, or be prepared to
    catch errors.


    Mattias

    ====================================
    Mattias Sjögren - mattias @ mvps.org
    http://www.msjogren.net/dotnet/

    CodeHound - The Software Developer's Search Engine
    http://www.codehound.com

  3. #3
    Mattias Sjögren Guest

    Re: How to tell if new UI in WinXP is on

    Boris,

    >does anyone know how to tell (using an API call, I assume) if the new UI is on in WinXP?


    Declare Function IsAppThemed Lib "uxtheme.dll" () As Long

    Returns non-zero if it's turned on, zero if it's off.


    Note that this checks if the running app should use visual styles, not
    what the system default is. You can for example disable visual styles
    for a specific app.

    And since uxtheme.dll isn't available on pre-XP platforms, you should
    only call it when you know you're running on XP, or be prepared to
    catch errors.


    Mattias

    ====================================
    Mattias Sjögren - mattias @ mvps.org
    http://www.msjogren.net/dotnet/

    CodeHound - The Software Developer's Search Engine
    http://www.codehound.com

  4. #4
    Boris F. Guest

    Re: How to tell if new UI in WinXP is on

    Mattias,

    This is even better than I hoped for. Thanks!

    Boris.

    "Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message
    news:3b6f16be.320298124@news.devx.com...
    > Boris,
    >
    > >does anyone know how to tell (using an API call, I assume) if the new UI

    is on in WinXP?
    >
    > Declare Function IsAppThemed Lib "uxtheme.dll" () As Long
    >
    > Returns non-zero if it's turned on, zero if it's off.
    >
    >
    > Note that this checks if the running app should use visual styles, not
    > what the system default is. You can for example disable visual styles
    > for a specific app.
    >
    > And since uxtheme.dll isn't available on pre-XP platforms, you should
    > only call it when you know you're running on XP, or be prepared to
    > catch errors.
    >
    >
    > Mattias
    >
    > ====================================
    > Mattias Sjögren - mattias @ mvps.org
    > http://www.msjogren.net/dotnet/
    >
    > CodeHound - The Software Developer's Search Engine
    > http://www.codehound.com




  5. #5
    Boris F. Guest

    Re: How to tell if new UI in WinXP is on

    Mattias,

    This is even better than I hoped for. Thanks!

    Boris.

    "Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message
    news:3b6f16be.320298124@news.devx.com...
    > Boris,
    >
    > >does anyone know how to tell (using an API call, I assume) if the new UI

    is on in WinXP?
    >
    > Declare Function IsAppThemed Lib "uxtheme.dll" () As Long
    >
    > Returns non-zero if it's turned on, zero if it's off.
    >
    >
    > Note that this checks if the running app should use visual styles, not
    > what the system default is. You can for example disable visual styles
    > for a specific app.
    >
    > And since uxtheme.dll isn't available on pre-XP platforms, you should
    > only call it when you know you're running on XP, or be prepared to
    > catch errors.
    >
    >
    > Mattias
    >
    > ====================================
    > Mattias Sjögren - mattias @ mvps.org
    > http://www.msjogren.net/dotnet/
    >
    > CodeHound - The Software Developer's Search Engine
    > http://www.codehound.com




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center