[ Log In | Register ]       
Resource Database Index -> Source Code -> Transparent Windows
Description // Info



Source Code

  1. Option Explicit
  2.  
  3. Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
  4. Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  5. Private Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
  6.  
  7. Private Const GWL_EXSTYLE = (-20)
  8. Private Const WS_EX_LAYERED = &H80000
  9.  
  10. 'Macht nur eine Farbe transparent
  11. 'Public Const LWA_COLORKEY = &H1
  12.  
  13. 'Macht das ganze Fenster transparent
  14. Private Const LWA_ALPHA = &H2
  15.  
  16. Public Sub Mache_Transparent(hWnd As Long, Rate As Byte)
  17.    
  18.     Dim WinInfo As Long
  19.    
  20.     WinInfo = GetWindowLong(hWnd, GWL_EXSTYLE)
  21.    
  22.     If Rate < 255 Then
  23.         WinInfo = WinInfo Or WS_EX_LAYERED
  24.         SetWindowLong hWnd, GWL_EXSTYLE, WinInfo
  25.         SetLayeredWindowAttributes hWnd, 0, Rate, LWA_ALPHA
  26.     Else
  27.         'Wenn als Rate 255 angegeben wird,
  28.         'so wird der Ausgangszustand wiederhergestellt
  29.         WinInfo = WinInfo Xor WS_EX_LAYERED
  30.         SetWindowLong hWnd, GWL_EXSTYLE, WinInfo
  31.     End If
  32. End Sub
  33.  
  34. Private Sub Command1_Click()
  35. Mache_Transparent Me.hWnd, 175
  36. End Sub


Comments

POSTED BY: techboy ON 0000-00-00 00:00:00
guys can any1 please tell me how to compile this code??

You must be logged in to post comments.

 Network Access...
USER ID
PASSWORD

 Code Information
Language:
VB6

Version:
1


Submitted:
2008-07-15 - 09:51:05


Author:

E-Mail
Website

Greetz:


[ Download | Report Issue ]

 Code Search
Search by Language
+ Assembly
+ ASP
+ ASP.NET
+ C#
+ C/C++
+ Cobol
+ Delphi
+ Java
+ Javascript
+ Pascal
+ Perl
+ PHP
+ Python
+ VB6
+ VB.NET

Advanced Search




 
 
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.

© 2008 r00tsecurity network. All rights reserved.
[ About Us | Contact Us | Support Us | Legal | Advertise | User Agreement | Privacy Policy ]