CONST SWP_NOSIZE
= &H0001 'ignores cx and cy size parameters CONST SWP_NOMOVE
= &H0002 'ignores x and y position parameters CONST SWP_NOZORDER
= &H0004 'keeps z order and ignores hWndInsertAfter parameter CONST SWP_NOREDRAW
= &H0008 'does not redraw window changes CONST SWP_NOACTIVATE
= &H0010 'does not activate window CONST SWP_FRAMECHANGED
= &H0020 CONST SWP_SHOWWINDOW
= &H0040 CONST SWP_HIDEWINDOW
= &H0080 CONST SWP_NOCOPYBITS
= &H0100 CONST SWP_NOOWNERZORDER
= &H0200 CONST SWP_NOSENDCHANGING
= &H0400 CONST SWP_DRAWFRAME
= SWP_FRAMECHANGED
CONST SWP_NOREPOSITION
= SWP_NOOWNERZORDER
CONST SWP_DEFERERASE
= &H2000 CONST SWP_ASYNCWINDOWPOS
= &H4000 CONST HWND_TOP
= 0 'window at top of z order no focus CONST HWND_BOTTOM
= 1 'window at bottom of z order no focus CONST HWND_TOPMOST
= -1 'window above all others no focus unless active CONST HWND_NOTOPMOST
= -2 'window below active no focus 'sets a created window region
'FUNCTION GetWindowTextLengthA (BYVAL hwnd&)
'FUNCTION GetWindowTextA (BYVAL hwnd&, BYVAL lpString%&, BYVAL nMaxCount)
'creates a rectangular region
'creates an elliptical region
'creates a rectangular region with rounded corners
maxwindows = 200
DIM SHARED re&
(maxwindows
) 'you'll never have more than 200 windows open, eh?
'notification "WinIsTrans", "is now active."
t = 255
selected = 1
t = t + 1
t = t - 1
selected = selected + 1
selected = 1
selected = selected - 1
selected = maxr
applied(selected) = 1
applied(selected) = 0
hwnd& = GetForegroundWindow&
'check for invalid
repeat = 0
repeat = 1
re&(r) = re&(r + 1)
r = r + 1
r = 0
maxr = maxr - 1
repeat = 0
maxr = maxr - 1
r = 0
'check for existence
found = 0
found = 1
maxr = maxr + 1
resize
re&(maxr) = hwnd&
'apply transparency
SetWindowOpacity re&(r), t
SetWindowOpacity re&(r), 255
PRINT "Transparency: "; t
IF re&
(r
) = GetForegroundWindow&
THEN 'l = GetWindowTextLengthA(re&(r))
'PRINT l, GetWindowTextA(re&(r), 0, l)
SetWindowOpacity re&(r), 255
SUB notification
(title$
, text$
) com$
= com$
+ "[reflection.assembly]::loadwithpartialname(" + CHR$(34) + "System.Windows.Forms" + CHR$(34) + ") " + CHR$(13) com$
= com$
+ "[reflection.assembly]::loadwithpartialname(" + CHR$(34) + "System.Drawing" + CHR$(34) + ")" + CHR$(13) com$
= com$
+ "$notify = new-object system.windows.forms.notifyicon" + CHR$(13) com$
= com$
+ "$notify.icon = [System.Drawing.SystemIcons]::WinLogo" + CHR$(13) com$
= com$
+ "$notify.visible = $true" + CHR$(13) com$
= com$
+ "$notify.showballoontip(10," + CHR$(34) + title$
+ CHR$(34) + "," + CHR$(34) + text$
+ CHR$(34) + ",[system.windows.forms.tooltipicon]::None)"
SUB SetWindowOpacity
(hWnd&
, Level
) CONST WS_EX_LAYERED
= &H80000 Msg = GetWindowLong(hWnd, G)
Msg
= Msg
OR WS_EX_LAYERED
Crap = SetWindowLong(hWnd&, G, Msg)
Crap = SetLayeredWindowAttributes(hWnd&, 0, Level, LWA_ALPHA)