controlling application visibility (also, terminology questions)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On PocketPC2003, applications generally have a cross-in-circle icon in the
upper right corner. Selecting the icon "dismisses" the application, but it is
still in memory.

I have a C# ARMv4 PocketPC application where I would like to
programmatically "dismiss" the window at a certain point, and bring PocketIE
to the foreground, but have not been able to understand which commands to
use. (I figure some event must be raised that I can handle.)

Of course, later, I want to bring the application back to the foreground.

Can someone help me with the terminology ("cross-in-circle icon", "dismiss",
"deactivated", "inactive", "reactivated", etc.), and point me to the right
method/event?

Many thanks.
 
Rich,

The "Cross in Circle" you describe represents minimizing a running pocket pc
app.

If you set a form's minimizebox property to false while ControlBox is true,
this changes the graphic in the upper right corner of your form to "Ok in a
Circle",
which represents actually exiting the application.

You can achive this behavior by calling Application.Exit() in your code as
well, although Microsoft "Designed for Windows Mobile" standards dictate
that your application not do that.

If you want to manually minimize a running application, you can
call Form.Hide() on each form in the application. If PIE happens to be open
at the bottom of this stack of running forms, it will end up in the
foreground.

Of course you things to be more predictable than that, so what you want to
do
is determine if PIE is running (many posts in this newsgroup in terms of
inspecting running programs on a PPC) and then activate it in your code. If
it is not running, you can start it from within C# and it will come to the
foreground.

Use Advanced Search on Google Groups to get samples. Here's a start:
http://www.google.com/groups?as_q=m...c.dotnet.framework.compactframework&lr=&hl=en

-Darren
 
Darren,
Thanks. I will check out the link.

I do already know how to exit the application, but as you point out, that is
not what Microsoft standards dictate (nor is it what I want). I just want to
push the application to the background, just as with the built in Calendar
application. I did already try
this.Hide();
where "this" is an instance of my main form class
(System.Windows.Forms.Form) but when I went to Start > Settings > System >
Memory > Running Programs
I did not see the application in the list (although the other running
programs, "File Explorer", ActiveSync", and "Calendar", etc. were all
visible).

(By the way, if I run the application form and minimize it with the
"circle-in-cross", and then do Start > Settings > System > Memory > Running
Programs, I *do* see the application name in the list with the others.)

Any idea why the application name did not appear in the list after calling
this.Hide();
?
 
Darren,
Thanks for the reply. I am slogging through the Google links but so far most
are deadends (the info is not longer available.) I will continue though.

In the meantime, a followup question:
I am good with the Microsoft standard that the application remain loaded in
memory - in fact that is exactly what I want.
I was puzzeled earlier in the day before creating my post because I tried
this.Hide();
where "this" is the instance of the main form (System.Windows.Forms.Form) of
my application.
What I noticed was that before calling "Hide", I could see my application in
Start > Settings > System > Memory > Running Programs
along with other applications, such as "File Explorer", ActiveSync", and
"Calendar".
However, after calling "Hide", my application no longer appeared there. The
other three programs remained. I have plenty of memory (27.9 MB allocated,
11.8 MB in use, 16.1 MB free). What do you think went wrong?
-Rich
 
OK.

It looks as though there is not good documentation around just how to
control applications/forms on the PocketPC platform. For example, I saw a
newsgroup post that said: "If you hide the window, it will not show up in the
task list." I am not sure why that is, but if I call
this.Hide();
this.Show();
the window is pushed back, but the application does then appear in the
"Running Programs" list, which is nearly what I want (though not very
intuitive).

I also see that I can go with a 3rd party library (opennetcf.org) to return
to PIE.

Of course, I would much rather have a straightforward Microsoft API to
handle these switch-between-application actions.

Off I go...

Thanks again for your help.
 
Back
Top