procedure WMNChitTest(var Msg:TWMNChitTest); message WM_NCHITTEST; procedure TfrmAcqMonitor.WMNChitTest(var Msg: TWMNChitTest); begin if (Msg.Result = HTCAPTION) and (Msg.Result <> HTSYSMENU) and (Msg.Result <> HTCLOSE) then Msg.Result:=0; end;
补充下: 窗口设成bsSingleprocedure TfrmAcqMonitor.FormCreate(Sender: TObject); var hmMenu:HMENU; ms:string; begin hmMenu:=GetSystemMenu(Handle,False); SetLength(ms,11); GetMenuString(hmMenu,1,PChar(ms),10,MF_BYPOSITION); ms:=Trim(ms); ModifyMenu(hmMenu,1,MF_BYPOSITION or MF_GRAYED,0,PChar(ms)); ...... end;
procedure WMNChitTest(var Msg:TWMNChitTest); message WM_NCHITTEST; procedure TfrmAcqMonitor.WMNChitTest(var Msg: TWMNChitTest);
begin
if (Msg.Result = HTCAPTION) and (Msg.Result <> HTSYSMENU) and (Msg.Result <> HTCLOSE) then
Msg.Result:=0;
end;
窗口设成bsSingleprocedure TfrmAcqMonitor.FormCreate(Sender: TObject);
var
hmMenu:HMENU;
ms:string;
begin
hmMenu:=GetSystemMenu(Handle,False);
SetLength(ms,11);
GetMenuString(hmMenu,1,PChar(ms),10,MF_BYPOSITION);
ms:=Trim(ms);
ModifyMenu(hmMenu,1,MF_BYPOSITION or MF_GRAYED,0,PChar(ms));
......
end;