Announcement

Collapse
No announcement yet.

Making a FORM transparent

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Making a FORM transparent

    I am interested in making a form 100% transparent but I want to make the controls visible. Basically I want to make a listbox on a form that will appear to be floating, any ideas?

    To make sure we are all on the same page I actually am wanting the form invisible with the controls visible. Because I have messed around with %WS_EX_TRANSPARENT and it just seems to mess the repainting up so any ideas would be great.

    Thanks

    -------------
    -Greg

    [This message has been edited by Gregery D Engle (edited May 13, 2000).]
    -Greg
    [email protected]
    MCP,MCSA,MCSE,MCSD

  • #2
    Gregory --
    perhaps, you want something like this
    Code:
    #Compile Exe
    #Dim All
    #Register None
    #Include "win32api.INC"
    
    Global oldproc As Long
    CallBack Function DlgProc
        Select Case CbMsg
          Case %WM_COMMAND: If CbCtl = 102 Then Dialog End CbHndl
          Case %WM_DESTROY: SetWindowLong CbHndl, %GWL_WNDPROC, oldproc
       End Select
    End Function
    
    CallBack Function SubClass
        Select Case CbMsg
         Case %WM_NCHITTEST: Function = %HTCAPTION: Exit Function
       End Select
       Function = CallWindowProc(oldproc, CbHndl, CbMsg, CbWparam, CbLparam)
    End Function
    
    Function PbMain
       Local hDlg As Long
       Dialog New 0, "Ltr32", , , 100, 100, %WS_POPUP To hDlg
       Dim Item(5) As String, i As Long
       For i = 0 To 5: Item(i) = "Item" + Str$(i + 1): Next
       Control Add ListBox, hDlg, 101, item(), 6, 5, 88, 80
       Control Add Button, hDlg, 102, "Quit", 30, 80, 40, 14
       OldProc = SetWindowLong(hDlg, %GWL_WNDPROC, CodePtr(subclass))
       Dialog Show Modal hDlg, Call DlgProc
    End Function
    PS. What about icons on desktop ? Did you saw my global hook ?(sample #2)

    ------------------

    Comment


    • #3
      Ya I did try that Global Hook Sample #2 and that is example what I needed. If you email me at [email protected] I can tell you what the project is about but I don't want to discuss it on this board. Thanks for all your help. Oh I am still working on how to figure out when the focus leaves the icon but I think it won't take that long to figure out.

      Thanks

      ------------------
      -Greg
      -Greg
      [email protected]
      MCP,MCSA,MCSE,MCSD

      Comment


      • #4
        Gregory --
        For me is interesting global hook as it is only
        I reposted a sample #2 (+ information, when cursor leaves an icon)

        ------------------

        Comment


        • #5
          You could also take a look to 'regions' on my site.

          It's written in VB.



          ------------------

          Comment


          • #6
            Greg,

            WinLIFT Pro edition could save you weeks of hard work...


            ------------------
            Patrice Terrier
            mailto[email protected][email protected]</A>
            Patrice Terrier
            www.zapsolution.com
            www.objreader.com
            Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

            Comment


            • #7
              Originally posted by Semen Matusovski:
              Gregory --
              For me is interesting global hook as it is only
              I reposted a sample #2 (+ information, when cursor leaves an icon)

              I've got a question? Do you just whip up this code in a few minutes? Because you have been VERY helpful and I classify myself a good programmer but the code that I've seen from you I could never do

              I think I should reclassify what I was talking about with the focus. I wanted to detect when the mouse leaves an icon and moves somewhere else on the desktop.

              Again, thanks

              ------------------
              -Greg

              [This message has been edited by Gregery D Engle (edited May 13, 2000).]
              -Greg
              [email protected]
              MCP,MCSA,MCSE,MCSD

              Comment


              • #8
                Greg,

                One think you can easily do is make the list box the parent window
                with a normal CreateWindowEx() call and use a subclass function
                as the main message processing function. Its easy to do and it
                works fine.

                You can load the list box from the WM_INITDIALOG message in the message
                handling proc or after the CreateWindowEx() call, either will do.

                I don't know if this is what you mean by a floating window but it
                is an easy app to write.

                Regards,

                [email protected]

                ------------------
                hutch at movsd dot com
                The MASM Forum

                www.masm32.com

                Comment

                Working...
                X