Is it possible to only alpha-blend portions of a window? for example, just
the frame? Normally with SetLayeredWindowAttributes() the whole window has a
constant alpha value, not very useful. UpdateLayeredWindow() supports per
pixel alpha-blending, but that function too is not very useful for top level
windows with child controls, as you would need to re-direct all the painting
to an offscreen DC which is not very practical since you would have to
re-write large portions of code and for some controls, I dont have the code
obviously, so its not even possible.

WindowsBlinds seems to be able to do this as in this screen shot:
[url]http://www.stardock.com/products/windowblinds/wb5-3[/url][1].jpg

10-04-2007, 07:42 PM

unix

Re: Possible to ALPHA-BLEND window FRAME?

"Nobody" <nobody@cox.net> wrote in message
news:3JCtg.704$_M.509@fed1read04...[color=blue]
> Is it possible to only alpha-blend portions of a window? for example, just
> the frame? Normally with SetLayeredWindowAttributes() the whole window has
> a constant alpha value, not very useful. UpdateLayeredWindow() supports
> per pixel alpha-blending, but that function too is not very useful for top
> level windows with child controls, as you would need to re-direct all the
> painting to an offscreen DC which is not very practical since you would
> have to re-write large portions of code and for some controls, I dont have
> the code obviously, so its not even possible.
>
> WindowsBlinds seems to be able to do this as in this screen shot:
> [url]http://www.stardock.com/products/windowblinds/wb5-3[/url][1].jpg
>[/color]

As you say, UpdateLayeredWindow() is what has per-pixel alpha, but it does
not support child controls. But WindowBlinds only has the per-pixel alpha
blending in the frame surrounding the window. Maybe they create a separate
translucent window slightly bigger than the original and lay it behind the
original? So it looks like the original has the extra frame around it, but
it really is a new window peaking out behind it?

-- David

10-04-2007, 07:42 PM

unix

Re: Possible to ALPHA-BLEND window FRAME?

"David Ching" <dc@remove-this.dcsoft.com> wrote in message
news:12be1fico3s4ua9@news.supernews.com...[color=blue]
> "Nobody" <nobody@cox.net> wrote in message
> news:3JCtg.704$_M.509@fed1read04...[color=green]
>> Is it possible to only alpha-blend portions of a window? for example,
>> just the frame? Normally with SetLayeredWindowAttributes() the whole
>> window has a constant alpha value, not very useful. UpdateLayeredWindow()
>> supports per pixel alpha-blending, but that function too is not very
>> useful for top level windows with child controls, as you would need to
>> re-direct all the painting to an offscreen DC which is not very practical
>> since you would have to re-write large portions of code and for some
>> controls, I dont have the code obviously, so its not even possible.
>>
>> WindowsBlinds seems to be able to do this as in this screen shot:
>> [url]http://www.stardock.com/products/windowblinds/wb5-3[/url][1].jpg
>>[/color]
>
> As you say, UpdateLayeredWindow() is what has per-pixel alpha, but it does
> not support child controls. But WindowBlinds only has the per-pixel alpha
> blending in the frame surrounding the window. Maybe they create a
> separate translucent window slightly bigger than the original and lay it
> behind the original? So it looks like the original has the extra frame
> around it, but it really is a new window peaking out behind it?
>
> -- David
>[/color]

David,

I tried that already. There is an issue of keeping the window positions
syncronized, there is always a lag between the two when you move them around
especially in full window drag mode.

10-04-2007, 07:42 PM

unix

Re: Possible to ALPHA-BLEND window FRAME?

Nobody wrote:[color=blue]
> "David Ching" <dc@remove-this.dcsoft.com> wrote in message
> news:12be1fico3s4ua9@news.supernews.com...[color=green]
>> "Nobody" <nobody@cox.net> wrote in message
>> news:3JCtg.704$_M.509@fed1read04...[color=darkred]
>>> Is it possible to only alpha-blend portions of a window? for example,
>>> just the frame? Normally with SetLayeredWindowAttributes() the whole
>>> window has a constant alpha value, not very useful. UpdateLayeredWindow()
>>> supports per pixel alpha-blending, but that function too is not very
>>> useful for top level windows with child controls, as you would need to
>>> re-direct all the painting to an offscreen DC which is not very practical
>>> since you would have to re-write large portions of code and for some
>>> controls, I dont have the code obviously, so its not even possible.
>>>
>>> WindowsBlinds seems to be able to do this as in this screen shot:
>>> [url]http://www.stardock.com/products/windowblinds/wb5-3[/url][1].jpg
>>>[/color]
>> As you say, UpdateLayeredWindow() is what has per-pixel alpha, but it does
>> not support child controls. But WindowBlinds only has the per-pixel alpha
>> blending in the frame surrounding the window. Maybe they create a
>> separate translucent window slightly bigger than the original and lay it
>> behind the original? So it looks like the original has the extra frame
>> around it, but it really is a new window peaking out behind it?
>>
>> -- David
>>[/color]
>
> David,
>
> I tried that already. There is an issue of keeping the window positions
> syncronized, there is always a lag between the two when you move them around
> especially in full window drag mode.
>
>
>[/color]

There is no need for a 2nd window. You simply draw straight onto the
non-client area during a WM_NCPAINT event.

I think you can make the title bar and border bigger and smaller by
adjusting some system parameters first.

10-04-2007, 07:42 PM

unix

Re: Possible to ALPHA-BLEND window FRAME?

"Steve" <me@home.com> wrote in message
news:44b8a849$0$3511$ed2619ec@ptn-nntp-reader01.plus.net...[color=blue]
> Nobody wrote:[color=green]
>> "David Ching" <dc@remove-this.dcsoft.com> wrote in message
>> news:12be1fico3s4ua9@news.supernews.com...[color=darkred]
>>> "Nobody" <nobody@cox.net> wrote in message
>>> news:3JCtg.704$_M.509@fed1read04...
>>>> Is it possible to only alpha-blend portions of a window? for example,
>>>> just the frame? Normally with SetLayeredWindowAttributes() the whole
>>>> window has a constant alpha value, not very useful.
>>>> UpdateLayeredWindow() supports per pixel alpha-blending, but that
>>>> function too is not very useful for top level windows with child
>>>> controls, as you would need to re-direct all the painting to an
>>>> offscreen DC which is not very practical since you would have to
>>>> re-write large portions of code and for some controls, I dont have the
>>>> code obviously, so its not even possible.
>>>>
>>>> WindowsBlinds seems to be able to do this as in this screen shot:
>>>> [url]http://www.stardock.com/products/windowblinds/wb5-3[/url][1].jpg
>>>>
>>> As you say, UpdateLayeredWindow() is what has per-pixel alpha, but it
>>> does not support child controls. But WindowBlinds only has the
>>> per-pixel alpha blending in the frame surrounding the window. Maybe
>>> they create a separate translucent window slightly bigger than the
>>> original and lay it behind the original? So it looks like the original
>>> has the extra frame around it, but it really is a new window peaking out
>>> behind it?
>>>
>>> -- David
>>>[/color]
>>
>> David,
>>
>> I tried that already. There is an issue of keeping the window positions
>> syncronized, there is always a lag between the two when you move them
>> around especially in full window drag mode.
>>
>>
>>[/color]
>
> There is no need for a 2nd window. You simply draw straight onto the
> non-client area during a WM_NCPAINT event.
>
> I think you can make the title bar and border bigger and smaller by
> adjusting some system parameters first.[/color]

What do you mean? I know I can draw directly onto the frame during a
WM_NCPAINT, but as we already discussed in this thread,
SetLayeredWindowAttributes doesn't seem to support per-pixel alpha-blending,
only the source constant alpha blending, so if I specify alpha=128, the
whole window is going to be alphablended at 128 including the client area.
UpdatedLayeredWindow supports per pixel alpha-blending, but it doesn't
support child windows and it requires redirecting all painting to an
offscreen DC which may not even be possible. Making the title bar and border
bigger is easy through WM_NCCALCSIZE.