On Tue, 12 Jun 2007 01:52:00 -0700, pete1969
<pe******@discussions.microsoft.comwrote:
I want to have an application window be always maximized (or minimized)
but
never in normal state. If I take away the maximize button in the form and
start the application in maximized mode the user can still double click
on
the title bar to unmaximize it, but never maximize it afterwards. Is
there a
way to solve this?
I haven't tried this, but you may be able to address the issue by handling
the WM_SYSCOMMAND message in the WndProc method of your main application
form class. Watch for the SC_RESTORE message, and don't call the base
WndProc method when it shows up.
It's my expectation that when the user double-clicks on the title bar,
this is the message that's sent if the window is already maximized, and so
ignoring it will prevent the window from being un-maximized.
Pete