PDA

View Full Version : โค้ด Vb ครับทำให้โปรแกรมโปร่งแสงครับ



stepno01
01-05-2009, 06:49 PM
ไม่บอกนะครับว่าเอาไปเขียนส่วนไหน คนใช้ Vb เป็นมองทีเดียว ก็อปไปวางได้เลย
MakeTransparent Me.hWnd, 50

Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
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 Const GWL_EXSTYLE = (-20)
Private Const LWA_ALPHA = &H2
Private Const WS_EX_LAYERED = &H80000

Public Function MakeTransparent(ByVal hWnd As Long, Perc As Integer) As Long
Dim msg As Long
On Error Resume Next
If Perc < 0 Or Perc > 255 Then
MakeTransparent = 1
Else
msg = GetWindowLong(hWnd, GWL_EXSTYLE)
msg = msg Or WS_EX_LAYERED
SetWindowLong hWnd, GWL_EXSTYLE, msg
SetLayeredWindowAttributes hWnd, 0, Perc, LWA_ALPHA
MakeTransparent = 0
End If
If Err Then
MakeTransparent = 2
End If
End Function

dekthaitp
11-05-2009, 04:24 PM
ไม่เลวครับ โค๊ดนี้...เอาไปปรับใช้อีกหน่อย ได้ระดับเลย

blackcatzz
13-05-2009, 12:11 PM
<_< ตอนแรกก็กะจะเอาไปใช้ดู แต่พอดีความรู้ยังไม่ถึงเลยไม่รู้จะเอาไปใส่ตรงไหน :D

rungun123
16-05-2009, 03:08 PM
เอาไปใส่ตรงไหนอ่าครับ
end function
เหมือนในสคริป gtaเลยครับ

BirdOfJc
06-06-2009, 04:00 PM
ขอเพิ่มให้นะครับ เอาประโยคนี้
MakeTransparent Me.hWnd, 50
ไปใส่ตอนที่เราเรียกอีเว้นขึ้นมาอาจจะเป็น ตอน Form ที่อีเว้น FormLoad หรือที่ Command ก็ได้
หรือจะทำเป็น slide จากไปร่งใสไปทึบ หรือ จะทึบไปโปร่งใสก็ได้ครับ
จะให้ใสเท่าไรก็เปลี่ยนตัวเลขด้านหลังเอาครับ

นี่ครับลองเอาไปเล่นดูครับ

**Hidden Content: Check the thread to see hidden data.**

CkW
04-09-2009, 10:42 PM
นี่ครับ Code อย่างละเอียด พร้อม Code + EXE

ทำให้สีแต่ละสีหายไปได้

VB Code Make Transparent [สร้างความโปร่งใสให้กับ Form]

http://citec.us/forum/VB-Code-Make-Transpa...orm-t31124.html (http://citec.us/forum/VB-Code-Make-Transparent-Form-t31124.html)

VB Code Make Transparent [สร้างความโปร่งใสให้กับ Form] #2

http://citec.us/forum/VB-Code-Make-Transpa...m-2-t31138.html (http://citec.us/forum/VB-Code-Make-Transparent-Form-2-t31138.html)