Results 1 to 7 of 7

Thread: splash screen

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    93

    splash screen

    if i have created a splash screen, how can i make it disappear after loading?

  2. #2
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: splash screen

    Do you mean fade away, or just dissapear?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    93

    Re: splash screen

    ermm
    fade away

  4. #4
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: splash screen

    This is supposed to only work with Windows 2000 or later.

    VB Code:
    1. Const LWA_ALPHA = &H2
    2. Const GWL_EXSTYLE = (-20)
    3. Const WS_EX_LAYERED = &H80000
    4. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
    5. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    6. Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
    7. Private Sub FadeWindow(Percentage As Integer)
    8.     SetLayeredWindowAttributes Me.hWnd, 0, 255 - (2.55 * Percentage), LWA_ALPHA
    9. End Sub
    10. Private Sub Form_Unload(Cancel As Integer)
    11.     Dim x As Integer
    12.    
    13.         'So we can change the alpha of the window
    14.         SetWindowLong Me.hWnd, GWL_EXSTYLE, GetWindowLong(Me.hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED
    15.        
    16.     For x = 0 To 100
    17.         'So the program doesn't stop responding
    18.         DoEvents
    19.         'Fade the window
    20.         FadeWindow x
    21.     Next
    22. End Sub

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    93

    Re: splash screen

    ermmm
    sorry i am not good at such stuff
    but where to change ur code with respect to the splash screen i have?

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    93

    Re: splash screen

    andrew G
    can u make a sample program and zip it for me to download and test?
    thanks

  7. #7
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: splash screen

    Ok Try this. All i basically did was copy and paste the code straight into the splash screen's declarations.
    Attached Files Attached Files

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