windows gui shown between forms: different behaviour in ppc and wce4.1

  • Thread starter Thread starter Matteo Cima
  • Start date Start date
M

Matteo Cima

Hi,
this is a repost, my previous question was incomplete.

I have some forms that return values, showing a list and then returning a
string when the user confirms, and to be sure that the form doesn't remain
in memory, i use this code: (the form is closed when i return the value)

i declare a public method that returns a string
and i call it from the client form in this way :

//this is in clientform
string mReturnValue = "";
using(frmThatReturnsValue myForm = new frmThatReturnsValue())
{ mReturnValue =myForm .getValue();}
myTextBox.Text = mReturnValue;

and this is somewhat a clean way.
I am aware that this isn't "correct" compactframework programming because it
implies to load and then dispose the form, but i need this behaviour.
Anyway,
in CE.NET 4.1 this works just fine, the client form with myTextBox returns
on screen when the frmThatReturnsValue is closed.
while in PPC the windows gui gets the focus, and there's no way to return to
my app, (except clicking again on its icon)

Is that behavior by design?

Any help appreciated,
Matteo Cima.
 
Hi Matteo,

What do you mean by 'windows gui'? Do you mean the home screen? Make sure
your forms don't have BorderStyle=none (this is a special state reserved
for popup forms, and the z-order of the forms is handled differently by the
os).

-Katie

--------------------
| From: "Matteo Cima" <[email protected]>
| Subject: windows gui shown between forms: different behaviour in ppc and
wce4.1
| Date: Thu, 30 Oct 2003 17:37:29 +0100
| Lines: 31
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: 62.94.140.163
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:37329
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi,
| this is a repost, my previous question was incomplete.
|
| I have some forms that return values, showing a list and then returning a
| string when the user confirms, and to be sure that the form doesn't remain
| in memory, i use this code: (the form is closed when i return the value)
|
| i declare a public method that returns a string
| and i call it from the client form in this way :
|
| //this is in clientform
| string mReturnValue = "";
| using(frmThatReturnsValue myForm = new frmThatReturnsValue())
| { mReturnValue =myForm .getValue();}
| myTextBox.Text = mReturnValue;
|
| and this is somewhat a clean way.
| I am aware that this isn't "correct" compactframework programming because
it
| implies to load and then dispose the form, but i need this behaviour.
| Anyway,
| in CE.NET 4.1 this works just fine, the client form with myTextBox returns
| on screen when the frmThatReturnsValue is closed.
| while in PPC the windows gui gets the focus, and there's no way to return
to
| my app, (except clicking again on its icon)
|
| Is that behavior by design?
|
| Any help appreciated,
| Matteo Cima.
|
|
|

This posting is provided "AS IS" with no warranties, and confers no rights.
 
hi! sorry for the typing mistakes but i broke my arm friday... :'(
Yes, my form do have border style set to none... my app must run on both
cenet family and ppc family... and has to be fullscreen, absolutely no
access to other programs alowed to the user (custom app, like kiosk mode)
and i found that borderstyle=none is necessary for _real_ fllscreen.
Yes, for windows gui i mean the home screen or the file browser window...
the last window appeared just before launching my app.
and in ce.net 4.1 this doesn't happen.

any ideas?
Matteo.
 
Hi Matteo,

So we have a bug where we require you to use BorderStyle=None to get a
fullscreen form on wince. Unfortunately BorderStyle=None on PPC will have
the z-order effect you describe. You can try a PInvoke of SetActiveWindow
or SetForegroundWindow, or special case your code to only set
BorderStyle=None on wince.

Hope that helps,
-Katie

--------------------
| From: "Matteo Cima" <s>
| References: <[email protected]>
<[email protected]>
| Subject: Re: windows gui shown between forms: different behaviour in ppc
and wce4.1
| Date: Sun, 2 Nov 2003 11:04:23 +0100
| Lines: 89
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: adsl-62-123-117-213.dial.atlanet.it 62.123.117.213
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:37485
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| hi! sorry for the typing mistakes but i broke my arm friday... :'(
| Yes, my form do have border style set to none... my app must run on both
| cenet family and ppc family... and has to be fullscreen, absolutely no
| access to other programs alowed to the user (custom app, like kiosk mode)
| and i found that borderstyle=none is necessary for _real_ fllscreen.
| Yes, for windows gui i mean the home screen or the file browser window...
| the last window appeared just before launching my app.
| and in ce.net 4.1 this doesn't happen.
|
| any ideas?
| Matteo.
|
|
| "Katie Schaeffer [MSFT]" <[email protected]> ha scritto nel
| messaggio | > Hi Matteo,
| >
| > What do you mean by 'windows gui'? Do you mean the home screen? Make
| sure
| > your forms don't have BorderStyle=none (this is a special state reserved
| > for popup forms, and the z-order of the forms is handled differently by
| the
| > os).
| >
| > -Katie
| >
| > --------------------
| > | From: "Matteo Cima" <[email protected]>
| > | Subject: windows gui shown between forms: different behaviour in ppc
and
| > wce4.1
| > | Date: Thu, 30 Oct 2003 17:37:29 +0100
| > | Lines: 31
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.compactframework
| > | NNTP-Posting-Host: 62.94.140.163
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.dotnet.framework.compactframework:37329
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
| > |
| > | Hi,
| > | this is a repost, my previous question was incomplete.
| > |
| > | I have some forms that return values, showing a list and then
returning
| a
| > | string when the user confirms, and to be sure that the form doesn't
| remain
| > | in memory, i use this code: (the form is closed when i return the
value)
| > |
| > | i declare a public method that returns a string
| > | and i call it from the client form in this way :
| > |
| > | //this is in clientform
| > | string mReturnValue = "";
| > | using(frmThatReturnsValue myForm = new frmThatReturnsValue())
| > | { mReturnValue =myForm .getValue();}
| > | myTextBox.Text = mReturnValue;
| > |
| > | and this is somewhat a clean way.
| > | I am aware that this isn't "correct" compactframework programming
| because
| > it
| > | implies to load and then dispose the form, but i need this behaviour.
| > | Anyway,
| > | in CE.NET 4.1 this works just fine, the client form with myTextBox
| returns
| > | on screen when the frmThatReturnsValue is closed.
| > | while in PPC the windows gui gets the focus, and there's no way to
| return
| > to
| > | my app, (except clicking again on its icon)
| > |
| > | Is that behavior by design?
| > |
| > | Any help appreciated,
| > | Matteo Cima.
| > |
| > |
| > |
| >
| > 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.
 
Alex Yakhnin posted this code a while back - search google groups for
"compactframework full screen" for more info. I have not verified the code
but it looks correct to me. Just replace "Desktop" with your form name.
You may even want to do something like this.Text = "FindMeNow", use that
text in FindWindow, then change the text back just to be explicit about it.
Also, GDI.GetFocus is another P/Invoke you will have to create.

[DllImport("coredll.dll")]
internal static extern IntPtr FindWindow(String lpClassName, String
lpWindowName);

[DllImport("coredll.dll")]
internal static extern int SetForegroundWindow(IntPtr hWnd);


public bool FullScreen
{
set
{
if (value)
{
this.MaximizeBox = false;
this.MinimizeBox = false;
IntPtr deskWin = FindWindow(null, "Desktop");
SetForegroundWindow(deskWin);
this.Focus();
SetForegroundWindow(GDI.GetFocus());
}
else
{
this.MaximizeBox = true;
this.MinimizeBox = true;
this.Refresh();
}
}
}

=========================================

Set this property in your form Load event:

private void Form1_Load(object sender, System.EventArgs e)
{
this.FullScreen = true;
}

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.aspx

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

So we have a bug where we require you to use BorderStyle=None to get a
fullscreen form on wince. Unfortunately BorderStyle=None on PPC will have
the z-order effect you describe. You can try a PInvoke of SetActiveWindow
or SetForegroundWindow, or special case your code to only set
BorderStyle=None on wince.

Hope that helps,
-Katie

--------------------
| From: "Matteo Cima" <s>
| References: <[email protected]>
<[email protected]>
| Subject: Re: windows gui shown between forms: different behaviour in ppc
and wce4.1
| Date: Sun, 2 Nov 2003 11:04:23 +0100
| Lines: 89
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: adsl-62-123-117-213.dial.atlanet.it 62.123.117.213
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:37485
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| hi! sorry for the typing mistakes but i broke my arm friday... :'(
| Yes, my form do have border style set to none... my app must run on both
| cenet family and ppc family... and has to be fullscreen, absolutely no
| access to other programs alowed to the user (custom app, like kiosk mode)
| and i found that borderstyle=none is necessary for _real_ fllscreen.
| Yes, for windows gui i mean the home screen or the file browser window...
| the last window appeared just before launching my app.
| and in ce.net 4.1 this doesn't happen.
|
| any ideas?
| Matteo.
|
|
| "Katie Schaeffer [MSFT]" <[email protected]> ha scritto nel
| messaggio | > Hi Matteo,
| >
| > What do you mean by 'windows gui'? Do you mean the home screen? Make
| sure
| > your forms don't have BorderStyle=none (this is a special state reserved
| > for popup forms, and the z-order of the forms is handled differently by
| the
| > os).
| >
| > -Katie
| >
| > --------------------
| > | From: "Matteo Cima" <[email protected]>
| > | Subject: windows gui shown between forms: different behaviour in ppc
and
| > wce4.1
| > | Date: Thu, 30 Oct 2003 17:37:29 +0100
| > | Lines: 31
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.compactframework
| > | NNTP-Posting-Host: 62.94.140.163
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.dotnet.framework.compactframework:37329
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
| > |
| > | Hi,
| > | this is a repost, my previous question was incomplete.
| > |
| > | I have some forms that return values, showing a list and then
returning
| a
| > | string when the user confirms, and to be sure that the form doesn't
| remain
| > | in memory, i use this code: (the form is closed when i return the
value)
| > |
| > | i declare a public method that returns a string
| > | and i call it from the client form in this way :
| > |
| > | //this is in clientform
| > | string mReturnValue = "";
| > | using(frmThatReturnsValue myForm = new frmThatReturnsValue())
| > | { mReturnValue =myForm .getValue();}
| > | myTextBox.Text = mReturnValue;
| > |
| > | and this is somewhat a clean way.
| > | I am aware that this isn't "correct" compactframework programming
| because
| > it
| > | implies to load and then dispose the form, but i need this behaviour.
| > | Anyway,
| > | in CE.NET 4.1 this works just fine, the client form with myTextBox
| returns
| > | on screen when the frmThatReturnsValue is closed.
| > | while in PPC the windows gui gets the focus, and there's no way to
| return
| > to
| > | my app, (except clicking again on its icon)
| > |
| > | Is that behavior by design?
| > |
| > | Any help appreciated,
| > | Matteo Cima.
| > |
| > |
| > |
| >
| > 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.
 
Back
Top