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 06: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);
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[117080]
2D Rotated Rectangles Collision Detection[88998]
Keyboard Hook[77344]
UDP[65892]
HTTP Proxy[41228]

::Top 5 Samples::
2D ColDet Rotated Rectangles[11562]
PS2 Mouse Driver[6960]
Wave Format Player[5793]
Reading FAT12[5621]
CodeGuru[5361]


All rights reserved to RageStorm © 2009