473,499 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

detecting minimization

How can I detect when the user minimize the form (when he/she press the
Mimimaze Box)?
Nov 16 '05 #1
3 1697
UmmagummA,

There is no event that lets you know when this is going to happen.
However, you can derive from the Form class and override the WndProc method
to process the WM_SYSCOMMAND message. You want to handle the case where
wParam is equal to SC_MINIMIZE.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"UmmagummA" <fl***@mt.net.mk> wrote in message
news:O1**************@TK2MSFTNGP10.phx.gbl...
How can I detect when the user minimize the form (when he/she press the
Mimimaze Box)?

Nov 16 '05 #2

The Resize event of the form will fire on a minimize. Within the handler,
you can check the WindowState. If it is FormWindowState.Minimized then the
form is being minimized. I have not used this technique before, but you can
check to see if it works for you.

Brian Davis
http://www.knowdotnet.com


"UmmagummA" <fl***@mt.net.mk> wrote in message
news:O1**************@TK2MSFTNGP10.phx.gbl...
How can I detect when the user minimize the form (when he/she press the
Mimimaze Box)?

Nov 16 '05 #3
If you want to find the minimized state for other windows,

[DllImport( "User32.dll" )]
static extern int FindWindow( String ClassName, String WindowName );
[DllImport("User32.dll")]
private static extern bool IsIconic(int hWnd);

usage -

//get the window handle
int hwnd = FindWindow(null,"Some window title");
bool bMinimized = IsIconic(hwnd);

if bMinimized == true //its minimized

--
Shak
(Houston)
"UmmagummA" <fl***@mt.net.mk> wrote in message
news:O1**************@TK2MSFTNGP10.phx.gbl...
How can I detect when the user minimize the form (when he/she press the
Mimimaze Box)?

Nov 16 '05 #4

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

Similar topics

5
12458
by: Jole | last post by:
Hi I'm writing a program that needs to read from a file. In order for the program to be robust, it should somehow check that the file isn't corrupt, or stuffed in any way. For example, that...
15
2672
by: Jay | last post by:
I'm sure this is a really dumb question, but how do you detect a variable type in Python? For example, I want to know if the variable "a" is a list of strings or a single string. How do I do...
3
1845
by: raptor | last post by:
hi, how to detect opera..it seems that even opera8 doesnt support xmlhttp fully (.i.e. sendRequestHeader). I ask this 'cause opera seems to mimic IE, at least in the preferences ?! I havent...
6
4360
by: laniik | last post by:
hi. does anyone know if there is a good/free/popular c++ library for nonlinear conjugate gradient minimization? i.e. somthing that takes a f(x)=y and minimize for x. i also need it to be able...
9
2001
by: D. Shane Fowlkes | last post by:
I'm using SQL Server 2000 and on my page, I'm simply creating a SQLDataReader and filling in Labels with the retrieved (single) record. However, how can I prevent from getting errors when a field...
3
3597
by: regtrashcan | last post by:
I have a webpage that detects whether Shockwave Player is installed and the version number. The javascript/vbscript that I use has worked fine until the latest release of the Shockwave Player. I am...
79
3703
by: VK | last post by:
I wandering about the common proctice of some UA's producers to spoof the UA string to pretend to be another browser (most often IE). Shouldn't it be considered as a trademark violation of the...
5
8712
by: Z.K. | last post by:
In C#, using the StreamReader, how do I detect when you get to the end of line. I am reading a text file using the Read() function and I need to detect the \n\r, but everything I try does not...
1
24009
by: wwwords | last post by:
Is there a general method for detecting that a user has changed the record currently visible on a form, whether this is by hitting PgUp or PgDn or clicking on a navigation button, even if no change...
3
508
by: markscala | last post by:
Is anyone aware of python library that does function minimization a la Minuit (http://wwwasdoc.web.cern.ch/wwwasdoc/minuit/) used by CERN? thanks
0
7128
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
7006
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
294
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.