mgronlund
asked on
Transparent Form + Transparent GIF = Splash Screen
Im Hoping Someone Can Shed A Little Or Preferably ALOT Of Light On My Problem. I Have A .gif With A Transparent Background Which I Place In An Image Control And When I Make The Form Transparent Everything Disappears.
The API Calls I'm Using To Make The Form Transparent Are:
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
Public Sub MakeFormTransparent(FormOb ject As Form)
SetWindowLong FormObject.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
SetWindowPos FormObject.hwnd, HWND_NOTOPMOST, 0&, 0&, 0&, 0&, SWP_SHOWME
End Sub
Any Help Would Be Greatly Appreciated
The API Calls I'm Using To Make The Form Transparent Are:
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
Public Sub MakeFormTransparent(FormOb
SetWindowLong FormObject.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
SetWindowPos FormObject.hwnd, HWND_NOTOPMOST, 0&, 0&, 0&, 0&, SWP_SHOWME
End Sub
Any Help Would Be Greatly Appreciated
<Ping>
ASKER
Thought About Doing That First But The Shape Is To Irratic
:ping:
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Tried It, Doesnt Do A Terrible Job But It Doesnt Do The Inside Transparentancies (Like The Center Of Od or a)
FYI Its At http://members.fortunecity.com/alexv/index.html?VBSFC.html
FYI Its At http://members.fortunecity.com/alexv/index.html?VBSFC.html
ASKER
AHHHHHH NEVERMIND I Found An Option That Did What I Need Thanks!
Great! Glad you got your problem worked out.
ASKER
Just In Case Anyone Tries To Do What I Did You Need To Set The Edge Tracer To Use Rectangle File.
The Only Problem Is That (For Example) My Image Made 800+ Calls To The API, That In Itself Made The Routine Too Large For VB To Handle. You'll Need To Do A Search And Replace For Screen.TwipsPerPixelX + OffsetX And Screen.TwipsPerPixelY + OffsetY And Assign Them A Variable, Also Might Need To Assign ScaleY * 15 and ScaleX * 15 To A Variable. End Results Are The Same Just Results In Smaller Code And Faster Execution Since VB Won't Have To Do 800+ Calculations
The Only Problem Is That (For Example) My Image Made 800+ Calls To The API, That In Itself Made The Routine Too Large For VB To Handle. You'll Need To Do A Search And Replace For Screen.TwipsPerPixelX + OffsetX And Screen.TwipsPerPixelY + OffsetY And Assign Them A Variable, Also Might Need To Assign ScaleY * 15 and ScaleX * 15 To A Variable. End Results Are The Same Just Results In Smaller Code And Faster Execution Since VB Won't Have To Do 800+ Calculations
mgronlund: Thank you for this latest comment. It certainly adds value to the PAQ.
I agree. It's great when the asker posts their results back like this.
ASKER
Try To Help Those That Help Me,... Have One Wuestion What Is The PING Messages?
Don't know of a way around it unless you use form-shaping APIs to crop the form to the same shape as the gif's image.