forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Transparent windows VDS 5 + Win 2k+
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code
View previous topic :: View next topic  
Author Message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Jul 03, 2003 4:07 pm    Post subject: Transparent windows VDS 5 + Win 2k+ Reply with quote

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
Arrow 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
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Jul 03, 2003 5:13 pm    Post subject: Reply with quote

That's really cool, and I think the VDSDLL3 can do that too Smile

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
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Jul 03, 2003 5:15 pm    Post subject: Reply with quote

BTW, are you using the WIN32.HLP file for your information or something
else?

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Jul 03, 2003 5:41 pm    Post subject: Reply with quote

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
Arrow 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
View user's profile Send private message Visit poster's website
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Thu Jul 03, 2003 6:12 pm    Post subject: Reply with quote

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! Very Happy

_________________
"ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player...
Back to top
View user's profile Send private message Send e-mail
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Jul 03, 2003 7:15 pm    Post subject: Reply with quote

I just said coz I have minimal knowledge in programming Very Happy and it isnt my field either
_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Jul 03, 2003 7:30 pm    Post subject: Reply with quote

You've been doing a great job so far!! Very Happy
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Fri Jul 04, 2003 10:55 am    Post subject: Reply with quote

FreezingFire wrote:
You've been doing a great job so far!! Very Happy


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
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Sat Sep 13, 2003 10:35 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Sat Sep 13, 2003 6:10 pm    Post subject: Reply with quote

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
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Sat Sep 13, 2003 6:27 pm    Post subject: Reply with quote

Thanks CodeScript!

That works! Very Happy


Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Sep 15, 2003 2:26 pm    Post subject: Reply with quote

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 Smile Anyway just a note for the users out there still using Win9x.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Woody
Valued Newbie


Joined: 10 Jul 2003
Posts: 29

PostPosted: Wed Sep 17, 2003 4:48 pm    Post subject: Transparency Reply with quote

Hello All,

Great code so far! Very Happy

Does anyone know if we can give it an area to make transparent? say just a section or half of the window?


Thanks, Cool

_________________
- Woody
Back to top
View user's profile Send private message AIM Address
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Wed Sep 17, 2003 5:50 pm    Post subject: Reply with quote

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
Arrow 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
View user's profile Send private message Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1562

PostPosted: Wed Sep 17, 2003 6:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group