set Window transparency!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • goldingname
    Forum Member
    • Jan 2006
    • 23

    set Window transparency!

    hello everybody
    i want to change my applications transparency
    i know i need to call a function named "SetLayeredWindowAttributes"
    in "user32.dll"
    and also i have these informations about this Function
    -=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    (Parameters)
    Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
    -=-=-=-=-=-=
    · hwnd
    [in] Handle to the layered window. A layered window is created by specifying WS_EX_LAYERED when creating the window with the CreateWindowEx function or by setting WS_EX_LAYERED via SetWindowLong after the window has been created.
    · crKey
    [in] Pointer to a COLORREF value that specifies the transparency color key to be used when composing the layered window. All pixels painted by the window in this color will be transparent. To generate a COLORREF, use the RGB macro.
    · bAlpha
    [in] Alpha value used to describe the opacity of the layered window. Similar to the SourceConstantAlpha member of the BLENDFUNCTION structure. When bAlpha is 0, the window is completely transparent. When bAlpha is 255, the window is opaque.
    · dwFlags
    [in] Specifies an action to take. This parameter can be one or more of the following values.
    LWA_COLORKEY
    Use crKey as the transparency color.
    LWA_ALPHA
    Use bAlpha to determine the opacity of the layered window..

    =-=-=-==-=-=-=-=-=-=-=-=---=-===-=-=-==-=-=-=-=-=-=-
    (vb Example)
    Const LWA_COLORKEY = &H1
    Const LWA_ALPHA = &H2
    Const GWL_EXSTYLE = (-20)
    Const WS_EX_LAYERED = &H80000
    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
    Private Sub Form_Load()
    'KPD-Team 2000
    'URL: http://www.allapi.net/
    'E-Mail: [email protected]
    Dim Ret As Long
    'Set the window style to 'Layered'
    Ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
    Ret = Ret Or WS_EX_LAYERED
    SetWindowLong Me.hWnd, GWL_EXSTYLE, Ret
    'Set the opacity of the layered window to 128
    SetLayeredWindowAttributes Me.hWnd, 0, 128, LWA_ALPHA
    End Sub
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


    the problem is "i don't know how to use it in AMS"
    can you help me?
  • goldingname
    Forum Member
    • Jan 2006
    • 23

    #3
    thanks a lot!

    i don't know how i can appreciate your help
    thank u again!

    Comment

    • Worm
      Indigo Rose Customer
      • Jul 2002
      • 3971

      #4
      You're welcome. Good luck

      Comment

      Working...
      X