Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Detecting if Aero Glass theme is enabled?

Detecting if Aero Glass theme is enabled?

Detecting if Aero Glass theme is enabled?

Is there a way to detect if Aero glass themes are enabled on Vista/7?

It seems that windows reports sizes with GetWindowRect/DwmGetWindowAttribute incorrectly when glass themes are enabled (off by about 5 pixels).

I have been looking, and all suggestions say to check if composition is enabled, but that doesn't fully answer the question. It is possible to have composition enabled and still run either Windows Vista/7 Basic theme or Windows Classic theme. However, with these themes applied, GetWindowRect returns the true window size.

I need to offset my rect by 5 pixels *only* when the Glass themes are enabled.

RE: Detecting if Aero Glass theme is enabled?


I dumbly checking the return value for the function, not the parameter passed in that gets updated to reflect the status.

RE: Detecting if Aero Glass theme is enabled?

At a guess it is the border padding. You probably need to subtract the border padding x2 from the width and height or just border padding from x and y.

Have you tried changing the Border Padding to 10 to see if your 5 pixel offset still works? The default Border Padding is 5. This is hidden in Personalization/Window Color on Vista/7.

RE: Detecting if Aero Glass theme is enabled?

Indeed xwb you are correct.

I ended up checking if compositing was enabled, and checking the registry for the PaddedBorderWidth value and adjusting the offsets based on this value rather than setting a default and allowing the value to be changed manually.

Thanks for the tip.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close