Then you can handle Move event and Resize event (EndResizing) restoring
required position and size
> We have a touch screen application (using the whole screen) running on the
> XP
[quoted text clipped - 26 lines]
>> > Thanks,
>> > Ken
KenDev - 25 Jun 2007 19:55 GMT
But hasn't the form already moved and resized by the time we get those
events? I tried changing the location in these events and it does move to
the right position, but I see it move to the other position first.
I am considering catching the WM_WINDOWPOSCHANGING message and setting the y
coordinate to my desired location before it gets processed by the base. I am
not sure I can programmatically prevent the taskbar grab line from showing
when my window does not take the whole screen and I would prefer not to
disable it for the whole system (maintenance guys do use other apps).
> Then you can handle Move event and Resize event (EndResizing) restoring
> required position and size
[quoted text clipped - 29 lines]
> >> > Thanks,
> >> > Ken
You can set a form's MaximumSize and MinimumSize sizes to some value
which will lock it in place.
You can prevent the user rom grabbing the window by overriding the
WndProc and stopping WM_NCHITTEST from responding.
You may also wish to run the code in kiosk mode by not loading Explorer
at startup but running your own application. In this case the desktop
will not exist but all windows services and API's will still function.
In this case, or maybe in all cases, force the app to run maximised.

Signature
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
> We have a touch screen application (using the whole screen) running on the XP
> OS on our hardware. It is not targeted for standard desktop configurations.
[quoted text clipped - 23 lines]
>>> Thanks,
>>> Ken
KenDev - 28 Jun 2007 15:40 GMT
Setting the MaximumSize and MinimumSize do not lock the window in position.
Changing the autohide property to false and applying it still moves my
window.
I can't prevent the user from grabbing the window by overriding the WndProc
and stopping the WM_NCHITTEST from responding because the taskbar is not my
code (am I not understanding your suggestion?).
I have been able to prevent the moving of my window by overriding the
WndProc and resetting the location to what I desire before passing it back on
along the message path. The grab bar is still there and shows the task bar
when grabbed.
However, I think I actually want to hide the grab bar. I can
programmatically hide it, but I think I may have some problems because we
have several apps and since we don't have a keyboard (touchscreen) it can be
difficult to get the taskbar back if the apps don't shut down properly.
The only way I have been able to hide the grab bar, is with an application
that takes up the full screen and is not resizable (which is the way our apps
used to work). Now we have a single navigation app that takes the top of the
screen and multiple apps that sit below it.
Thanks for your help,
Ken
> You can set a form's MaximumSize and MinimumSize sizes to some value
> which will lock it in place.
[quoted text clipped - 35 lines]
> >>> Thanks,
> >>> Ken