Do you know that a layered window doesn't require anymore the use of region (at least you don't have to handle it yourself).
All you have to do is to use the %WS_EX_LAYERED extended style when you create the main window, and to specify the color that will be used as the transparent color (very often the RGB(255,0,255) magenta color).
Here is what to do:
' Window Extended Style
dwExStyle = %WS_EX_LAYERED
' Windows Style
dwStyle = %WS_POPUP
' Create The Window
MyTitle$ = "AeroGL"
hMain = CreateWindowEx(dwExStyle, _ ' Extended Style For The Window
zClass, _ ' Class Name
(MyTitle$), _ ' Window Title
dwStyle, _ ' Defined Window Style
x, y, _ ' Window Position
rc.nRight - rc.nLeft, _ ' Calculate Window Width
rc.nBottom - rc.nTop, _ ' Calculate Window Height
%NULL, _ ' No Parent Window
%NULL, _ ' No Menu
wc.hInstance, _ ' Instance
BYVAL %NULL) ' Dont Pass Anything To WM_CREATE
'
IF hMain THEN
IF (dwExStyle AND %WS_EX_LAYERED) THEN
CALL SetLayeredWindowAttributes(hMain, RGB(255,0,255), 255, %LWA_ALPHA OR %LWA_COLORKEY)
END IF
etc.
Added:
See the example there (http://www.jose.it-berater.org/smfforum/index.php?topic=2865.0)
...