minimize button event ?

  • Thread starter Thread starter Imran Koradia
  • Start date Start date
I

Imran Koradia

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.
 
hi,

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

Thanks

T :-)
 
hi,

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

Thanks!
 
hi,

where can i find the id's for the windows messages ?
in other words, how did you know that SIZE_MINIMIZED = 1 ?
Thanks
 
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.
 
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/platformsdk/sdkupdate/

hope this helps..
Imran.
 
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
 
Back
Top