Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Make your form transparent
Author:
Gehan Fernando
E-mail:
Click to e-mail author
Submitted:
5/21/2007
Version:
VB6
Compatibility:
VB6
Category:
Windows API
Views:
23870
Make your form transparent according to your value.
Declarations:
Option Explicit Public Const GWL_EXSTYLE As Long = -20 Public Const WS_EX_LAYERED As Long = &H80000 Public Const LWA_ALPHA As Long = &H2 Public Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" ( _ ByVal hwnd As Long, _ ByVal nIndex As Long) As Long Public Declare Function SetLayeredWindowAttributes Lib "user32.dll" ( _ ByVal hwnd As Long, _ ByVal crKey As Long, _ ByVal bAlpha As Byte, _ ByVal dwFlags As Long) As Long Public Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" ( _ ByVal hwnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Public Declare Function SetParent Lib "user32.dll" ( _ ByVal hWndChild As Long, _ ByVal hWndNewParent As Long) As Long
Code:
Public Sub SetTrans(ByVal OB_Hwnd As Long, ByVal OB_Val As Integer) On Error Resume Next Dim Attrib As Long Attrib = GetWindowLong(OB_Hwnd, GWL_EXSTYLE) SetWindowLong OB_Hwnd, GWL_EXSTYLE, Attrib Or WS_EX_LAYERED SetLayeredWindowAttributes OB_Hwnd, RGB(0, 0, 0), OB_Val, LWA_ALPHA FTransVal = OB_Val Exit Sub End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement