在任務欄上點擊也不能使其最小化,不知道如何才能做到
地任務欄沒有hide的情況下

解决方案 »

  1.   

    实现WM_SYSCOMMAND消息:
    procedure TMainForm.WMSysCommand(var Message: TWMSysCommand);
    begin
      case Message.CmdType of
        SC_MINIMIZE:
        begin
          Exit;
        end else inherited;
      end;
    end;
      

  2.   

    procedure MyMsg(var msg:TMessage);message WM_SYSCOMMAND;
    ...
    procedure TForm1.MyMsg(var msg: TMessage);
    begin
        if msg.WParam=SC_MINIMIZE then
           msg.Result:=0    //最好处理一下。
        else
           inherited;
    end;
      

  3.   

    加一个 ApplicationEvents 组件在窗体上,然后procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
      var Handled: Boolean);
    begin
      if (msg.message=wm_syscommand) and (msg.wParam=sc_minimize) then
        handled:=true;
    end;
      

  4.   

    扑捉windows消息。。然后result:=0;
    ok