Solved

Show splash screen at startup...................

Posted on 2004-10-10
7
665 Views
Last Modified: 2008-03-04
Hi all,
        I have developed an application using VB6......When my application is loaded it calls a few functions at Form_Load event. They include calling Compact and Repair for my database(Takes less then a Second)  as well as dialing an internet connection (GPRS connection) (Takes 8-10 Second) as well as reading some values from a huge database  (Takes 5-6 sec.) .
What I want is to display some Splash Screen displaying "Initializing" and showing progress when my program starts..... It should end when my initializing is completed.....
This is the code that I use for Interdial.......      
 InternetDial Me.hWnd, "UFone", 2&, HandleConnection, 0&

I have something like this now.......

Form_Load

SplashForm.show

Call ComapctAndRepair
Call InternetDial
Call InitializeValues

SplashForm.hide

end sub

Problems in this code::

1) The Internet Dial Screen is shown at the top of my Splash Screen. I want my splash screen to be on top of all other windows......
2) The Splash Screen is shown before the Main Form is displayed.......What I want is the main form to be showed first and then the splash screen with some animation (like progress bar)....So I want to know which event is fired after form_load is completed.......

0
Comment
Question by:imarshad
[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
7 Comments
 
LVL 8

Assisted Solution

by:mladenovicz
mladenovicz earned 50 total points
ID: 12274507
1) check Zorder method of form, or you can use API

Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Private Declare Sub 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)

Private Sub Form_Activate()
    'KPD-Team 1998
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    'Set the window position to topmost
    SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
End Sub
0
 
LVL 10

Assisted Solution

by:anv
anv earned 25 total points
ID: 12274519
>>The Internet Dial Screen is shown at the top of my Splash Screen. I want my splash screen to be on top of all other windows......

in the form load evenht of the splash screen add the code to open the Main Form...


>>...So I want to know which event is fired after form_load is completed.......

Form_activate event is fired after that..
u need to be careful since it gets fired even when u bring the focus back to this form from anither aplication or form..
0
 
LVL 13

Author Comment

by:imarshad
ID: 12274922
mladenovicz,
                   Your API code is working........

>>in the form load evenht of the splash screen add the code to open the Main Form...

I could not understand this point.....Do you mean that I set SplashForm as the startup form and then call MainForm.visible inside it?

Imran
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:anv
ID: 12274947
yes exactly imarshad

thats what i mean
0
 
LVL 32

Accepted Solution

by:
Erick37 earned 150 total points
ID: 12275617
You may also try running your startup events from the SplashForm like this...

Form_Load 'Main Form

    Show 'shows your main form first
    DoEvents

    SplashForm.Show vbModal 'Shows your splash screen second

end sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sub Form_Load() 'SplashForm
   
    With MainForm
    Me.ProgressBar1.Value = 0
    Me.ProgressBar1.Refresh

    .ComapctAndRepair
    ProgressBar1.Value = 25
    ProgressBar1.Refresh

    .InternetDial
    ProgressBar1.Value = 50
    ProgressBar1.Refresh

    MainFormInitializeValues
    ProgressBar1.Value = 99
    ProgressBar1.Refresh
    End With

    Unload Me

End Sub
0
 
LVL 3

Assisted Solution

by:Noel_Castillo
Noel_Castillo earned 25 total points
ID: 12283552
You could also create a sub Main on module and call the form at your desired order. Then set the Sub Main as your startup :)

Sub Main
   frmMainForm.Show
   frmSplashScreen.Show 1
   frmLogIn.Show 1
   ...
   ...
End Sub
0
 
LVL 13

Author Comment

by:imarshad
ID: 12316580
Sorry about the delay....I thought I had accepted the answer......

Imran
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Title # Comments Views Activity
using web browser with BING 40 148
Error with a code discussed on this page 5 48
backup program with robocopy 6 90
VB6 common control 6 sp6 object library not registerd 3 62
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

739 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