private void Form1_Resize(object sender, System.EventArgs e)
{
if(this.WindowState==FormWindowState.Minimized)
MessageBox.Show("最小化");
}

解决方案 »

  1.   

    this.Resize+=.........
    (From)sender
      

  2.   

    这个可能只有去拦截WIN32 消息,但我也不知道是哪个消息
      

  3.   


    protected override void WndProc(ref Message m)
    {
    switch (m.Msg)
    {
    case 0x0008;//这个消息只是例子,具体哪个我也不晓得
    MessageBox.Show("即将最小化");
    break;               
    }
    base.WndProc(ref m); }
      

  4.   

    WM_SIZE
    The WM_SIZE message is sent to a window after its size has changed. WM_SIZE 
    fwSizeType = wParam;      // resizing flag 
    nWidth = LOWORD(lParam);  // width of client area 
    nHeight = HIWORD(lParam); // height of client area 
     
    Parameters
    fwSizeType 
    Value of wParam. Specifies the type of resizing requested. This parameter can be one of the following values: Value Meaning 
    SIZE_MAXHIDE Message is sent to all pop-up windows when some other window is maximized. 
    SIZE_MAXIMIZED The window has been maximized. 
    SIZE_MAXSHOW Message is sent to all pop-up windows when some other window has been restored to its former size. 
    SIZE_MINIMIZED The window has been minimized. 
    SIZE_RESTORED The window has been resized, but neither the SIZE_MINIMIZED nor SIZE_MAXIMIZED value applies. 
    nWidth 
    Value of the low-order word of lParam. Specifies the new width of the client area. 
    nHeight 
    Value of the high-order word of lParam. Specifies the new height of the client area. 
    Return Values
    If an application processes this message, it should return zero
    其中的SIZE_MINIMIZED就是你要的
      

  5.   

    BearRui(月夜孤熊)提供的文中提到 has changed ,可能就没有用了。我要的是即将最小化之前的消息,而不是已经最小化的消息。