Solved

Transparent Form + Transparent GIF = Splash Screen

Posted on 2001-07-19
12
259 Views
Last Modified: 2006-11-17
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(FormObject 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
0
Comment
Question by:mgronlund
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 5

Expert Comment

by:KDivad
ID: 6299101
I've always suspected that an image control doesn't really exist and the image is actually on the form itself (same with labels). If this is true, then your code will make it disappear along with the rest of the form.

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.
0
 
LVL 4

Expert Comment

by:VincentLawlor
ID: 6299118
<Ping>
0
 
LVL 3

Author Comment

by:mgronlund
ID: 6299136
Thought About Doing That First But The Shape Is To Irratic
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 8

Expert Comment

by:DennisBorg
ID: 6299138
:ping:
0
 
LVL 5

Accepted Solution

by:
KDivad earned 300 total points
ID: 6299154
You can try a web-search for VB Shaped Form Creator. Last time I checked, you could use it to create shapes from images. It wasn't very good, but may have improved since then...
0
 
LVL 3

Author Comment

by:mgronlund
ID: 6299234
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
0
 
LVL 3

Author Comment

by:mgronlund
ID: 6299246
AHHHHHH NEVERMIND I Found An Option That Did What I Need Thanks!
0
 
LVL 5

Expert Comment

by:KDivad
ID: 6299585
Great! Glad you got your problem worked out.
0
 
LVL 3

Author Comment

by:mgronlund
ID: 6299613
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

0
 
LVL 8

Expert Comment

by:DennisBorg
ID: 6299638
mgronlund: Thank you for this latest comment. It certainly adds value to the PAQ.
0
 
LVL 5

Expert Comment

by:KDivad
ID: 6299739
I agree. It's great when the asker posts their results back like this.
0
 
LVL 3

Author Comment

by:mgronlund
ID: 6300040
Try To Help Those That Help Me,... Have One Wuestion What Is The PING Messages?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question