Slow application start time after losing focus.

  • Thread starter Thread starter fhunter
  • Start date Start date
F

fhunter

If we close/minimaze our application using the Home
button, and then we restart/maximaze the application by
selecting it on the TopBar of the phone's main screen the
application takes a long time to "reload".
What affects this reload time? We are not doing anything
on OnGotFocus(). It apears that it takes a long time even
before it gets to any of our code. Any ideas? How can we
speed this process up? Is this a Compact Framework issue?

Thanks
 
Upon CF application startup mscoree.dll loaded into this application's
context looks for a hidden window that gets created when you app
initialization is completed. This hidden window is created automatically
behind the scenes. It's title is set to the full path of your app
executable. If such window is found (meaning that the application is already
running), mscoree sends a message to this window. Upon receiving that
message the application is brought to foreground. There is no reason for
this process to take a lot of time unless something funky is done inside
your app on some of the form events. Aside of GotFocus do you process things
like Resize, Activate etc?
 
That's what I kind of assumed it was doing.
I don't process anything other than OnKeyUp! :(.
That's why I was lost as to what to look for.

Any other ideas?

Anything to do with memory
 
It seems strange too. It actually takes longer, over
twice the time to restart/maximaze the application than
to actually turn it clear off and then on.

Postentially I could just do that right? I could exit the
app on OnLostFocus() and have it restart every time.
Would this pass certification though?

Thanks
 
You can look in the Control Panel/System/Memory and compare values before
and after
 
You are going to receive LostFocus event even when the user simply opens the
start menu and then closes it. You don't really want to close the app just
because someone opened the start menu...
 
Thansk for the heads up, I did not think of this.
But my application is full screen, so then there will be
no way for the user to open the start menu unless he
presses "home" first or the "red phone" button.
So it would still be ok, right?
 
Alex,

Looks like its using about 1.22 Megs, Do you think this
might be the problem?
It still seems strange for it to take longer to relaunch
than to start from scratch. We must be doing something it
really does not like.

Any ideas?

Thanks
 
Back
Top