01-16-2004, 11:22 AM
function# hwnd opacity [color] ;;opacity: -255 to 255; <0 toggles; >255 makes it normal window
;Makes a window transparent (Win2000/XP).
;Returns 1 if the window was transparent previously.
;If color is used, this color will be 100% transparent.
;100% transparent parts are transparent to mouse messages.
;EXAMPLE
;WinTransparent(win -200)
def WS_EX_LAYERED 0x00080000
dll user32 #SetLayeredWindowAttributes hwnd crKey !bAlpha dwFlags
int e(GetWindowLong(hwnd GWL_EXSTYLE)) t(e&WS_EX_LAYERED!=0)
if(t and (opacity>255 or opacity<0))
,SetLayeredWindowAttributes(hwnd 0 255 2)
,SetWindowLong(hwnd GWL_EXSTYLE e~WS_EX_LAYERED)
else if(opacity<255)
,if(!t) SetWindowLong(hwnd GWL_EXSTYLE e|WS_EX_LAYERED)
,SetLayeredWindowAttributes(hwnd color iif(opacity<0 -opacity opacity) iif(getopt(nargs)>2 3 2))
ret tAbout your wish-list: as you like. I'll wait.
