Help Gia-> SetLayeredWindowAttributes....

Συζητήσεις για τις γλώσσες του dot Net και για του Visual Studio της Microsoft

Συντονιστές: WebDev Moderators, Super-Moderators

Απάντηση
Άβαταρ μέλους
Planet20
Δημοσιεύσεις: 27
Εγγραφή: 15 Μαρ 2003 03:37
Τοποθεσία: magnisia

Help Gia-> SetLayeredWindowAttributes....

Δημοσίευση από Planet20 » 29 Ιαν 2004 03:13

Geia sas! :o
Doulebo se WinMe kai WinXP, exw brei ayto to mikro ergo sto web kai thelw na to kanw na doulebei sosta sta winMe, pos mporo na to kanw?
to olo problima briskete sti synartisi ''SetLayeredWindowAttributes''.Tin Psaxnw sto API Viewer alla den yparxei, sta XP doulebei kanonika.
kapoia tropopoinsi ginete?

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 UpdateLayeredWindow Lib "user32" (ByVal hwnd As Long, ByVal hdcDst As Long, pptDst As Any, psize As Any, ByVal hDCSrc As Long, pptSrc As Any, crKey As Long, ByVal pblend As Long, 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_COLORKEY = &H1
Private Const LWA_ALPHA = &H2
Private Const ULW_COLORKEY = &H1
Private Const ULW_ALPHA = &H2
Private Const ULW_OPAQUE = &H4
Private Const WS_EX_LAYERED = &H80000

Public Function isTransparent(ByVal hwnd As Long) As Boolean
On Error Resume Next
Dim Msg As Long

Msg = GetWindowLong(hwnd, GWL_EXSTYLE)

If (Msg And WS_EX_LAYERED) = WS_EX_LAYERED Then
isTransparent = True
Else
isTransparent = False
End If

If Err Then
isTransparent = False
End If
End Function

Public Function MakeTransparent(ByVal hwnd As Long, Perc As Integer) As Long
On Error Resume Next
Dim Msg As Long

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

Public Function MakeOpaque(ByVal hwnd As Long) As Long
On Error Resume Next
Dim Msg As Long

Msg = GetWindowLong(hwnd, GWL_EXSTYLE)
Msg = Msg And Not WS_EX_LAYERED
SetWindowLong hwnd, GWL_EXSTYLE, Msg
SetLayeredWindowAttributes hwnd, 0, 0, LWA_ALPHA
MakeOpaque = 0

If Err Then
MakeOpaque = 2
End If
End Function

Private Sub Check1_Click()
If Check1.Value = vbChecked Then
Slider.Enabled = True
MakeTransparent Me.hwnd, Slider.Value
Else
Slider.Enabled = False
MakeOpaque Me.hwnd
End If
End Sub

Private Sub Command1_Click()
Unload Me
End
End Sub

Private Sub Form_Load()
Slider.Enabled = False
Slider.Value = 255
End Sub

Private Sub Slider_Scroll()
MakeTransparent Me.hwnd, Slider.Value
End Sub

Άβαταρ μέλους
Valerov
Δημοσιεύσεις: 231
Εγγραφή: 13 Ιαν 2003 09:36
Τοποθεσία: Πάτρα

Help Gia-> SetLayeredWindowAttributes....

Δημοσίευση από Valerov » 11 Φεβ 2004 14:57

re file mou, dose mas plirofories, ti ergo einai, ti minima sou vgazei min milas genika
:: Always Dive With A Partner ::

Άβαταρ μέλους
Planet20
Δημοσιεύσεις: 27
Εγγραφή: 15 Μαρ 2003 03:37
Τοποθεσία: magnisia

Help Gia-> SetLayeredWindowAttributes....

Δημοσίευση από Planet20 » 11 Φεβ 2004 19:23

Run-time error '453':

Can't find DLL entry point SetLayeredWindowAttributes in user32.dll

einai mia forma me ena scrollBar i opia otan siris to scrollBar tote i forma ginete diafani(san giali).
pao loipon sto References kai grafo tin parapano dll. kai mou vgazi to eksis minima .
Can't add a reference to the specified file.
(ayta ta provlimata mou ta kanei sta winMe. eno sta winXP. doulevi kanonika.

Απάντηση

Επιστροφή στο “dot Net και Visual Studio”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 0 επισκέπτες