首先谢谢Solid_Snake在这么晚了帮我解问题<br>下面是我发了贴后找到的,今早上起来一看Solid_Snake回答了我的问题,跟我找到的方法一至的,现结贴,谢谢<br><br><br>来自:Liu JZX, 时间:2000-3-13 9:53:00, ID:198830<br>1、<br>procedure TForm1.WMInit(var msg: TWMInitMenuPOPUP);<br>begin<br> inherited;<br> EnableMenuItem(msg.MenuPopup ,sc_Close,MF_BYCOMMAND or MF_GRAYED)<br><br>end;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> PostMessage(handle, WM_INITMENUPOPUP, GetSystemMenu(handle, false), 0);<br>end;<br><br>2、<br><br>procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);<br>begin<br> Action := CaNone;<br>end;<br><br>3、<br>procedure TForm2.FormCloseQuery(Sender: TObject; var CanClose: Boolean);<br>begin<br> CanClose:=false;<br>end;<br><br>4、<br>bordericons的bisystemmenu:=false;<br> <br>5、<br> TForm1 = class(TForm)<br> private<br> procedure Sys(var msg: TMessage);message WM_SYSCOMMAND;<br> public<br> { Public declarations }<br> end;<br><br>procedure TForm1.Sys(var msg: TMessage);<br>begin<br> if msg.WParam = SC_CLOSE then<br> msg.Result := 1;<br>end;<br><br>6、<br> procedure WMInit(var msg: TWMInitMenu);message WM_INITMENU;<br><br>procedure TForm1.WMInit(var msg: TWMInitMenu);<br>begin<br> inherited;<br> EnableMenuItem(msg.Menu,sc_Close,MF_BYCOMMAND or MF_GRAYED)<br>end;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> PostMessage(handle, WM_INITMENU, GetSystemMenu(handle, false), 0);<br>end;