₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,330,644 members, 8,446,404 topics. Date: Thursday, 16 July 2026 at 01:47 PM

Toggle theme

Making Application In Vb6 Transparent - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingMaking Application In Vb6 Transparent (1759 Views)

1 Reply (Go Down)

Making Application In Vb6 Transparent by adewaleafolabi(op): 4:49pm On Oct 27, 2006
with this code you can make your entire program windows transparent

Option Explicit

Private Declare Function SendMessage Lib "User32" Alias "SendMessageA" _
   (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
    lParam As Any) As Long
Private Declare Sub ReleaseCapture Lib "User32" ()

Private Declare Function GetWindowLong Lib "User32" Alias _
   "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "User32" Alias _
   "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, _
   ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "User32" _
   (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, _
    ByVal dwFlags As Long) As Long

Const WM_NCLBUTTONDOWN = &HA1
Const HTCAPTION = 2

Const WS_EX_LAYERED = &H80000
Const GWL_EXSTYLE = (-20)
Const LWA_ALPHA = &H2
Const LWA_COLORKEY = &H1

Private Sub Form_Load()
DarkMe
End Sub

Public Function DarkMe()
  Dim rtn As Long
  rtn = GetWindowLong(hWnd, GWL_EXSTYLE)
  rtn = rtn Or WS_EX_LAYERED
  SetWindowLong hWnd, GWL_EXSTYLE, rtn
  SetLayeredWindowAttributes hWnd, 0, 200, LWA_ALPHA
End Function


check developerfusion.co.uk for more goodies
Re: Making Application In Vb6 Transparent by candylips(m): 2:28pm On Oct 29, 2006
although i havent don VB programming in a while. thats a nice tip
Re: Making Application In Vb6 Transparent by adewaleafolabi(op): 3:00pm On Oct 29, 2006
thank you so what lanugauge do u use now
Re: Making Application In Vb6 Transparent by candylips(m): 3:04pm On Oct 29, 2006
well i do Java but i am currently learning .Net
1 Reply

Urgent!!! Convert Source Code Written In VB6. To VB .NETLogin Code In Vb6.0A Very Simple Loan Calculator In Vb6 Needed234

Best Programming Languages 4 Electronic/computer EngineeringPlease Nairalanders Help Me Out: IIS 8 Page Keep Appearing When I Load Waec SiteLearning To Code In Naijarea