In C# Windows ce 6.0 How do I get my application to not be movable

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

Guest

Hi,

I have a windows application in C# running on Windows CE 6.0. I don't want
my application to be movable, resizeable or minimized. I just want it to be
static on the screen. How do I do it?
 
I think the route I'd try is to write an IMessageFilter and attach it to the
Form. That way you could throw away all requests to move, size or change
state.

The Smart Device Framework[1] provides a CF implementation of Application
that allows adding filters[2], and we have a sample (though not specifically
for this) on using an IMessageFilter to catch events[3].

--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com

[1] www.opennetcf.com/sdf
[2]
http://www.opennetcf.com/library/sdf/html/95e60c54-04b0-0cd2-fd97-7eca242d7d9c.htm
[3]
http://blog.opennetcf.org/ctacke/PermaLink,guid,3d964f44-dc0e-45b6-94b3-b8e065cc4ce3.aspx
 
Hi Chris,

Do you have a C# example?
--
Don


I think the route I'd try is to write an IMessageFilter and attach it to the
Form. That way you could throw away all requests to move, size or change
state.

The Smart Device Framework[1] provides a CF implementation of Application
that allows adding filters[2], and we have a sample (though not specifically
for this) on using an IMessageFilter to catch events[3].

--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com

[1] www.opennetcf.com/sdf
[2]
http://www.opennetcf.com/library/sdf/html/95e60c54-04b0-0cd2-fd97-7eca242d7d9c.htm
[3]
http://blog.opennetcf.org/ctacke/PermaLink,guid,3d964f44-dc0e-45b6-94b3-b8e065cc4ce3.aspx


Don said:
Hi,

I have a windows application in C# running on Windows CE 6.0. I don't
want
my application to be movable, resizeable or minimized. I just want it to
be
static on the screen. How do I do it?
 
Wouldn't you know it.. That's the only sample we've done in VB - everything
else has been in C# - and we've gottne complaints from the VB guys. Let me
see if I can create a C# sample for you.

-Chris


Don said:
Hi Chris,

Do you have a C# example?
--
Don


I think the route I'd try is to write an IMessageFilter and attach it to
the
Form. That way you could throw away all requests to move, size or change
state.

The Smart Device Framework[1] provides a CF implementation of Application
that allows adding filters[2], and we have a sample (though not
specifically
for this) on using an IMessageFilter to catch events[3].

--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com

[1] www.opennetcf.com/sdf
[2]
http://www.opennetcf.com/library/sdf/html/95e60c54-04b0-0cd2-fd97-7eca242d7d9c.htm
[3]
http://blog.opennetcf.org/ctacke/PermaLink,guid,3d964f44-dc0e-45b6-94b3-b8e065cc4ce3.aspx


Don said:
Hi,

I have a windows application in C# running on Windows CE 6.0. I don't
want
my application to be movable, resizeable or minimized. I just want it
to
be
static on the screen. How do I do it?
 
On Wed, 23 May 2007 06:17:02 -0700, Don

try this (yuo must translate to C#)

Protected Overrides Sub WndProc(ByRef m As Message)
Const WM_NCLBUTTONDOWN As Integer = 161
'Const WM_SYSCOMMAND = 274
Const HTCAPTION As Integer = 2
Const SC_MOVE As Integer = 61456

'If (m.Msg = WM_SYSCOMMAND) And (m.WParam.ToInt32() = SC_MOVE)
Then
' Return
'End If

If (m.Msg = WM_NCLBUTTONDOWN) And (m.WParam.ToInt32() =
HTCAPTION) Then
Return
End If

If (m.WParam.ToInt32() = SC_MOVE) Then
Return
End If

MyBase.WndProc(m)
End Sub
 
Back
Top