🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3379

Update Layered Window

#3379
From: Liam Mullins
Date: Fri, 07 Jul 2006 21:20
44 lines
3325 bytes
(sorry for the cross post.. this was also posted in graphics. I'm ready 
for the flames)

Hello all,
this is actually my first post to the borland groups, but have been 
programming using borland c++ for a long time. I recently hit a black 
hole and am struggling to find a way out/around it.

The problem:
I am creating a skinned application using the UpdateLayeredWindow API 
and currently have a per-pixel rendered form that utilizes the alpha 
channel in a png image. If anyone is curious, I am creating a GDI+ 
instance and passing the image to the UpdateLayeredWindow without the 
need to pre-multiply the RGB channels with the alpha.

This is all fine and good, but I am now presented with the ever elusive 
problem of painting controls on the form. Yes I know the usual windows 
paradigm is no longer used (i.e. WM_PAINT) and that the image is passed 
through a DC to windows and Windows does the repainting. I have read 
every single document, post, forum and api reference that exists on the 
net. Microsoft (as mentioned in almost every related post) does a 
sub-par job of describing the per-pixel method of Layered Windows.

This skinning can obviously be done (i.e. Konfabulator, Window Blinds 
etc...) but I am very curious what methods they use for displaying 
controls. I have come up with two methods to solve drawing controls:

1) Create one composite image of every 'control' (which is actually just 
individual image) that is passed to updated layered window every time a 
state changes (i.e. mouse over, timed events etc..)
2) Create the layered window and overlay another window on top to 
simulate the existence of controls on the main form

These two options obviously have a LOT of draw backs. One of the main 
drawbacks of the second method is that I have also created controls with 
an alpha channel that display a gel-like button etc.. and to draw them 
correctly you obviously cannot use an overlayed form.. .the transparency 
only goes as deep as the parent window. Using the first option, I can 
only imagine, would smoke a processor in a matter of minutes. Speaking 
of which, why doesn't the rendering utilize the GPU like Mac's Quartz 
engine does?

My question is this: How does Konfabulator Window Blinds etc.. use the 
Layered window api to display controls?
Technical Details
Message-ID: <44aed058$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2de3880d4e43bf9a,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Fri, 07 Jul 2006 15:20:53 -0600
From: Liam Mullins <Liam@ralinventions.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.13) Gecko/20060414
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Update Layered Window
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 0627-3, 07/07/2006), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 71.214.47.83
Message-ID: <44aed058$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1152307288 71.214.47.83 (7 Jul 2006 14:21:28 -0700)
Lines: 44
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail