Still looking for help with transparent window
I posted for help earlier and got no replies :(
I need a transparent form/frame/user control/etc thats located over a video window. Then I want to draw in the transparent window on top of the video(lines etc) using the mouse.
Here is something similar that joaquim posted back in Nov 2008..
http://www.vbforums.com/showthread.p...ht=transparent
Interesting idea...but a little messy due to the mouse events not being accurate on the transparent user control.
I have tried many things and searched high and low without success.
Is this really that hard to do or even impossible in VB6?
Thanks for any help!
Re: Still looking for help with transparent window
I wrote an image grabber many years ago. It had a frame and a transparent background. The idea was that you'd place the frame over something on your display, position and size the frame until you were happy and then 'click' to make a copy of whatever was in the frame.
This worked great for years on W2000 and XP but when Vista arrived it stopped working - maybe something to do with Aero.
Anyway, I think I did something like this but it probably won't work on vista/aero although I didn't bother looking for a reason - maybe I'll do it one day.
Code:
' before calling this function set your form background to vbRed and the
' call to SetLayeredWindowAttributes makes that red into transparent.
Public Function SetBackground()
Dim rtn As Long
On Error GoTo errPoint
rtn = GetWindowLong(hwnd, GWL_EXSTYLE)
rtn = rtn Or WS_EX_LAYERED
SetWindowLong hwnd, GWL_EXSTYLE, rtn
SetLayeredWindowAttributes hwnd, vbRed, 255, 1 ' LWA_ALPHA
Exit Function
errPoint:
' probably running windows9x so doesn't support the LayeredWindowAttributes
Err.Clear
End Function