Translate This Blog

English French German Spain Italian Dutch

Russian Portuguese Japanese Korean Arabic Chinese Simplified
by : NUROFIK

Bikin Jendela Tembus Pandang

Jumat, 22 Oktober 2010


Cara pembuatannya berikut ini :
1. Buka aplikasi Visual Basic 6.0 lewat [Start] > [All Programs] > [Microsoft Visual Studio 6.0] > [Microsoft Visual Studio 6.0].
2. Pada jendela New Project, pilih tab New.
3. Pada tab New, pilihlah Standard EXE dan klik [ Open ] untuk membuka Jendela Project1 - Form1 (Form).
4. klik [View] >
CODE:
  1. untuk membuka jendela Project1 – Form1 (Code)
  2.  
  3. 5. Ketikkan kode program berikut ini :
  4.  
  5. [code]Option Explicit
  6. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
  7. (ByVal hWnd As Long, ByVal nIndex As Long) As Long
  8. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
  9. (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  10. Private Declare Function SetLayeredWindowAttributes Lib "user32" _
  11. (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Long, ByVal _
  12. dwFlags As Long) As Long
  13. Private Const WS_EX_LAYERED As Long = &H80000
  14. Private Const LWA_ALPHA As Long = &H2
  15. Private Const GWL_EXSTYLE = (-20)
  16. Sub TembusPandang(lhWnd As Long, level As Integer)
  17. On Error GoTo keluar
  18.  
  19. Call SetWindowLong(lhWnd, GWL_EXSTYLE, GetWindowLong(lhWnd _
  20. , GWL_EXSTYLE) Or WS_EX_LAYERED)
  21. Call SetLayeredWindowAttributes(lhWnd, 0, (level * 255) / 100, LWA_ALPHA)
  22.  
  23. keluar:
  24. End Sub
  25.  
  26. Private Sub Form_Load()
  27. TembusPandang Me.hWnd, 50
  28. End Sub
6. Untuk melihat hasilnya simpan dan jalankan dengan menekan [F5].

0 komentar:

Posting Komentar

Catatan: Hanya anggota dari blog ini yang dapat mengirim komentar.

 
 
 

Followers