解决方案 »

  1.   


    unit untBaseSkinForm;interfaceuses
      Windows,SysUtils,Forms,Messages,Graphics;
    type
      TBaseSkinForm=Class(TForm)
      private
      protected
        //绘制边框和标题栏
        procedure WMNCPaint(var Message:TWMNCPaint);message WM_NCPAINT;
        procedure WMNCActivate(var Message:TWMNCActivate);message WM_NCACTIVATE;
      public  End;implementation{ TBaseSkinForm }procedure TBaseSkinForm.WMNCActivate(var Msg: TWMNCActivate);
    begin
      //
    end;procedure TBaseSkinForm.WMNCPaint(var Message: TWMNCPaint);
    begin
      //
    end;end.
      

  2.   

    看你这样不如直接设置borderstyle=bsnone
      

  3.   

    procedure WMNChitTest(var Msg:TWMNChitTest); message WM_NCHITTEST;procedure TfrmMain.WMNChitTest(var Msg: TWMNChitTest);
    begin
      inherited;
      if (Msg.Result = HTCAPTION) and (Msg.Result <> HTSYSMENU) and (Msg.Result <> HTCLOSE) then
        Msg.Result:=0;
    end;用这个试试
      

  4.   


    jankercsdn帅哥,用了你的方法,可行,
    目前是鼠标在系统按钮的地方按下去的时候,它还是会绘制出相应的按钮
      

  5.   

    过滤了也不行
    我发现阻止了WM_NCLBUTTONDOWN就不会绘制了,但是相应的最小化,最大化,关闭功能就没有了.
      

  6.   

    bordericons =[];procedure TfrmMain.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;这样呢
      

  7.   

    bordericons :=[biSystemMenu];
    borderstles:= bsSingle;
        procedure FormMoving(var msg: TWMMoving); message WM_MOVING;  rect1: TRect;
    procedure TForm1.FormMoving(var msg: TWMMoving);
    begin
      msg.DragRect^.Left:= rect1.Left;
      msg.DragRect^.Top:= rect1.Top;
      msg.DragRect^.Right:= rect1.Right;
      msg.DragRect^.Bottom:= rect1.Bottom;
    end;procedure TForm1.FormCreate(Sender: TObject);
    begin
      rect1.Left:= Left;
      rect1.Top:= Top;
      rect1.Right:= Left+ Width;
      rect1.Bottom:= top+ Height;
    end;
      

  8.   


    还不如设置窗口 bsnone
    自己加个关闭按钮在上面就行了 
      

  9.   

    你的要求通过设置form 属性就能实现  borderstyle 属性设为bsSingle,bordericon 设为 [],windowsstate设为 wsMaximized
      

  10.   

    这好办:
    1.删除多余的系统菜单;
    2.固定窗口。//=====================================
    unit Unit1;
    interface
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;const
        WM_MYMEMO_ENTER = WM_USER + 900;
    type
      TForm1 = class(TForm)
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
        procedure WMWindowsPos(var Msg:TWMWindowPosMsg);message WM_WINDOWPOSCHANGING;
      public
        { Public declarations }
      end;var
      Form1: TForm1;
    implementation
    {$R *.dfm}//在窗体加载时将系统菜单中不需要的子菜单删除掉:
    procedure TForm1.FormCreate(Sender: TObject);
    var
      SysMenu: hMenu;
    begin
      SysMenu := GetSystemMenu(Handle, False);
      DeleteMenu(SysMenu, SC_MOVE, MF_BYCOMMAND);  //删除系统菜单中的移动项
      //还可以继续删:
      DeleteMenu(SysMenu, SC_SIZE, MF_BYCOMMAND);
      DeleteMenu(SysMenu, SC_MAXIMIZE, MF_BYCOMMAND);
      DeleteMenu(SysMenu, SC_RESTORE, MF_BYCOMMAND);
      DeleteMenu(SysMenu, SC_MINIMIZE, MF_BYCOMMAND);
    end;//固定窗口:
    procedure TForm1.WMWindowsPos(var Msg: TWMWindowPosMsg);
    begin
      with msg do
      Begin
        WindowPos.x := Left;
        WindowPos.y := top;
        WindowPos.cx := Width;
        WindowPos.cy := Height;
      end;
    end;end.
    //=====================================至于是否最大化,任由你设置。