View previous topic :: View next topic |
Author |
Message |
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Jul 03, 2003 4:07 pm Post subject: Transparent windows VDS 5 + Win 2k+ |
|
|
Make your window Transparent!(VDS 5.x and win 2k and above only)
Use at your own risk.
You can get the Script as a zip file here:
http://www.vdsworld.com/index.php?page=download&fileid=306
Quote: |
#-----------------------------------------------------------------------------#
# Calling a Non-VDs dll and Transparent window demo VDS 5+Win 2k above ONLY #
# Author: CodeScript #
# Copyright: You can remove this info while 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 ! Transparent windows supported only on Win2000 and above !
exit
end
Title Transparent Window Demo by CodeScript
DIALOG CREATE,Transparent Window Demo by CodeScript,-1,0,356,120,CLASS MYWIN
DIALOG ADD,BUTTON,TRANS,20,112,130,24,Make Transparent
DIALOG ADD,BUTTON,RESTORE,70,112,130,24,Restore
DIALOG SHOW
REM SET INITIAL LEVEL OF TRANSPARENCY ON FIRST BUTTON PRESS
%L = 230
Hotkey add,1,F6
:Evloop
wait event
goto @event()
:TRANSBUTTON
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,%L,$2)
REM You can change the value %L to change the level of transparency.
ELSE
ERROR -1
end
FREELIB USER32
%L = @DIFF(%L,30)
REM Safety measure to prevent the form from completely dissapearing
IF @Greater(50,%L)
%L = 50
end
goto evloop
:Hotkey
:RESTOREBUTTON
%L = 230
LOADLIB USER32
IF %H
%I = @lib(user32,SetLayeredWindowAttributes,INT:,%H,0,255,$2)
ELSE
ERROR -1
end
FREELIB USER32
goto evloop
:Close
exit
|
_________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension
Last edited by CodeScript on Thu Jul 31, 2003 6:33 pm; edited 2 times in total |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Jul 03, 2003 5:13 pm Post subject: |
|
|
That's really cool, and I think the VDSDLL3 can do that too
Is there a way to make the window not be so sluggish in moving after the
API is called? _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Jul 03, 2003 5:15 pm Post subject: |
|
|
BTW, are you using the WIN32.HLP file for your information or something
else? _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Jul 03, 2003 5:41 pm Post subject: |
|
|
FreezingFire wrote: |
Is there a way to make the window not be so sluggish in moving after the
API is called?
BTW, are you using the WIN32.HLP file for your information or something
else?
|
No I don't know that occurs especially if another dll is drawing directly on the surface of VDS dialog. I think it is related to the slow redraw rate of the dll or vdsrun dll -depending on the case. Hence I think that it is unlikely to be solved but I may be wrong. Anyway as of now it is better to use it on apps without too many bit buttons/maps webbrowser etc. Also it's worser with vds 5 compared to vds 4.x( it is independent of who makes the window transparent.)
I am using W32.HLP + API viewer for VB(to get constants etc.) I think it is possible to remove sluggishness by restoring setLayeredWindowAttributes and removing transparency - I will have a look.I may add some more scripts if I find time and if U feel thay R worthy.
Regards _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension
Last edited by CodeScript on Thu Jul 03, 2003 7:14 pm; edited 1 time in total |
|
Back to top |
|
|
Hortalonus Valued Contributor
Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Thu Jul 03, 2003 6:12 pm Post subject: |
|
|
CodeScript wrote: | I may add some more scripts if I find time and if U feel thay R worthy. |
Yes, yes... please post more! It's not about worthiness... everyone is welcome to post any code that might be helpful to the community. Thank you for your examples! _________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Jul 03, 2003 7:15 pm Post subject: |
|
|
I just said coz I have minimal knowledge in programming and it isnt my field either _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Jul 03, 2003 7:30 pm Post subject: |
|
|
You've been doing a great job so far!! _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Fri Jul 04, 2003 10:55 am Post subject: |
|
|
FreezingFire wrote: | You've been doing a great job so far!! |
Thanks for that.
I have posted 2 more scripts today all for VDS 5.x and both about user interface enhnacements.
I thing these abilties in VDS 5 should give developers take a more seroius look at it for use in their newer projects. Its getting nearer being a programming language than a simple scripting utilty as it started off. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
|
Vic D'Elfant Past Contributor
Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Sat Sep 13, 2003 10:35 am Post subject: |
|
|
Hi CodeScript,
When executing this code:
Code: |
#include trans.fil
#define command, transparent
DIALOG CREATE,Transparent Window,-1,0,372,48,CLASS MYWIN,NOTITLE
DIALOG ADD,TEXT,TEXT1,17,172,,,Hello!
transparent #MYWIN, 0
DIALOG SHOW
%i = 0
repeat
transparent #MYWIN, %i
%i = @succ(%i)
until @greater(%i, 255)
wait 1
%i = 255
repeat
transparent #MYWIN, %i
%i = @pred(%i)
until @not(@greater(%i, 0))
|
a button appears in the taskbar (which I don't want). Is this bug fixable?
Greetings,
Vic _________________ phpBB Development Team |
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Sat Sep 13, 2003 6:10 pm Post subject: |
|
|
Try this as the include file trans.fil
Code: |
#DEFINE COMMAND,TRANSPARENT
REM *****************************************************
REM Transparent window by CodeScript
:TRANSPARENT
IF @NULL(%1)
EXIT
END
%W = @substr(@SYSINFO(WINVER),1,1)
If @greater(5,%W)
exit
end
LOADLIB USER32
%H = @strdel(@WINEXISTS(%1),1,1)
IF %H
%I = @lib(user32,GetWindowLongA,INT:,%H,-20)
%I = @lib(user32,SetWindowLongA,INT:,%H,-20,@SUM($80000,$80))
%I = @lib(user32,SetLayeredWindowAttributes,INT:,%H,0,%2,$2)
END
FREELIB USER32
EXIT |
_________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
|
Vic D'Elfant Past Contributor
Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Sat Sep 13, 2003 6:27 pm Post subject: |
|
|
Thanks CodeScript!
That works!
Vic _________________ phpBB Development Team |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Mon Sep 15, 2003 2:26 pm Post subject: |
|
|
Hi All,
Gadget can do this as well and is not limited to just Win2k or XP. Gadget does not use the Win2k function mentioned here. It has it's own built in functions to do this Anyway just a note for the users out there still using Win9x. _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
Woody Valued Newbie
Joined: 10 Jul 2003 Posts: 29
|
Posted: Wed Sep 17, 2003 4:48 pm Post subject: Transparency |
|
|
Hello All,
Great code so far!
Does anyone know if we can give it an area to make transparent? say just a section or half of the window?
Thanks, _________________ - Woody |
|
Back to top |
|
|
CodeScript Moderator Team
Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Wed Sep 17, 2003 5:50 pm Post subject: |
|
|
I am waiting for the VDS update to get more than 8 parameters to @LIB() function. After that I will give a try in my freetime.
edit: You can use gadget as of now. I think the example that mindpower was talking in the post above does exactly this (whole window and part if needed). _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension
Last edited by CodeScript on Wed Sep 17, 2003 6:20 pm; edited 2 times in total |
|
Back to top |
|
|
PGWARE Web Host
Joined: 29 Dec 2001 Posts: 1562
|
Posted: Wed Sep 17, 2003 6:12 pm Post subject: |
|
|
Woody you could use Gadget to do it. I'm not certain but more then likely you'll need to set a REGION (top, left, right, bottom) coordinates you want to make transparent then issue the correct api. |
|
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
|
|