我要在窗体上“ _ 口 X ”点击最小化的那个按钮后隐藏窗体,在什么事件里做?

解决方案 »

  1.   

    拦截窗体的wm_minimize事件(好像是),然后进行处理
      

  2.   

    to lianshaohua
    怎样拦截呢?
    msn:[email protected]
      

  3.   

    拦截系统菜单消息,就行了。
    这是拦截关闭的消息。最小化只要把msg.CmdType =sc_close中的sc_close
    变一下就行了。
    public
    procedure Closeshut(var msg:twmsyscommand);message WM_syscommand;
    procedure tFrmRegister.CloseShut(var msg:twmsyscommand);
    begin
      if msg.CmdType =sc_close then
        begin
          if true then
            close
          else
            application.Terminate;
        end
      else
      inherited;
    end;
      

  4.   

    to  iamastudent(书生) 
    能说详细点么?我在帮助文件里查不到这个类
      

  5.   

    谢谢 iamastudent(书生)
    自己解决了!