如题

解决方案 »

  1.   

    private
      procedure OnMessage(var Msg: tagMSG; var Handled: Boolean);procedure TForm1.FormCreate(Sender: TObject);
    begin
      EnableMenuItem(GetSystemMenu(Handle,False), SC_CLOSE,MF_DISABLED or MF_GRAYED);
      Application.OnMessage := OnMessage;
    end;procedure TForm1.OnMessage(var Msg: tagMSG;
      var Handled: Boolean);
    begin
      if  (Msg.lParam and $80000000 = 0) and (Msg.wParam = VK_F4) and (GetKeyState(VK_MENU)<0)
       then
         Handled := True;
    end;
      

  2.   

    谢谢,已解决。
    不过由于使用了VCLSkin控件
    EnableMenuItem(GetSystemMenu(Handle,False), SC_CLOSE,MF_DISABLED or MF_GRAYED);
    这句没起到作用,对于窗体的关闭按钮,我添加了一个变量进行判断才屏蔽掉