| View previous topic :: View next topic |
| Author |
Message |
bbelcher Contributor

Joined: 30 Jul 2002 Posts: 172
|
Posted: Fri Jul 01, 2005 2:04 pm Post subject: JustgreatWindow reversal? |
|
|
I would like to reverse the "JustgreatWindow" transparency function that codescript put together. What I want is to make a window transparent like the "JustgreatWindow" does then make it normal again.
| Code: |
#----------------------------------------------------------------------------#
#Calling a Non-VDs dll; Just Great window VDS 5+Win2k+-----------------------#
#----------------------------------------------------------------------------#
#Author: CodeScript---------------------------------------------------------#
#----------------------------------------------------------------------------#
#Copyright:You can remove this info while(if) Using this code in your app.---#
#----------------------------------------------------------------------------#
REM USE AT YOUR OWN RISK !!
REM MISTAKES MADE WHILE USING A NON VDS DLL MAY INVITE A VDS/SYSTEM CRASH.
REM SAVE YOUR WORK BEFORE RUNNING/DEBUGGING THIS SCRIPT.
REM IF ANY TIME FORM BECOMES INVISIBLE PRESS F6 TO STOP THE DEMO
Title OOOPS !
REM CHECK THE WINDOWS VERSION AND DIASALLOW THOSE BELOW WIN 2K.
%%WINDOWVERSION = @substr(@SYSINFO(WINVER),1,1)
If @greater(5,%%WINDOWVERSION)
warn SORRY ! This Script uses Transparent windows supported only on Win2000 and above !
exit
end
%%ico = @windir()\explorer.exe
%%taskclick = 0
Title Just Great window Demo by CodeScript
DIALOG CREATE,Just Great window,438,595,195,121,CLASS MYWIN,ONTOP,SNAP,NOTITLE,
REM YOU CAN CHNAGE THE COLOR OF STYLE TO CHANGE THE FONT COLOR
DIALOG ADD,STYLE,STYLE1,,,,,FF0080
Dialog add,TASKICON,TaskIcon,%%ico,Just Great window Demo by CodeScript
REM AVOID EDITING THE USER32.DLL DECLARATIONS AND CONSTANTS TO AVOID CRASH.
LOADLIB USER32
%H = @strdel(@WINEXISTS(#MYWIN),1,1)
IF %H
%I = @lib(user32,GetWindowLongA,INT:,%H,-20)
%I = @lib(user32,SetWindowLongA,INT:,%H,-20,$80000)
%I = @lib(user32,SetLayeredWindowAttributes,INT:,%H,0,160,$2)
%I = @lib(user32,SetWindowLongA,INT:,%H,-20,-4000)
ELSE
ERROR -1
end
FREELIB USER32
REM CHANGING THE COLOR OF GRADIENT CHANGES THE BACKGROUND
DIALOG ADD,GRADIENT,GRADIENT1,-1,0,195,123,F2EFEA,WHITE,,BOTTOMTOTOP
DIALOG ADD,TEXT,TEXT1,13,79,,,Breaking news !!,,STYLE1
DIALOG ADD,TEXT,TEXT2,34,88,,,Sticky notes !!,,STYLE1
DIALOG ADD,TEXT,TEXT4,96,10,,,Sky is the limit for Ur Imagination !!,,STYLE1
DIALOG ADD,TEXT,TEXT3,55,77,,,Program Status !!,,STYLE1
DIALOG ADD,TEXT,TEXT5,76,81,,,Media Player !!,,STYLE1
DIALOG SHOW
REM %I = @lib(user32,SetWindowLongA,INT:,%H,-20,-4000)
REM 1. -1 to get a rounded frame around the window.
REM 2. -2 to get a flat panel with 3D sloping edges.
REM 3. -$1 to get almost no border at all! (on white forground only text is visible REM with a mild fading gradient.
:Evloop
wait event
goto @event()
:OKBUTTON
LOADLIB USER32
%H = @strdel(@WINEXISTS(#MYWin),1,1)
if %H
%H = @lib(user32,SetForegroundWindow,BOOL:,%H)
else
ERROR -1
end
FREELIB USER32
END
window normal,#MYWIN
goto EVLOOP
:TaskIconCLICK
if @equal(@click(b),RIGHT)
dialog popup,Hide|Show|Ontop|DesktopOnly|-|Exit
else
goto Check
end
goto EVLOOP
:check
REM CHECK THE WINDOW STATUS USING A VARIABLE AND TOGGLE ACCORDINGLY
IF @EQUAL(%%taskclick,0)
%%taskclick = 1
goto hideMenu
ELSE
%%taskclick = 0
goto ShowMENU
END
:HideMENU
window hide,#MYWIN
goto EVLOOP
:ShowMENU
LOADLIB USER32
%H = @strdel(@WINEXISTS(#MYWin),1,1)
if %H
%H = @lib(user32,SetForegroundWindow,BOOL:,%H)
else
ERROR -1
end
FREELIB USER32
END
window normal,#MYWIN
goto EVLOOP
:OntopMENU
%%taskclick = 0
window ontop,#MYWIN
window normal,#MYWIN
goto EVLOOP
:DesktopOnlyMENU
REM THIS IS NOTHING BUT NOTONTOP OPTION
LOADLIB USER32
%H = @strdel(@WINEXISTS(#MYWin),1,1)
if %H
%H = @lib(user32,SetWindowPos,BOOL:,%H,-2,0,0,0,0,3)
else
ERROR -1
end
FREELIB USER32
END
goto EVLOOP
:ExitMENU
:Close
exit
|
|
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Wed Jul 20, 2005 1:28 am Post subject: |
|
|
bbelcher,
| Code: | | %I = @lib(user32,SetLayeredWindowAttributes,INT:,%H,0,160,$2) |
Call the above line of code again. Change the number 160 to a number between 0 and 255. 0 is completely transparent. 255 is opaque.
| Code: | # This will make the window completely transparent
%I = @lib(user32,SetLayeredWindowAttributes,INT:,%H,0,0,$2)
# This will make the window opaque (ie... Non see through)
%I = @lib(user32,SetLayeredWindowAttributes,INT:,%H,0,255,$2) |
This is the URL that explains the use of this function. Note it only works with Win2k and newer OS'es.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/setlayeredwindowattributes.asp _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|