Results 1 to 4 of 4

Thread: This is a very hard one!!!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Location
    Mexico
    Posts
    25

    Wink

    Hi,

    how can i make my form has the same backcolor that whatever is behind it... like a transparent effect....

    Thanks. ^_^
    The 'H' ^_^

  2. #2
    Guest
    Code:
    Public Const GWL_EXSTYLE = (-20)
    Public Const WS_EX_TRANSPARENT = &H20&
    Public Const SWP_FRAMECHANGED = &H20
    Public Const SWP_NOMOVE = &H2
    Public Const SWP_NOSIZE = &H1
    Public Const SWP_SHOWME = SWP_FRAMECHANGED Or _
    SWP_NOMOVE Or SWP_NOSIZE
    Public Const HWND_NOTOPMOST = -2  
     Declare Function SetWindowLong Lib "user32" _
    Alias "SetWindowLongA" _
    (ByVal hwnd As Long, ByVal nIndex As Long, _
    ByVal dwNewLong As Long) As Long
    Declare Function SetWindowPos Lib "user32" _
    (ByVal hwnd As Long, ByVal hWndInsertAfter _
    As Long, ByVal x As Long, ByVal y As Long, _
    ByVal cx As Long, ByVal cy As Long, _
    ByVal wFlags As Long) As Long  
    
    
    Private Sub Form_Activate()
    SetWindowLong Me.hwnd, GWL_EXSTYLE, _
    WS_EX_TRANSPARENT
    SetWindowPos Me.hwnd, HWND_NOTOPMOST, _
    0&, 0&, 0&, 0&, SWP_SHOWME
    End Sub

  3. #3
    Guest
    Matthew Gates: You cannot have a Public const or function in a Form module. If you want it to be public, you must place it in a Standard Module, orif you want to keep it in the Form, declare it as Private.
    Code:
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Const GWL_EXSTYLE = (-20)
    Const WS_EX_TRANSPARENT = &H20&
    
    Private Sub Form_Activate()
        SetWindowLong Me.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
    End Sub

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Location
    Mexico
    Posts
    25

    Talking Thanks a lot!!

    Ok, i have to thank you, both codes were so useful, thank you ^_^\/

    I hope someday i can help you.

    Thks again.
    The 'H' ^_^

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width