LB Booster
General >> General Board >> Transparent window title bars.
http://lbb.conforums.com/index.cgi?board=general&action=display&num=1466387636

Transparent window title bars.
Post by Alincon on Jun 20th, 2016, 01:53am

Is it possible in LBB to make window title bars opaque, so that whatever is behind a window does not make information in the title bar hard to read?
Is this really a Windows question, not an LBB question?

r.m.
Re: Transparent window title bars.
Post by Richard Russell on Jun 20th, 2016, 08:59am

on Jun 20th, 2016, 01:53am, Alincon wrote:
Is it possible in LBB to make window title bars opaque, so that whatever is behind a window does not make information in the title bar hard to read?

I am assuming that you are asking about making a specific window's title bar opaque; disabling transparency for all windows is of course a simple Windows setting (Control Panel... Personalization... Window Color... Enable Transparency).

This code makes the non-client area of the specified window opaque:

Code:
    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 

Of course in Windows 8 and Windows 10 title bars are always opaque anyway, so this code only does something useful in Windows Vista and 7.

Richard.