[REBOL] Cool API Function (Carl?)
From: tbrownell::yahoo::com at: 2-Feb-2003 15:22
The Windows SetLayeredWindowsAttributes API call would be an important addition to any
/view GUI builder. Imagine funky /view skins like media player, winamp etc. All this
is possible but..
I can't get my head around this... I'm not all that familiar with c structs etc. and
trying to convert VB or C++ API sample code to Rebol is a bit confusing at times.
Burt wrote;
Well, I am not sure if everything else is correct about your code sample
but it appears you are missing a necessary step:
To have a dialog box come up as a translucent window, first create the
dialog as usual. Then, on WM_INITDIALOG
<http://msdn.microsoft.com/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/DialogBoxes/DialogBoxReference/DialogBoxMessages/WM_INITDIALOG.asp>,
set the layered bit of the window's extended style and call
SetLayeredWindowAttributes
<http://msdn.microsoft.com/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Windows/WindowReference/WindowFunctions/SetLayeredWindowAttributes.asp>
with the desired alpha value. The code might look like this:
// Set WS_EX_LAYERED on this window
SetWindowLong(hwnd,
GWL_EXSTYLE,
GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
// Make this window 70% alpha
SetLayeredWindowAttributes(hwnd, 0, (255 * 70) / 100, LWA_ALPHA);
(you can get to this doc by clicking the using layered windows link on
the API page you provided a link to (and then click the same link on
that page again to get to the above doc)
HTH,
Burt
Terry Brownell wrote: