Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
window trans ?
#2
Code:
Copy      Help
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 t

About your wish-list: as you like. I'll wait.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)