Important alert: (current site time 7/16/2013 3:16:44 AM EDT)
 

winzip icon

REAL Translucent Form, Flickerless & AutoUpdating

Email
Submitted on: 3/3/2001 11:27:11 PM
By: Florian Egel  
Level: Intermediate
User Rating: By 26 Users
Compatibility: VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 39556
author picture
(About the author)
 
     This Code shows
how to make real transparent forms without needing Win98 or W2k; it does not flicker and it automatically updates while moving. Even the Buttons are translucent! This code is another good example how to use my FoxCBmp3.dll, too, furthermore it demonstrates an alternative way to create cool effects with Buttons (like graphics, transparency, mask...)

 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :REAL Translucent Form, Flickerless & AutoUpdating
'**************************************
FoxAlphaBlend
BitBlt
GetDesktopWindow
GetDC
ReleaseDC
Sleep
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
3/3/2001 11:44:52 PMRad-X

Looks good, thanks for the screenshot, my mum was watching me when i loaded the page, lol.
(If this comment was disrespectful, please report it.)

 
3/4/2001 1:01:32 AMFlorian Egel

Sorry Dude, I was tired and that was the first picture i found on my HD...
;-)
(If this comment was disrespectful, please report it.)

 
3/4/2001 4:32:52 AMGKenny

Looks good, but the screenshot of my mum must go. ;-)
(If this comment was disrespectful, please report it.)

 
3/4/2001 8:17:20 AMFlorian Egel

??? Great, I didn't know I have a brother... ;-)
(If this comment was disrespectful, please report it.)

 
3/4/2001 9:14:20 AM^DaRk^

exellent!this is definatively the best example i've seen so far to make a form translucent.. thx for sharing it :)
(If this comment was disrespectful, please report it.)

 
3/5/2001 11:10:27 AMClint LaFever

Nice functionality. Just wanted to comment however that there is a reason EXE's are stripped from .ZIP files when posting and I find it very rude that you decided to rename your EXE to a .EXE_ to force it to stay.
(If this comment was disrespectful, please report it.)

 
3/5/2001 12:00:26 PMFlorian Egel

Generally you are right, i just decided to provide the .exe because the code often leaves ghosts on the screen when you run it in the IDE, so you have to either compile it or run the provided exe. that's why.
(If this comment was disrespectful, please report it.)

 
3/6/2001 12:54:12 AMkutsal baser

it seems GREAT !
but how to set the level of the transparency ?

(If this comment was disrespectful, please report it.)

 
3/6/2001 6:23:31 AMFlorian Egel

there are 2 calls of FoxAlphaBlend, one in Sub Update and one in Sub Picture1_MouseMove. one of the last parameters is 128, change this value (0 is invisible, 255 is opaque) but NOTE: the values 64, 128, 192, 255 are MUCH faster than the others, maybe 2 times as fast! but play with the value to see yourself.
(If this comment was disrespectful, please report it.)

 
3/6/2001 7:46:27 PMSabertooth

Hey Flo,
this code is as excellent as all your submissions! the first really working translucent form, and your Advanced Graphics Routines are awesome, when I see your code I feel like a tiny beginner even though I am twice as old...
Once again, great work, 5 globes from me.
(If this comment was disrespectful, please report it.)

 
3/12/2001 12:19:27 PMKosh

You clearly have a solid grasp of graphic functions and the Win32 API. My hat goes off to you. Where did you learn to do magic like this?
(If this comment was disrespectful, please report it.)

 
4/4/2001 7:52:52 PMMarkS

Magic!
(If this comment was disrespectful, please report it.)

 
4/6/2001 10:29:51 AMTM from CR

As I set in other submission
We need more people like
Florian!
Sharing the knowledge to
everyone (open source)!
Learning from
the best to do the best...
Thank you
and keep working
-TM
(If this comment was disrespectful, please report it.)

 
4/10/2001 11:11:29 PMagent153

Pretty cool. I like it a lot. I've been wondering how fesable it would be to 'move' the desktop image around the form as the form was moved. My AMD-k6 333 is not quite fast enough to run this at a decent speed though.
(If this comment was disrespectful, please report it.)

 
4/13/2001 2:48:34 AMPure

No source for the DLL.. thats the whole code.. I mean Jesus.
(If this comment was disrespectful, please report it.)

 
4/13/2001 5:03:32 PMChris

The source of FoxAlphaBlend would be much more helpful. I haven't looked at the code in the project yet, but from what I can tell, almost all the work is done in the DLL function(s). Even so, it is an excellent example.
(If this comment was disrespectful, please report it.)

 
4/18/2001 11:12:55 PMFlorian Egel

Sure the source is in the dll, that's what it is about. You can get the dll-source at my other postings
(If this comment was disrespectful, please report it.)

 
4/20/2001 8:36:49 AMMike

Excellent Work! When I tried my own bmp, the minimize and exit images disappeared. How could one fix that?
(If this comment was disrespectful, please report it.)

 
6/9/2001 2:19:30 PMMark Hunter

Fantastic! 5 Stars.

Just one question. I tried setting the ALWAYS ON TOP flag using SetWindowPos, but when Windows under this one change (move, etc.), the Window won't update.

Other than that, there is no difference between this and the Win2K Alpha blending.

Any idea what Windows message or other technique could be used to update the window when others windows under it change?
(If this comment was disrespectful, please report it.)

 
11/10/2001 12:11:46 PMken

ive tried to understand the coding but i dont understand why there are 3 picture boxes???

why are tehre 3 in the example... what are they used for??

thanks.
(If this comment was disrespectful, please report it.)

 
11/27/2001 9:36:37 AMSPeedracer

Great code.
Do you know of anyway to make a whole form translucent? or another program? and still allow all the buttons and thingsto work?
thanks alot.
(If this comment was disrespectful, please report it.)

 
3/29/2002 1:28:51 PMMetasoft

haha that button at the bottom of the form is from diablo 2, huh? thanks-i really needed that dll.
(If this comment was disrespectful, please report it.)

 
4/27/2002 4:57:08 PMsubhra

could not download the translucent from
code for any machine.please rectify soon
(If this comment was disrespectful, please report it.)

 
5/17/2002 12:37:09 PMFred Ochoa

This is truly the "best" one I have seen on this site, and I have "tested" about ten similiar ones on this site. WOW!!!


I Just have two questions Florian. Can you also make a semi-transparent picturebox with your dll.

I put the semi transparent form on top of the mediaplayer control but I guess the running video just flickers to fast for the form to be semi-transparent over the video???
(If this comment was disrespectful, please report it.)

 
6/15/2003 4:22:33 PMJonathan Chappell

Wow! I've been looking for something like this for ages. Most other ones require XP / 2000.

5 globes from me.
(If this comment was disrespectful, please report it.)

 
9/20/2003 9:24:47 PM

I cant get the dll file, and i realy wanna now how you do this, could you mail to liamingram@hotmail.com

Thx

(If this comment was disrespectful, please report it.)

 
11/11/2003 1:02:43 AM

I cant get the dll file, and i realy
wanna now like liamingram@hotmail.com
how you do this, could you
mail to nasia_nasia04@yahoo.com



(If this comment was disrespectful, please report it.)

 
3/12/2004 5:54:34 AMgurpreetsingh

Hi, Loved the screen shots. But when downloaded the dll is missing. I tried three times and still the same result. If possible mail me the dll and also post the dll in the zip[. There are lots of people that will appreciate this code.
Regards
Er. Gurpreet Singh
CEO Sukhmani Software
New Delhi

(If this comment was disrespectful, please report it.)

 
1/21/2005 4:04:02 AM

Can you please send me the dll
(If this comment was disrespectful, please report it.)

 
1/4/2006 8:28:05 PMlunis

dll?
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.