Catch when minimizing the windows form 
Author Message
 Catch when minimizing the windows form

I added this code :

private const int WM_SIZE = 5;

protected override void WndProc(ref System.Windows.Forms.Message m)
{
        if(m.Msg == WM_SIZE)
        {
                MessageBox.Show(m.WParam.ToString());
                //Code
        }
        else
                base.WndProc(ref m);

Quote:
}

Normally, the WParam contain the information that describe if the form
in minimized, maximized, restored. The problem is that WParam is always
0 except when the form is maximized (=2).
So how can I catch a windows form minimize ?

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!



Mon, 13 Dec 2004 21:27:14 GMT  
 Catch when minimizing the windows form
tom tom, you could always check the lParam for the window's height and
width.  When the window is minimized I think these are set to -1.  Other
than that I'm not sure why you're not seeing wParam == SIZE_MINIMIZED.

--
Greg
http://www.claritycon.com/


Quote:
> I added this code :

> private const int WM_SIZE = 5;

> protected override void WndProc(ref System.Windows.Forms.Message m)
> {
> if(m.Msg == WM_SIZE)
> {
> MessageBox.Show(m.WParam.ToString());
> //Code
> }
> else
> base.WndProc(ref m);
> }

> Normally, the WParam contain the information that describe if the form
> in minimized, maximized, restored. The problem is that WParam is always
> 0 except when the form is maximized (=2).
> So how can I catch a windows form minimize ?

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Mon, 13 Dec 2004 21:51:57 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How Catch Minimize Event..?

2. Override Minimize Event in Form

3. size and location of a minimized form

4. Minimize individual control within a form

5. Minimized Form / Original Size

6. Minimizing window to icon, not tiny window

7. Minimized child windows loose size and position in Windows XP

8. Minimize Window Questions w/ CWinThread window

9. How to minimize all windows on desktop and do window tiling

10. How to Capture FORM MINIMIZE EVENT in C#?

11. Make Windows Form Application with VC++.NET 2002 using a visual form

12. System.Windows.Forms.Form

 

 
Powered by phpBB® Forum Software