怎样在对话框中用button实现最小化和最大化的功能,比如点击某个按钮时窗口最大化或最小化?

解决方案 »

  1.   

    BOOL ShowWindow( int nCmdShow );
    SW_SHOWMAXIMIZED   Activates the window and displays it as a maximized window.
    SW_SHOWMINIMIZED   Activates the window and displays it as an icon.
      

  2.   

    SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, NULL);
    SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, NULL);
      

  3.   

    ShowWindow(SW_MINIMIZE);
    ShowWindow(SW_MAXIMIZE);
      

  4.   

    api functions:
    ShowWindow
    The ShowWindow function sets the specified window's show state. BOOL ShowWindow(
      HWND hWnd,     // handle to window
      int nCmdShow   // show state of window
    );SW_MAXIMIZE Maximizes the specified window. 
    SW_MINIMIZE Minimizes the specified window and activates the next top-level window in the Z order. 
      

  5.   

    SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, NULL);应该是比较正统的做法.
      

  6.   

    Application.Minimize;

    Application.Restore;