PostMessage(hwnd, WM_XXXX, nil, nil)

解决方案 »

  1.   

    procedure WMSysCommand(var Msg: TMessage);message WM_SYSCOMMAND;procedure TForm1.WMSysCommand(var Msg: TMessage);
    begin
      case Msg.WParam of
        SC_MINIMIZE: label3.Caption:='Min';
        SC_MAXIMIZE: label3.Caption:='Max';
        SC_RESTORE:  label3.Caption:='Res';
        else inherited;
      end;
    end;
      

  2.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      PostMessage(form1.Handle,WM_SYSCOMMAND,SC_MINIMIZE, 0);
    end;