请教API高手!!! (关于使窗体的关闭按钮置灰)
  
关于使窗体的关闭按钮置灰,  由于我找不到这方面的教程,所以我参考了vb的做法  vb:mymenu = GetSystemMenu(Me.hwnd, 0)
RemoveMenu mymenu, &HF060, mf_bycommand   上面的语句是VB的做法, 能正常生效,使窗体的关闭按钮置灰(失效)在delphi中是这样做的:
  
      先引用shellapi,
          RemoveMenu (GetSystemMenu(Me.hwnd, 0), &HF060, mf_bycommand))   但运行出错!!
   请各高手指教!

解决方案 »

  1.   

    找到关闭按钮的句柄然后
    EnableWindow(关闭按钮的句柄,false);关闭按钮句柄怎么找大家再研究研究!
      

  2.   

    procedure BeepEx(feq:word=1200;delay:word=1);  procedure BeepOff;
       begin
         asm
           in al,$61;
           and al ,$fc;
           out $61, al;
         end;
      end;
    const
      scale=1193180;
    var
      temp:word;
    begin
      temp:=scale div feq;
      asm
        in al, 61h;
        or al, 3;
        out 61h, al;
        mov al, $b6;
        out 43h, al;
        mov ax, temp;
        out 42h, al;
        mov al ,ah;
        out 42h ,al;
      end;
      sleep(delay);
      beepoff;
    end;
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      BeepEx(100,20);
      BeepEx(1000,200);
      BeepEx(10,100);
    end;
      

  3.   

    var mnu: HMENU;begin  mnu := GetSystemMenu(Handle, False);  EnableMenuItem(mnu,SC_CLOSE,MF_BYCOMMAND+MF_DISABLED+MF_GRAYED);end;
      

  4.   


     EnableMenultem(GetSystemMenu(hwnd,FALSE),SC_CLOSE,MF_BYCOMMAND IMF_GRAYED)哈,我也不知道,新遍api上这么说的可以!
      

  5.   

    procedure TForm1.FormCreate(Sender: TObject);
    var
        sysmenu:HMENU;
    begin
        sysmenu:=GetSystemMenu(Handle,False);
        EnableMenuItem(sysmenu,SC_CLOSE,MF_GRAYED);
    end;我试过的,一定可以!