Home
Tutorials
Code Snippets
Code Samples
Downloads
Links

The Blog
Our Projects
About
Contact

::Add RageStorm to Favorites!::

The Blog | Our Projects | Guest Book | About | Contact

 
Code Snippet - Alphablended|Transparent Window
Author:Arkon
Category:Win32API
File Size:532 Bytes
Uploaded at:28-Nov-02 01:08:23 pm
Description:
  Shows you how to make your window alphablended or transparent. This technique is faster than regions. For WinNT.
  
 // You have to set an additional flag in the exStyle, or just add it when you CreateWindowEx.
 SetWindowLong(hWnd, GWL_EXSTYLE, GetWindowLong(hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);

 // Use crKey as the transparency color.
 COLORREF crKey = RGB(0, 0, 0);
 //SetLayeredWindowAttributes(hWnd, crKey, 0, LWA_COLORKEY);

 // Use bAlpha to determine the opacity of the layered window.
 // When alpha 0 the window is completely transparent, when it's 255 the window is opaque.
 SetLayeredWindowAttributes(hWnd, 0, 128, LWA_ALPHA);
User Contributed Comments(1)
 [1] Sanjeev | 2012-05-17 02:05:15

I want to transparent or alphablended the only background of the dialog box, not its child controls like button. Please reply........
NOTE:
Comments that will hurt anyone in any way will be deleted.
Don't ask for features, advertise or curse.
If you want to leave a message to the author use the contacts,
if you have any question in relation to your comments please use the forum.
Comments which violate any of these requests will be deleted without further
notice. Use the comment system decently.

Post your comment:
Name:
email:
Comment:
::Top 5 Tutorials::
Embedded Python[106235]
2D Rotated Rectangles Collision Detection[79393]
Keyboard Hook[68783]
UDP[52867]
HTTP Proxy[36098]

::Top 5 Samples::
2D ColDet Rotated Rectangles[10613]
PS2 Mouse Driver[6098]
Wave Format Player[4984]
Reading FAT12[4870]
CodeGuru[4561]


All rights reserved to RageStorm © 2009