event for smart minimize

  • Thread starter Thread starter C. Vollmer
  • Start date Start date
C

C. Vollmer

Hi,

just want to make shure that there is no event for the smart minimize. I
searched the newsgroup, but didn't find an answer.
Thanks,
Christoph
 
Hi Christoph,

You could use the 'Deactivate' event. This will happen whenever your form
goes into the background.

Hope that helps,
-Katie

--------------------
| From: "C. Vollmer" <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Subject: event for smart minimize
| Date: Mon, 20 Oct 2003 16:39:52 +0200
| Organization: T-Online
| Lines: 7
| Message-ID: <[email protected]>
| Mime-Version: 1.0
| Content-Type: text/plain; charset=us-ascii; format=flowed
| Content-Transfer-Encoding: 7bit
| X-Trace: news.t-online.com 1066716003 07 7117 -S8yV1KSSeaNAD 031021
06:00:02
| X-Complaints-To: (e-mail address removed)
| X-ID: XcW8CvZfreYxzvweOUT4U2E2P7bp4RSVpCdUwvksoaXfr+0H1Ujn46
| User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.5)
Gecko/20031007
| X-Accept-Language: de-de, de, en-us, en
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsmm0
0.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:36407
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi,
|
| just want to make shure that there is no event for the smart minimize. I
| searched the newsgroup, but didn't find an answer.
| Thanks,
| Christoph
|
|

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Katie,

but my form also goes in the background when I just show a Messagebox.
Any other ideas?
Thanks,
Christoph
 
Hi Christoph,

Well - so for things like messageboxes and other modal dialogs, you can
test the Enabled state of your form in the event handler. What is it you
want to do in this event?

-Katie

--------------------
| From: "C. Vollmer" <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Subject: Re: event for smart minimize
| Date: Wed, 29 Oct 2003 17:52:08 +0100
| Organization: T-Online
| Lines: 54
| Message-ID: <[email protected]>
| References: <[email protected]>
<[email protected]>
| Mime-Version: 1.0
| Content-Type: text/plain; charset=us-ascii; format=flowed
| Content-Transfer-Encoding: 7bit
| X-Trace: news.t-online.com 1067446501 01 11563 AHqNVI0TSOA93M 031029
16:55:01
| X-Complaints-To: (e-mail address removed)
| X-ID: VTZ53GZ6reIxtLO+R+gn-UQ8AeM4QVzmT943cqi3fmzaEfFx1ZtN8R
| User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.5)
Gecko/20031007
| X-Accept-Language: de-de, de, en-us, en
| In-Reply-To: <[email protected]>
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsmm0
0.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:37180
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi Katie,
|
| but my form also goes in the background when I just show a Messagebox.
| Any other ideas?
| Thanks,
| Christoph
|
| Katie Schaeffer [MSFT] schrieb:
|
| > Hi Christoph,
| >
| > You could use the 'Deactivate' event. This will happen whenever your
form
| > goes into the background.
| >
| > Hope that helps,
| > -Katie
| >
| > --------------------
| > | From: "C. Vollmer" <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.compactframework
| > | Subject: event for smart minimize
| > | Date: Mon, 20 Oct 2003 16:39:52 +0200
| > | Organization: T-Online
| > | Lines: 7
| > | Message-ID: <[email protected]>
| > | Mime-Version: 1.0
| > | Content-Type: text/plain; charset=us-ascii; format=flowed
| > | Content-Transfer-Encoding: 7bit
| > | X-Trace: news.t-online.com 1066716003 07 7117 -S8yV1KSSeaNAD 031021
| > 06:00:02
| > | X-Complaints-To: (e-mail address removed)
| > | X-ID: XcW8CvZfreYxzvweOUT4U2E2P7bp4RSVpCdUwvksoaXfr+0H1Ujn46
| > | User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.5)
| > Gecko/20031007
| > | X-Accept-Language: de-de, de, en-us, en
| > | Path:
| >
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsmm0
| > 0.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.dotnet.framework.compactframework:36407
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
| > |
| > | Hi,
| > |
| > | just want to make shure that there is no event for the smart
minimize. I
| > | searched the newsgroup, but didn't find an answer.
| > | Thanks,
| > | Christoph
| > |
| > |
| >
| > This posting is provided "AS IS" with no warranties, and confers no
rights.
| >
|
|

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Katie said:
Hi Christoph,

Well - so for things like messageboxes and other modal dialogs, you
can test the Enabled state of your form in the event handler. What
is it you want to do in this event?

Well what about when other application started on top of your
application?
Nway at some time, I was also looking for such an event. For
application users "smart minimize" is as good as closing the
application. So at this stage, application can save user's unsaved work.
After some research, my conclusion was that getting this event is not
possible simply because OS does not support it. Correct me if I am
wrong.

-Vinay.
 
Hi Vinay,

Ah - I thought you also wanted to trap when other programs were started,
which resulted in your application getting minized.
So - Are you aware that if you set MinimizeBox = false, you'll get an 'ok'
instead of a smart minimize. When users click on the 'ok', your app will
actually close. Purhaps you should use this and then save unsaved work
when your application really closes.

-Katie

--------------------
| From: "Vinay Chaudhari" <[email protected]>
| Subject: Re: event for smart minimize
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| User-Agent: XanaNews/1.15.6.2
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Date: Wed, 29 Oct 2003 21:48:22 -0800
| NNTP-Posting-Host: 202.88.167.97
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:37252
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Katie Schaeffer [MSFT] wrote:
|
| > Hi Christoph,
| >
| > Well - so for things like messageboxes and other modal dialogs, you
| > can test the Enabled state of your form in the event handler. What
| > is it you want to do in this event?
|
| Well what about when other application started on top of your
| application?
| Nway at some time, I was also looking for such an event. For
| application users "smart minimize" is as good as closing the
| application. So at this stage, application can save user's unsaved work.
| After some research, my conclusion was that getting this event is not
| possible simply because OS does not support it. Correct me if I am
| wrong.
|
| -Vinay.
|

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Katie said:
Hi Vinay,

Ah - I thought you also wanted to trap when other programs were
started, which resulted in your application getting minized.
So - Are you aware that if you set MinimizeBox = false, you'll get an
'ok' instead of a smart minimize. When users click on the 'ok', your
app will actually close. Purhaps you should use this and then save
unsaved work when your application really closes.

-Katie

Thanks Katie for the suggestion.
It would have been great if I could do that. But unfortunately, .NET CF
applications shows high load time. Load time increases further when u
have complex form and u also need to load the data. Putting up a nice
splash screen cannot hide the fact that ur application is slow compared
to others (e.g. tasks, explorer, word, excel etc.).
I have tried to do all kind of things : form code optimizations (hell,
its log time since I used forms designer. I write the all form code by
hand.), loading controls late, loading data late etc. I was
unsuccessful to bring the load time less than 8 seconds on my Toshiba
PPC 2002 and we thought that this is not acceptable. So we sat and said
ok we cannot bring load time to acceptable level, so what can we do?
hence now we turned around our thinking and tried to push as much as
into the load time saying that it will be done only once and
application will remain memory till user boots the device, anyway its
what even a complient application is supposed to do. As far as saving
data goes, we have to content with giving explite save menu.

-Vinay.
 
Hi Katie,

I tried the Enabled property, but it seems to be true regardless wether
I show a Messagebox or I minimize the form.
The problem is, that, with my iPAQ, there is this "Minimize all"
functionality. So, when this is done and I start my app again, it shows
the last opened window. Fine, but when I minimize this it shows again
the start screen, because this window is minimized. But it should show
the window that is "logically" behind the last opened (and now
minimized). So I wanted to create a FILO stack for my windows, but I
can't find a way to decide when my window is put from the stack (because
it got minimized). I hope you understood the problem.
Maybe you have a totallly different solution?
Thanks,
Christoph
 
Hi, Vinay,

Wow! eight seconds is pretty good for a complex app. Does that include the
time it takes to initialize the .NET CF runtime? Also, what's the
configuration of the devices? Don't forget that PPC 2002 on a PXA-250 XScale
will be pretty sluggish to begin with. =)

Otherwise, I'd say eight seconds is a pretty good timeframe for an app to
start up - especially if that includes initialization of the .NET CF. I am
working on an app on a 133 mHz Jornada 548, and init times for the .NET CF
engine alone was around six to eight seconds. I believe it took about twelve
seconds to initialize the runtime, create a database with four tables and
two foreign keys, and display a message box. That was with no code
optimization and no Windows Forms. The application itself will take even
longer since it will do all of that plus prefill two of the tables, create a
Windows Form, create the controls, and display information on the main form
from the database. I figure even with code optimizations, I'll be doing good
to get the init time under 15 seconds.

Flynn
 
Hi Flynn,

Whether 8 or 15 seconds is good startup time for .NET CF is a mute
point. Your user has to deal with ur application and we cannot justify
high load time to him telling that its good because its developed in
..NET CF. You know, .NET CF app's load time really look bad when u
compare them with other typical applications available on PPC i.e.
calender, pocket word, excell etc. Ur user won't know (or don't need to
know) these applications comes from ROM, developed in eVC or whatever,
perhaps pre-loaded(?). All he cares is that these app r running
boom-boom and heres ur application - pathetically slow. The Worst thing
, he perceives it slow/sluggish even when its working just because it
has slow startup and he has already made up the conclusion.

-Vinay.
 
Hi, Vinay

Heh! I understand those issues. I guess I was speaking more from a
developer's perspective.

For me, I don't plan on developing enterprise applications or anything
like that. I'm mostly developing small applications for myself or for
small groups of people. Most of my potential users are people who are
aware of the differences between the different types of applications and
memories. For me, it's much easier to use eVB or .NET CF since I've just
never been able to grasp eVC (or Visual C++ in general).

I would be interested in seeing some of the optimizations you've been
using in your applications, if that's not a problem. I'm always
interested in seeing different coding practices and designs. If I can
squeeze a little more speed out of my apps, I'm sure even the patient
people I normally work with will appreciate the difference. =)

Flynn
 
Hi Flynn,
I would be interested in seeing some of the optimizations you've been
using in your applications, if that's not a problem. I'm always
interested in seeing different coding practices and designs. If I can
squeeze a little more speed out of my apps, I'm sure even the patient
people I normally work with will appreciate the difference. =)

Flynn


My optimizations are pretty obvious things.

1. You re-arrange the form-designer generated code as adviced on MSDN
site.
2. Try to do late loading of controls if applicable. For example, I was
using multiple tabs. So each tab is prepeared when it is clicked first
time. Also, there were dialogs and I created the dialog form when shown
for the first time.
3. Load your data as late as possible. In my case, I was using XML
files to store the patient data. I have organised one xml file per one
patient and then one xml file to act as a list or index file. (This
ofcourse also help me to do selective transfer(import/export) with
desktop system). So in app load, I will only load list file to display
patient list. Whenever, user want to edit/open particular patient, at
that point the patient's data will be loaded.
4. Data is also loaded late into controls. So whenever some tab or grid
is shown for the first time, data for those controls is loaded into
them from in-memory dataset. I initially used data-bindings but found
that it makes app noticebaly slow. So I used code to fill the data into
the control & extract from the control. For example, <cntrl>.text =
<row>.item(0).ToString etc.
5. Also, I found that while reading XML files, infering schema was
taking time. So I create schema for the data-set by code and then load
the xml file (w/o schema) with ignoreSchema option.
6. This is a gimmic or a trick. You put a splash screen at app load
time and change mouse cursor to wait cursor.

The general advice for optimizations remain same. Profile ur
application and identify the code areas that take more time and try to
improve that code area by re-writing/re-designing the code area or some
times re-writing/re-organizing/re-designing part of or even entire
application.
To profile my app, I used a simple log file to log
environment.tickcounts with some message and then wrote a simple
desktop program which will show me log file contents in better form.

Said all this, I have to revert some optimizations (like loading
controls late and creating dialogs late) because load time was still
not-acceptable so why not increase it little bit.

-Vinay.
 
Back
Top