No focus after start

machinogodzilla

Active member
Joined
Mar 3, 2007
Messages
25
Programming Experience
Beginner
Hi!


My program cosists of two forms. One of them works as a splash screen.
After the program starts up first the splash screen appears and then my
main form but with no focus despite there are no other windows on the
screen and the splash screen has been closed.

What causes such behaviour?

Just to add that when debugging it all works properly, but when I start
the exe file it is like that.


Regards,
machinogodzilla
 
How have you implemented the splash screen?
Did you use the Application framework new to V2?
We would really need more information to be able to diagnose.
 
How have you implemented the splash screen?
I ve found it here:

Menu: Project -> Properties -> Application -> Splash Screen

When I select "none" everything works as it should.


Did you use the Application framework new to V2?
I have no idea ;-) Maybe it is this what you are asking about:

Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727
 
====>> resolved <<====

Hi!


I ve found the reason why it didn't have focus after start.

My splash screen form was playing a wav file that was longer than
the time the splash screen was shown and with the speakers off it was
hard to link the two things ;-)

Playing with Me.TopMost on the main form solved the problem.


Thanks for your interest!

Best regards,
machinogodzilla
 
seems strange to have the wav file playing after the splash screen has gone away. I personally wouldn't like a program that played a wav file at startup, simply because it adds to the startup time. And I hope you give the user the option of turning off the splash screen.

Since you use the properties pages, you are using the application framework new to V2. Previously it was necessary to write the code yourself to show a splash screen.
 
seems strange to have the wav file playing after the splash screen has gone away
I didn't expect that either but it is an extra effect for my program :)

I personally wouldn't like a program that played a wav file at startup, simply because it adds to the startup time.
This is just a demo for my homework so no worries, but it is very interesting
what you are saying. 15 years have passed since my first contact with
a computer and still despite computers are so powerful now a little wave
file couses concerns :D That must be magic of Microsoft - forever slow.

I remeber stuff from demoscene from times of Amiga and C64 packed
with music, sounds and 3d graphics and it all worked brilliant. Now with
my 1.6GHz CPU I have to wait ages for VB's IDE to draw a BUTTON.
And all those buttons were in Win 3.11 too working on my SX25Mhz.

Maybe I know too little but it all seems just not right to me.

Previously it was necessary to write the code yourself to show a splash screen.
I still had to add some code in "Application Events" to determine the time
of the splash screen to be shown.
 
Topmost is probably NOT what you want to do, it causes trouble with other applications (when not intended), instead try Me.Activate from main form Shown event.
 
15 years have passed since my first contact with a computer and still despite computers are so powerful now a little wave
file couses concerns :D That must be magic of Microsoft - forever slow.

I remeber stuff from demoscene from times of Amiga and C64 packed
with music, sounds and 3d graphics and it all worked brilliant. Now with
my 1.6GHz CPU I have to wait ages for VB's IDE to draw a BUTTON.
And all those buttons were in Win 3.11 too working on my SX25Mhz.
I usually don't respond to these types of posts but today I'm feeling brave :).

The programs (including IDEs) today as compared to ones 15 years ago do far more so of course they take more time to startup and do things. Plus we have become used to things happening quicker, so we notice any lag now whereas we were probably more forgiving 15 years ago.
Music has it's place; such as in games. If you are making a game of any real value, you probably want to use DirectX which handles music and graphics very well (and it was developed by guess who, Microsoft). Oh, by the way a 1.6GHz CPU is considered slow by todays standards; and you probably only have one CPU.

I realize now you are just learning so it's actually good to throw things in that may not need to be in the program; it's a way to learn. Since you are learning realize that just because something is cool to develop such as a splash screen or adding music, your users may not think so and you should give them the option to turn them off. Something else to learn. :)
 
we have become used to things happening quicker
Yes, I have, and I miss those times, because now I have to wait much
longer for my system to be ready, than years ago. And this is literally longer
and not just my feeling.

Games are a different story, they always wanted more and more resources.
Same video compression and decompression, and image processing.

But why do I need to have 3GHz Duo Core with 1GB of RAM to handle my
OS now to run all those other programs and office programs (all IDEs) that
I use to run on my 600MHz with 256MB RAM and Win98 on it successfully?

Because when you [Microsoft] are provided with more power then you
become lazy. More power can handle bulky, chunky, ugly, slow programs
which old systems could handle well if they only were created properly.
And I can bet there is money issue somewhere there too.

That's my point of view ;) (infulenced a bit by my first impression of
OOP in a form of VB.NET). We don't have to discuss it further cos this
forum is not about philosophy but vb. I just wanted to say it after
so much time wasted just at looking at my computer struggling to draw
a bloody form every time I switch to design mode :)

Since you are learning realize that just because something is cool to develop such as a splash screen or adding music, your users may not think so and you should give them the option to turn them off. Something else to learn
Yep, this is obviously right when you think about proper programs that are
supposed to do something useful. But the splash screen annoys me less
than this:

http://www.vbdotnetforums.com/showthread.php?t=19259

In short, everything blinks and flickers badly not only in desing mode while
programming but also when the ready program runs. And this is not very
advanced program (and no sound in the background ;)). And it flickers
on other computers too but faster :D
 
Back
Top