Disini kita coba untuk berlatih membuat objek transparasi pada Form dan Taskbar windows dengan menggunakan Visual Basic 6. Sebelumnya rancanglah sebuah Form dengan komponennya seperti gambar dibawah ini:
kemudian gunakan dan deklarasikan API Functions seperti dibawah ini didalam Form1:
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 Private Declare Function GetWindowLong Lib "user32.dll" _ Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal Ipclassname As String, ByVal Ipwindowname As String) As Long Private taskbarhwnd, starthwnd, startshwnd As Long |
Private Sub SetLayeredWindow(ByVal hwnd As Long, ByVal bIsLayered As Boolean) Dim WinInfo As Long WinInfo = GetWindowLong(hwnd, -20) If bIsLayered = True Then WinInfo = WinInfo Or 524288 Else WinInfo = WinInfo And Not 524288 End If SetWindowLong hwnd, -20, WinInfo End Sub Private Sub SetTransparan(ByVal hwnd As Long, ByVal opacity As Byte, ByVal IsTransparent As Boolean) |
Private Sub Check1_Click() If Check1.Value = 0 Then HScroll1.Enabled = False Text1.Enabled = False Else HScroll1.Enabled = True Text1.Enabled = True End If End Sub Private Sub Check2_Click() |
Private Sub Form_Load() HScroll1.Value = 250 HScroll2.Value = 250 End Sub Private Sub Form_Unload(Cancel As Integer) Private Sub HScroll1_Change() Private Sub HScroll2_Change() Private Sub Timer1_Timer() |
Selamat mencoba ....
0 komentar:
Posting Komentar