Click to See Complete Forum and Search --> : Gradient Transparent Shadow for Dialog


guitz
December 8th, 2005, 05:19 AM
Hi all,

I have a big big Problem, I never had before. The company I work for, wants a very special dialog. Imagine a Dialog which has rounded corner and a gradient shadow (6-7 different gray nuances). All this shadow must be transparent, but not the dilog itself.
.________
/.............\
|.............|\
|...Dialog..| |
|.............| |
\________/ |
\_________/

Well I can make the whole dialog transparent like:
LONG dwNewLong = GetWindowLong(m_hWnd, GWL_EXSTYLE) | WS_EX_LAYERED;
SetWindowLong(m_hWnd, GWL_EXSTYLE, dwNewLong);
SetLayeredWindowAttributes(m_hWnd, 0, byteSomeAlpha, LWA_ALPHA);
or I can make a color transparent like:
COLORREF crKey;
SetWindowLong(m_hWnd, GWL_EXSTYLE, dwNewLong);
SetLayeredWindowAttributes(m_hWnd, crKey, 0, LWA_COLORKEY);

But how could I make the whole shadow transparent without to affect the dilog ? The "rounded corners" schould be 100% transparent too.
Has anybody an idea? (Code)Example? Is this possible at all? (it must be, otherwise ... my job ...)


Thanks a lot in advance,
Emil

Mike Harnad
December 8th, 2005, 09:18 AM
Have you looked through the dialog section (http://www.codeguru.com/Cpp/W-D/dislog/) on CodeGuru? There are many articles there that may help you. In particular, this one (http://www.codeguru.com/Cpp/W-D/dislog/background/article.php/c5071/) may help get you started.

guitz
December 8th, 2005, 09:37 AM
Yes and I know the example, but it not really helped me.