1、
procedure tform1.wminit(var msg: twminitmenupopup);
begin
inherited;
enablemenuitem(msg.menupopup ,sc_close,mf_bycommand or mf_grayed)
end;
procedure tform1.formcreate(sender: tobject);
begin
postmessage(handle, wm_initmenupopup, getsystemmenu(handle, false), 0);
end;
2、 procedure tform2.formclose(sender: tobject; var action: tcloseaction);
begin
action := canone;
end;
3、 procedure tform2.formclosequery(sender: tobject; var canclose: boolean);
begin
canclose:=false;
end;
4、 bordericons的bisystemmenu:=false;
5、 tform1 = class(tform)
private
procedure sys(var msg: tmessage);message wm_syscommand;
public
end;
procedure tform1.sys(var msg: tmessage);
begin
if msg.wparam = sc_close then
msg.result := 1;
end;
6、 procedure wminit(var msg: twminitmenu);message wm_initmenu;
procedure tform1.wminit(var msg: twminitmenu);
begin
inherited;
enablemenuitem(msg.menu,sc_close,mf_bycommand or mf_grayed)
end;
procedure tform1.formcreate(sender: tobject);
begin
postmessage(handle, wm_initmenu, getsystemmenu(handle, false), 0);
end;
silverlight 讓右上角關閉按鈕 無效
有乙個需求,在彈出的頁面裡,使用者沒有進行某個操作時,不允許退出彈出頁面。專案是silverlight做的。彈出頁面是個silverlight子視窗。vs會自動在頁面右上角有個x按鈕。先上一段開始寫的遮蔽右上角關閉按鈕的 為頁面新增closing事件。1 關閉窗體 2private void chi...
delphi 實現無視窗移動
procedure imglistmousedown sender tobject button tmousebutton shift tshiftstate x,y integer private procedure wmnchittest var msg twmnchittest message...
delphi中讓視窗最前端顯示
1.置前 setwindowpos form1.handle,hwnd topmost,form1.left,form1.top,form1.width,form1.heigth,0 取消置前 setwindowpos form1.handle,hwnd notopmost,form1.left,f...