473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Prevent form minimize

Hi,

I'm creating my own Sidebar (like in Vista).

In my XP's quick menu, I have a button called "Show Desktop". When I click
it all forms are minimized.

Since I don't want my SideBar to be minimized, how do I prevent this?

Thanks!

M O J O
Oct 13 '06 #1
11 4246
Throw in the following:

Private Const WM_SYSCOMMAND As Int32 = &H112
Private Const SC_MINIMIZE As Int32 = &HF020

Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
if m.WParam.ToInt32() = SC_MINIMIZE then Exit Sub
End If
MyBase.WndProc(m)
End Sub

Thanks,

Seth Rowe
M O J O wrote:
Hi,

I'm creating my own Sidebar (like in Vista).

In my XP's quick menu, I have a button called "Show Desktop". When I click
it all forms are minimized.

Since I don't want my SideBar to be minimized, how do I prevent this?

Thanks!

M O J O
Oct 13 '06 #2
Oh by the way, here's the complete post from Herfried Wagner that that
code is based on:

Thanks,

Seth Rowe

Is there a way I can get into a form's close/minimize/maximize events when
those buttons (the 3 small squared button in the upper right corner of a
form) are clicked?
\\\
Private Const WM_SYSCOMMAND As Int32 = &H112

Private Const SC_MAXIMIZE As Int32 = &HF030
Private Const SC_MINIMIZE As Int32 = &HF020
Private Const SC_RESTORE As Int32 = &HF120
Private Const SC_CLOSE As Int32 = &HF060

Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
Select Case m.WParam.ToInt32()
Case SC_MAXIMIZE
Debug.WriteLine("Form gets maximized.")
Case SC_MINIMIZE
Debug.WriteLine("Form gets minimized.")
Case SC_RESTORE
Debug.WriteLine("Form gets restored.")
Case SC_CLOSE
Debug.WriteLine("Form gets closed.")
End Select
End If
MyBase.WndProc(m)
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

rowe_newsgroups wrote:
Throw in the following:

Private Const WM_SYSCOMMAND As Int32 = &H112
Private Const SC_MINIMIZE As Int32 = &HF020

Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
if m.WParam.ToInt32() = SC_MINIMIZE then Exit Sub
End If
MyBase.WndProc(m)
End Sub

Thanks,

Seth Rowe
M O J O wrote:
Hi,

I'm creating my own Sidebar (like in Vista).

In my XP's quick menu, I have a button called "Show Desktop". When I click
it all forms are minimized.

Since I don't want my SideBar to be minimized, how do I prevent this?

Thanks!

M O J O
Oct 13 '06 #3
Hi Seth,

That didn't work.

Any idea?

Thanks.

M O J O

"rowe_newsgroups" wrote:
Throw in the following:

Private Const WM_SYSCOMMAND As Int32 = &H112
Private Const SC_MINIMIZE As Int32 = &HF020

Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
if m.WParam.ToInt32() = SC_MINIMIZE then Exit Sub
End If
MyBase.WndProc(m)
End Sub

Thanks,

Seth Rowe
M O J O wrote:
Hi,

I'm creating my own Sidebar (like in Vista).

In my XP's quick menu, I have a button called "Show Desktop". When I click
it all forms are minimized.

Since I don't want my SideBar to be minimized, how do I prevent this?

Thanks!

M O J O

Oct 13 '06 #4
I used the original code and it worked from me.

-See the above post and try it with the case
and put the exist sub instead of the write line.

Miro

"M O J O" <MO**@discussions.microsoft.comwrote in message
news:26**********************************@microsof t.com...
Hi Seth,

That didn't work.

Any idea?

Thanks.

M O J O

"rowe_newsgroups" wrote:
>Throw in the following:

Private Const WM_SYSCOMMAND As Int32 = &H112
Private Const SC_MINIMIZE As Int32 = &HF020

Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
if m.WParam.ToInt32() = SC_MINIMIZE then Exit Sub
End If
MyBase.WndProc(m)
End Sub

Thanks,

Seth Rowe
M O J O wrote:
Hi,

I'm creating my own Sidebar (like in Vista).

In my XP's quick menu, I have a button called "Show Desktop". When I
click
it all forms are minimized.

Since I don't want my SideBar to be minimized, how do I prevent this?

Thanks!

M O J O


Oct 13 '06 #5
Darn that pseudocode!

Thanks,

Seth Rowe
Miro wrote:
I used the original code and it worked from me.

-See the above post and try it with the case
and put the exist sub instead of the write line.

Miro

"M O J O" <MO**@discussions.microsoft.comwrote in message
news:26**********************************@microsof t.com...
Hi Seth,

That didn't work.

Any idea?

Thanks.

M O J O

"rowe_newsgroups" wrote:
Throw in the following:

Private Const WM_SYSCOMMAND As Int32 = &H112
Private Const SC_MINIMIZE As Int32 = &HF020

Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
if m.WParam.ToInt32() = SC_MINIMIZE then Exit Sub
End If
MyBase.WndProc(m)
End Sub

Thanks,

Seth Rowe
M O J O wrote:
Hi,

I'm creating my own Sidebar (like in Vista).

In my XP's quick menu, I have a button called "Show Desktop". When I
click
it all forms are minimized.

Since I don't want my SideBar to be minimized, how do I prevent this?

Thanks!

M O J O

Oct 13 '06 #6
Hi Seth,

Thanks for helping me out here.

If I minimize all forms using the "Show Dekstop" button (in the quick
menu/quick start ... dunno what it's called in the english version of XP ..
it's right next to the start button in the lower left of the XP desktop
screen), the code doesn't work. It only works if I minimize the form itself.

Hope you get what I mean. :o)

Thanks!!!

M O J O

"rowe_newsgroups" wrote:
Oh by the way, here's the complete post from Herfried Wagner that that
code is based on:

Thanks,

Seth Rowe

Is there a way I can get into a form's close/minimize/maximize events when
those buttons (the 3 small squared button in the upper right corner of a
form) are clicked?

\\\
Private Const WM_SYSCOMMAND As Int32 = &H112

Private Const SC_MAXIMIZE As Int32 = &HF030
Private Const SC_MINIMIZE As Int32 = &HF020
Private Const SC_RESTORE As Int32 = &HF120
Private Const SC_CLOSE As Int32 = &HF060

Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
Select Case m.WParam.ToInt32()
Case SC_MAXIMIZE
Debug.WriteLine("Form gets maximized.")
Case SC_MINIMIZE
Debug.WriteLine("Form gets minimized.")
Case SC_RESTORE
Debug.WriteLine("Form gets restored.")
Case SC_CLOSE
Debug.WriteLine("Form gets closed.")
End Select
End If
MyBase.WndProc(m)
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

rowe_newsgroups wrote:
Throw in the following:

Private Const WM_SYSCOMMAND As Int32 = &H112
Private Const SC_MINIMIZE As Int32 = &HF020

Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
if m.WParam.ToInt32() = SC_MINIMIZE then Exit Sub
End If
MyBase.WndProc(m)
End Sub

Thanks,

Seth Rowe
M O J O wrote:
Hi,
>
I'm creating my own Sidebar (like in Vista).
>
In my XP's quick menu, I have a button called "Show Desktop". When I click
it all forms are minimized.
>
Since I don't want my SideBar to be minimized, how do I prevent this?
>
Thanks!
>
M O J O

Oct 13 '06 #7
Hi Miro,

Please se my second answer to Seth.

:o)

M O J O

"Miro" wrote:
I used the original code and it worked from me.

-See the above post and try it with the case
and put the exist sub instead of the write line.

Miro

"M O J O" <MO**@discussions.microsoft.comwrote in message
news:26**********************************@microsof t.com...
Hi Seth,

That didn't work.

Any idea?

Thanks.

M O J O

"rowe_newsgroups" wrote:
Throw in the following:

Private Const WM_SYSCOMMAND As Int32 = &H112
Private Const SC_MINIMIZE As Int32 = &HF020

Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
if m.WParam.ToInt32() = SC_MINIMIZE then Exit Sub
End If
MyBase.WndProc(m)
End Sub

Thanks,

Seth Rowe
M O J O wrote:
Hi,

I'm creating my own Sidebar (like in Vista).

In my XP's quick menu, I have a button called "Show Desktop". When I
click
it all forms are minimized.

Since I don't want my SideBar to be minimized, how do I prevent this?

Thanks!

M O J O



Oct 13 '06 #8
Hi Seth,

I googled around and found out, that clicking the "Show Desktop" button,
doesn't minimize all windows, it just puts the "Desktop" infront of all other
running apps.

So now I have to figure out how to trap, when desktop is brought to the
foreground.

Any idea???

:o)

Thanks!

M O J O
"rowe_newsgroups" wrote:
Oh by the way, here's the complete post from Herfried Wagner that that
code is based on:

Thanks,

Seth Rowe

Is there a way I can get into a form's close/minimize/maximize events when
those buttons (the 3 small squared button in the upper right corner of a
form) are clicked?

\\\
Private Const WM_SYSCOMMAND As Int32 = &H112

Private Const SC_MAXIMIZE As Int32 = &HF030
Private Const SC_MINIMIZE As Int32 = &HF020
Private Const SC_RESTORE As Int32 = &HF120
Private Const SC_CLOSE As Int32 = &HF060

Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
Select Case m.WParam.ToInt32()
Case SC_MAXIMIZE
Debug.WriteLine("Form gets maximized.")
Case SC_MINIMIZE
Debug.WriteLine("Form gets minimized.")
Case SC_RESTORE
Debug.WriteLine("Form gets restored.")
Case SC_CLOSE
Debug.WriteLine("Form gets closed.")
End Select
End If
MyBase.WndProc(m)
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

rowe_newsgroups wrote:
Throw in the following:

Private Const WM_SYSCOMMAND As Int32 = &H112
Private Const SC_MINIMIZE As Int32 = &HF020

Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
if m.WParam.ToInt32() = SC_MINIMIZE then Exit Sub
End If
MyBase.WndProc(m)
End Sub

Thanks,

Seth Rowe
M O J O wrote:
Hi,
>
I'm creating my own Sidebar (like in Vista).
>
In my XP's quick menu, I have a button called "Show Desktop". When I click
it all forms are minimized.
>
Since I don't want my SideBar to be minimized, how do I prevent this?
>
Thanks!
>
M O J O

Oct 13 '06 #9
Hi Seth,

I googled around and found out, that clicking the "Show Desktop" button,
doesn't minimize all windows, it just puts the "Desktop" infront of all other
running apps.

So now I have to figure out how to trap, when desktop is brought to the
foreground.

Any idea???

:o)

Thanks!

M O J O
Oct 13 '06 #10
Yeah, I just tried out the full code too, and it doesn't even seem to
call the wndproc method. The shell command it is using is called
ToggleDesktop if that helps, but I'm not sure how to disable it. I'll
keep looking...

Thanks,

Seth Rowe
M O J O wrote:
Hi Seth,

Thanks for helping me out here.

If I minimize all forms using the "Show Dekstop" button (in the quick
menu/quick start ... dunno what it's called in the english version of XP ..
it's right next to the start button in the lower left of the XP desktop
screen), the code doesn't work. It only works if I minimize the form itself.

Hope you get what I mean. :o)

Thanks!!!

M O J O

"rowe_newsgroups" wrote:
Oh by the way, here's the complete post from Herfried Wagner that that
code is based on:

Thanks,

Seth Rowe

Is there a way I can get into a form's close/minimize/maximize events when
those buttons (the 3 small squared button in the upper right corner of a
form) are clicked?
\\\
Private Const WM_SYSCOMMAND As Int32 = &H112

Private Const SC_MAXIMIZE As Int32 = &HF030
Private Const SC_MINIMIZE As Int32 = &HF020
Private Const SC_RESTORE As Int32 = &HF120
Private Const SC_CLOSE As Int32 = &HF060

Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
Select Case m.WParam.ToInt32()
Case SC_MAXIMIZE
Debug.WriteLine("Form gets maximized.")
Case SC_MINIMIZE
Debug.WriteLine("Form gets minimized.")
Case SC_RESTORE
Debug.WriteLine("Form gets restored.")
Case SC_CLOSE
Debug.WriteLine("Form gets closed.")
End Select
End If
MyBase.WndProc(m)
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

rowe_newsgroups wrote:
Throw in the following:
>
Private Const WM_SYSCOMMAND As Int32 = &H112
Private Const SC_MINIMIZE As Int32 = &HF020
>
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_SYSCOMMAND Then
if m.WParam.ToInt32() = SC_MINIMIZE then Exit Sub
End If
MyBase.WndProc(m)
End Sub
>
Thanks,
>
Seth Rowe
>
>
M O J O wrote:
Hi,

I'm creating my own Sidebar (like in Vista).

In my XP's quick menu, I have a button called "Show Desktop". When I click
it all forms are minimized.

Since I don't want my SideBar to be minimized, how do I prevent this?

Thanks!

M O J O
Oct 13 '06 #11
"M O J O" <MO**@discussions.microsoft.comschrieb:
I'm creating my own Sidebar (like in Vista).

In my XP's quick menu, I have a button called "Show Desktop". When I click
it all forms are minimized.

Since I don't want my SideBar to be minimized, how do I prevent this?
Maybe registering the sidebar as an app bar will solve the problem:

<URL:http://groups.google.de/groups?q=appbar+dotnet>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Oct 13 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: VMI | last post by:
How can I add a small "Please wait..." form to a child form so that when I minimize the child form, the "Please Wait..." form will also disappear? This form will be displayed when the child form is...
7
by: Danielb | last post by:
I want my application to run most of the time as just an notify icon visible in the system tray, with some dialogs windows that open if the user selects an option from the context menu on the tray...
7
by: Bhargavan | last post by:
Hey Group, When I minimize and then maximize a form (in windows application), I see a significant drop in memory usuage in the task manager. I tried to do the same thing programatically during the...
19
by: Oliver Neumann | last post by:
Hello, im new to c# and i got an app with a notifyicon. Now i want to start the app only with the notifyIcon, so that the Main-Form doesnt show up. The form itself is used at the entrance...
9
by: Jason | last post by:
I have one MDI Child form for a MDI Parent form. I want the MDI Child form to not have a control box for minimizing and and closing the form. I set the control box property of the child to...
4
by: steve | last post by:
hi all, i was wondering how is it possible to add an extra box ( i think they are called boxes: upper right corner ...) in a form that will minimize it in the system tray? You know some...
3
by: Don | last post by:
If you have a form that calls another form via the following code: Dim myForm as Form2 myForm = New Form2 myForm.Owner = Me MyForm.ShowDialog and you minimize the second form, the first form...
9
by: mohit.akl | last post by:
Hey guys & gals I am havng trouble modifying the control box. I want to make the maximise button invisible and have minimisise button instead of it. Like this _ X (not like _ o X ) How...
8
by: News Microsoft | last post by:
Hi there. I would like to know how can I test if a Form exists. This is the situation: I have a single Form in my application. My objective is, when I minimize the form, it will disapear and a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.