Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom splash screen in VB 6.0

Status
Not open for further replies.

0LaoyanG0

MIS
Nov 12, 2002
25
US
I need to make a custom splash screen. The purpose is to deter users from clicking on other apps before the login process finishes. So what we want the splash screen to do is not allow users to click off/away from the form till a given amount of time has expired then exit by itself (without users intervention). Is that possible?
I have tried playing around with modal message boxes and modal forms but it required the user to click a button then exits.
Any sugestions would help.
Also, I am using VB 6.0 because this splash screen will be used on Citrix PS4 server and PS4 does not work with .Net 2.0. Doing it in VS .Net is not an option.

I am also not against using an IE form. I just can't figure out how to make it stay as the active window all the time.


Thanks
 
How much time do you need?
If not much, what about the Timer?

Set Timer's interval to whatever you need, and in click event of a command button, set Timer.Enabled = True

Code:
Private Sub Timer1_Timer()
    FormMain.Show  [green]'shows first Form[/green]
    Unload Me
End Sub

Have fun.

---- Andy
 
I tried that with a SystemModal message box and if the user does not click OK on the message box, the timer never triggers and therefore never ends/unloads. I wish it would've been that simple thogh. Thanks for your reply.
 
There is a default Splash Screen in Visual Studio that has this code in it.

Code:
Option Explicit

Private Sub Form_KeyPress(KeyAscii As Integer)
    Unload Me
End Sub

Private Sub Form_Load()
    lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
    lblProductName.Caption = App.Title
End Sub

Private Sub Frame1_Click()
    Unload Me
End Sub

Add a timer to that

-David
2006 & 2007 Microsoft Most Valuable Professional (MVP)
2006 Dell Certified System Professional (CSP)
 
Try this:

'IMPORTANT set the timer interval to 1000 in the properties window before trying this.

'paste this code in a form with a timer object

Code:
Private Declare Function BlockInput Lib "USER32" (ByVal fBlock As Long) As Long
Dim timerCount As Integer

Private Sub Form_Load()
   timerCount = 0
   Me.MousePointer = 11
   BlockInput True
End Sub

Private Sub Timer1_Timer()
   'block user input for 10 seconds
   timerCount = timerCount + 1
   If timerCount = 10 Then
      BlockInput False 'returns mouse control to user
      Unload Me
   Else
   End If
End Sub
 
I wouldn't mess with timers, personally.

This sequence is simple, and should work. Best to execute it from Sub Main.

1. Show login form.
2. Hide login form, show splash screen. Note that while the splash screen is showing it is the only visible screen.
3. Do your login stuff. Any forms that need to be initiatlized should be loaded rather than shown (use load myForm rather than myForm.Show).
4. Unload splash screen, show main form.

HTH

Bob
 
Sorry, I didn't read carefully enough. It goes against Microsoft standards to prevent users from clicking on other apps while something is going on in your app. I wouldn't recommend that you do this. I would do what I've just given, and let users go to other apps if they like.

So, why is that a bad idea in your mind? :)

Bob
 
Here's the reason we wnat to do this....
In a Citrix environment users log on and an initial application runs. This is just so the ICA client launches and the client gets directed/connected to the next available Citrix Server. That works great when the initial application finishes launching. This makes sure that when the user launches another app, it is launched on the current Citrix Server the users initially was logged into. Notice it is only one app that launches.
Now here's what we are seeing. Users don't wait and start opening other applications. Now the ICA client is asking for service for two apps at the same time. One app gets directed to one server and the other app gets directed to the next available server. Now there are two terminal service sessions open for that user. One user two logged on sessions. It's inefficient and when terminal services tries to save the users Terminal Services Profile, you get locked file errors everywhere.

If they are forced to wait till the initial application is done launching, there is no problem.
 
Can you not require the initial application to run as part of the login sequence, before giving initial control to the user?
 
Keep in mind that a timer is not required in my example above. You could just block user input then run your process and then re allow user input.
Also your reference to not being able find a suitable way to unload the form without user input sounds strange to me I have never encountered this problem. Of course if you are trying to unload from within a load procedure that would cause problems.

I would use a regular form add whatever image you want to it, and unload the form from within your procedure.

For Example:
Code:
Private Declare Function BlockInput Lib "USER32" (ByVal fBlock As Long) As Long

Private Sub Form_Load()  'SplashForm
      BlockInput True
      Call YourProcedure
End Sub

Public Sub YourProcedure()
      'Perform your procedure
      BlockInput False
      Unload SpashForm 
End Sub
 
Again, I would be careful doing that. It could be perceived as coercive in the way that, say, popup ads are.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top