User Tools

Site Tools


making_20the_20title_20bar_20opaque_20_28lbb_29

Making the title bar opaque (LBB)

by Richard Russell, June 2016

In Windows Vista and Windows 7, by default, the title bar and other non-client areas of a window are translucent, and the background shows through to a degree (albeit blurred). This Aero Glass effect can be quite attractive, and many people were upset when it was removed in Windows 8 and Windows 10, but occasionally it can make it harder to read the window's title text.

If you prefer all window titles and borders to be opaque you can change the setting in 'Control Panel… Personalization… Window Color… Enable Transparency' but you may instead wish just to affect your own program. The code listed below disables transparency for the specified window:

      nomainwin
      open "Opaque Window Title" for window as #w
      #w "trapclose quit"
 
      struct policy, n as long
      l = len(policy.struct)
      policy.n.struct = 1 ' disable transparency
 
      hw = hwnd(#w)
      open "dwmapi.dll" for dll as #dwm
      calldll #dwm, "DwmSetWindowAttribute", hw as ulong, 2 as long, _
                      policy as struct, l as long, r as long
 
      wait
 
  sub quit h$
      close #dwm
      close #h$
      end
  end sub 
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
making_20the_20title_20bar_20opaque_20_28lbb_29.txt · Last modified: 2024/01/05 00:22 by 127.0.0.1