Results 1 to 4 of 4

Thread: transparent forms!

  1. #1
    Guest

    Arrow

    Hello,
    I need to make a form completely transparent.

    for example, when you maximize it, you can only see the title bar,
    I still need it to be there, but it just cant be visible.



    thanks,

    Dennis

  2. #2
    Guest
    I know I can find the DC of the desktop, then blit that onto my form, and it would look transparent but I would like to see if there is another way before I attemp that.

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>



    Code:
    'make a form transparent
    'put this code in a bas module
    
    Option Explicit
    
    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
    
    '    <<<<    Form Code    >>>>
    
    Option Explicit
    
    'you must set the Form's  [ShowInTaskbar to false]
    'you must set the Form's  [BorderStyle to none]
    '
    '
    Private Sub Command1_Click()
       SetWindowLong Me.hwnd, GWL_EXSTYLE, _
       WS_EX_TRANSPARENT
       SetWindowPos Me.hwnd, HWND_NOTOPMOST, _
       0&, 0&, 0&, 0&, SWP_SHOWME
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4
    Guest
    Thank you very much!
    this was exactly what I was looking for!

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