473,326 Members | 2,013 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,326 software developers and data experts.

minimize button event ?

hi,

i would like to know when the user minimized the window, how can i do it ?

Thanks

T :-)
Nov 21 '05 #1
7 4020
Override the WndProc method of your form for which you're looking to capture
the minimize event as follows:

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Const WM_SIZE As Integer = &H5
Const SIZE_MINIMIZED As Integer = 1
Select Case m.Msg
Case WM_SIZE
If m.WParam.ToInt32 = SIZE_MINIMIZED Then
Debug.WriteLine("minimizing..")
End If
End Select
MyBase.WndProc(m)
End Sub

hope this helps..
Imran.

"Amir V" <ti*****@netvision.net.il> wrote in message
news:u$*************@TK2MSFTNGP12.phx.gbl...
hi,

i would like to know when the user minimized the window, how can i do it ?

Thanks

T :-)

Nov 21 '05 #2
hi,

it was helful but i will be glad if you explain me what is the WndProc
Method

Thanks!

"Imran Koradia" <no****@microsoft.com> wrote in message
news:uC*************@TK2MSFTNGP09.phx.gbl...
Override the WndProc method of your form for which you're looking to capture the minimize event as follows:

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Const WM_SIZE As Integer = &H5
Const SIZE_MINIMIZED As Integer = 1
Select Case m.Msg
Case WM_SIZE
If m.WParam.ToInt32 = SIZE_MINIMIZED Then
Debug.WriteLine("minimizing..")
End If
End Select
MyBase.WndProc(m)
End Sub

hope this helps..
Imran.

"Amir V" <ti*****@netvision.net.il> wrote in message
news:u$*************@TK2MSFTNGP12.phx.gbl...
hi,

i would like to know when the user minimized the window, how can i do it ?
Thanks

T :-)


Nov 21 '05 #3
hi,

where can i find the id's for the windows messages ?
in other words, how did you know that SIZE_MINIMIZED = 1 ?
Thanks

"Imran Koradia" <no****@microsoft.com> wrote in message
news:uC*************@TK2MSFTNGP09.phx.gbl...
Override the WndProc method of your form for which you're looking to capture the minimize event as follows:

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Const WM_SIZE As Integer = &H5
Const SIZE_MINIMIZED As Integer = 1
Select Case m.Msg
Case WM_SIZE
If m.WParam.ToInt32 = SIZE_MINIMIZED Then
Debug.WriteLine("minimizing..")
End If
End Select
MyBase.WndProc(m)
End Sub

hope this helps..
Imran.

"Amir V" <ti*****@netvision.net.il> wrote in message
news:u$*************@TK2MSFTNGP12.phx.gbl...
hi,

i would like to know when the user minimized the window, how can i do it ?
Thanks

T :-)


Nov 21 '05 #4
the WndProc is called whenever a message is sent to the corresponding
window. In windows, virtually all of the UI work is carried out using
messages. It is the .NET version of the Win32 API function CallWindowProc
that's used often by VB 6 programmers.
The message constants and other constants are defined in the WinUser.h
header file. If you have the entire Visual Studio .NET, its under the folder
Vc7\PlatformSDK\Include. If you just have the .NET SDK, then too it should
be somewhere under the .NET SDK folder itself.

hope this helps..
Imran.

"Amir V" <ti*****@netvision.net.il> wrote in message
news:em**************@TK2MSFTNGP10.phx.gbl...
hi,

where can i find the id's for the windows messages ?
in other words, how did you know that SIZE_MINIMIZED = 1 ?
Thanks

"Imran Koradia" <no****@microsoft.com> wrote in message
news:uC*************@TK2MSFTNGP09.phx.gbl...
Override the WndProc method of your form for which you're looking to capture
the minimize event as follows:

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Const WM_SIZE As Integer = &H5
Const SIZE_MINIMIZED As Integer = 1
Select Case m.Msg
Case WM_SIZE
If m.WParam.ToInt32 = SIZE_MINIMIZED Then
Debug.WriteLine("minimizing..")
End If
End Select
MyBase.WndProc(m)
End Sub

hope this helps..
Imran.

"Amir V" <ti*****@netvision.net.il> wrote in message
news:u$*************@TK2MSFTNGP12.phx.gbl...
hi,

i would like to know when the user minimized the window, how can i do
it ?
Thanks

T :-)



Nov 21 '05 #5
Hi,

Thanks for you help but i didn't found the file in my drive.

where can i find it in the net ?

i would like to know the message id's that windows send for each operation
so i will be able to use it.

thanks again
"Imran Koradia" <no****@microsoft.com> wrote in message
news:up**************@TK2MSFTNGP10.phx.gbl...
the WndProc is called whenever a message is sent to the corresponding
window. In windows, virtually all of the UI work is carried out using
messages. It is the .NET version of the Win32 API function CallWindowProc
that's used often by VB 6 programmers.
The message constants and other constants are defined in the WinUser.h
header file. If you have the entire Visual Studio .NET, its under the folder Vc7\PlatformSDK\Include. If you just have the .NET SDK, then too it should
be somewhere under the .NET SDK folder itself.

hope this helps..
Imran.

"Amir V" <ti*****@netvision.net.il> wrote in message
news:em**************@TK2MSFTNGP10.phx.gbl...
hi,

where can i find the id's for the windows messages ?
in other words, how did you know that SIZE_MINIMIZED = 1 ?
Thanks

"Imran Koradia" <no****@microsoft.com> wrote in message
news:uC*************@TK2MSFTNGP09.phx.gbl...
Override the WndProc method of your form for which you're looking to capture
the minimize event as follows:

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) Const WM_SIZE As Integer = &H5
Const SIZE_MINIMIZED As Integer = 1
Select Case m.Msg
Case WM_SIZE
If m.WParam.ToInt32 = SIZE_MINIMIZED Then
Debug.WriteLine("minimizing..")
End If
End Select
MyBase.WndProc(m)
End Sub

hope this helps..
Imran.

"Amir V" <ti*****@netvision.net.il> wrote in message
news:u$*************@TK2MSFTNGP12.phx.gbl...
> hi,
>
> i would like to know when the user minimized the window, how can i

do it
?
>
> Thanks
>
> T :-)
>
>



Nov 21 '05 #6
hmm...looks like this is included with the VC++ installation only. I could
be wrong though.
Ofcourse, the platform sdk contains all the header files.

however, here's link where I found the entire Winuser.h file:
http://doc.ddart.net/msdn/header/include/winuser.h.html

I would suggest you donwload the platform sdk since it would have all the
header files and also help files which should help you further.
here's the link:
http://www.microsoft.com/msdownload/...sdk/sdkupdate/

hope this helps..
Imran.
"Tiraman :-)" <ti*****@netvision.net.il> wrote in message
news:O2**************@TK2MSFTNGP09.phx.gbl...
Hi,

Thanks for you help but i didn't found the file in my drive.

where can i find it in the net ?

i would like to know the message id's that windows send for each operation
so i will be able to use it.

thanks again
"Imran Koradia" <no****@microsoft.com> wrote in message
news:up**************@TK2MSFTNGP10.phx.gbl...
the WndProc is called whenever a message is sent to the corresponding
window. In windows, virtually all of the UI work is carried out using
messages. It is the .NET version of the Win32 API function CallWindowProc
that's used often by VB 6 programmers.
The message constants and other constants are defined in the WinUser.h
header file. If you have the entire Visual Studio .NET, its under the

folder
Vc7\PlatformSDK\Include. If you just have the .NET SDK, then too it should be somewhere under the .NET SDK folder itself.

hope this helps..
Imran.

"Amir V" <ti*****@netvision.net.il> wrote in message
news:em**************@TK2MSFTNGP10.phx.gbl...
hi,

where can i find the id's for the windows messages ?
in other words, how did you know that SIZE_MINIMIZED = 1 ?
Thanks

"Imran Koradia" <no****@microsoft.com> wrote in message
news:uC*************@TK2MSFTNGP09.phx.gbl...
> Override the WndProc method of your form for which you're looking to
capture
> the minimize event as follows:
>
> Protected Overrides Sub WndProc(ByRef m As

System.Windows.Forms.Message) > Const WM_SIZE As Integer = &H5
> Const SIZE_MINIMIZED As Integer = 1
> Select Case m.Msg
> Case WM_SIZE
> If m.WParam.ToInt32 = SIZE_MINIMIZED Then
> Debug.WriteLine("minimizing..")
> End If
> End Select
> MyBase.WndProc(m)
> End Sub
>
> hope this helps..
> Imran.
>
> "Amir V" <ti*****@netvision.net.il> wrote in message
> news:u$*************@TK2MSFTNGP12.phx.gbl...
> > hi,
> >
> > i would like to know when the user minimized the window, how can i

do
it
?
> >
> > Thanks
> >
> > T :-)
> >
> >
>
>



Nov 21 '05 #7
Cool,

now i can keep my work :-)

Thanks Again For Your Help!

"Imran Koradia" <no****@microsoft.com> wrote in message
news:O5**************@tk2msftngp13.phx.gbl...
hmm...looks like this is included with the VC++ installation only. I could
be wrong though.
Ofcourse, the platform sdk contains all the header files.

however, here's link where I found the entire Winuser.h file:
http://doc.ddart.net/msdn/header/include/winuser.h.html

I would suggest you donwload the platform sdk since it would have all the
header files and also help files which should help you further.
here's the link:
http://www.microsoft.com/msdownload/...sdk/sdkupdate/

hope this helps..
Imran.
"Tiraman :-)" <ti*****@netvision.net.il> wrote in message
news:O2**************@TK2MSFTNGP09.phx.gbl...
Hi,

Thanks for you help but i didn't found the file in my drive.

where can i find it in the net ?

i would like to know the message id's that windows send for each operation
so i will be able to use it.

thanks again
"Imran Koradia" <no****@microsoft.com> wrote in message
news:up**************@TK2MSFTNGP10.phx.gbl...
the WndProc is called whenever a message is sent to the corresponding
window. In windows, virtually all of the UI work is carried out using
messages. It is the .NET version of the Win32 API function CallWindowProc that's used often by VB 6 programmers.
The message constants and other constants are defined in the WinUser.h
header file. If you have the entire Visual Studio .NET, its under the

folder
Vc7\PlatformSDK\Include. If you just have the .NET SDK, then too it should be somewhere under the .NET SDK folder itself.

hope this helps..
Imran.

"Amir V" <ti*****@netvision.net.il> wrote in message
news:em**************@TK2MSFTNGP10.phx.gbl...
> hi,
>
> where can i find the id's for the windows messages ?
> in other words, how did you know that SIZE_MINIMIZED = 1 ?
> Thanks
>
> "Imran Koradia" <no****@microsoft.com> wrote in message
> news:uC*************@TK2MSFTNGP09.phx.gbl...
> > Override the WndProc method of your form for which you're looking to > capture
> > the minimize event as follows:
> >
> > Protected Overrides Sub WndProc(ByRef m As

System.Windows.Forms.Message)
> > Const WM_SIZE As Integer = &H5
> > Const SIZE_MINIMIZED As Integer = 1
> > Select Case m.Msg
> > Case WM_SIZE
> > If m.WParam.ToInt32 = SIZE_MINIMIZED Then
> > Debug.WriteLine("minimizing..")
> > End If
> > End Select
> > MyBase.WndProc(m)
> > End Sub
> >
> > hope this helps..
> > Imran.
> >
> > "Amir V" <ti*****@netvision.net.il> wrote in message
> > news:u$*************@TK2MSFTNGP12.phx.gbl...
> > > hi,
> > >
> > > i would like to know when the user minimized the window, how can

i do
it
> ?
> > >
> > > Thanks
> > >
> > > T :-)
> > >
> > >
> >
> >
>
>



Nov 21 '05 #8

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

Similar topics

2
by: T250 | last post by:
I would like to override the behavior of my applications Minimize button to Hide() but can't seem to locate where Minimize is implemented in the framework. The closest I've found is a property...
3
by: Nagachandra Sekhar Grandhi | last post by:
Hi, I am opening a dialog box (which is also a form) after clicking a button in the main form using ".ShowDialog(this)". There is a minimize button for the opened dialog box(form). I want to...
1
by: kiran | last post by:
How to captuer the Minimizing button event in the windows from..? When I click Minimize button I have to do some action..? How can I do this..? Is there any alternate avialable..? Regards kiran
3
by: Maka Sili | last post by:
Hi, My VC++ application does not have a titlebar (and therefore no System menu, no minimize, no maximize and no close button). We have a custom button for minimize and close. When the app...
0
by: Latha Rajeev | last post by:
Hello, I have an aspx page, and i want to trap the window minimize event(clicking the minimize button in the title bar of window) in my client side javascript code. I thought that the window...
4
by: Brad Melendy | last post by:
Hello, I'm looking for an onclick event for the minimize button but can't seem to find it within the form properties. I'd like to add code to hide my form when it is minimized and suspect there...
1
by: zakhirn | last post by:
Anyone have code that creates a button that will Minimize Excel to the system tray. I do not need anything complicated like changing the minimize button or the close button to a minimize to...
0
by: AllenW | last post by:
I have a VB.Net 2005 application that moves the mouse cursor via software and generates mouse clicks anywhere on the monitor using SendInput. The code that moves the mouse and decides when to issue...
4
by: Hutch | last post by:
I also un-checked all of the check boxes in the database's Startup options menu. I then added a button to the form so that the user can close the database, and another button so that the form can...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.