怎样用SendMessage实现将窗口的BorderStyle改为bsNone的效果?也就是隐藏窗口的标题栏?

解决方案 »

  1.   

    这个问题不用sendmessageprocedure TForm1.Button1Click(Sender: TObject);
    var a:hwnd;
    begin
        a:=FindWindow(nil,'~');
        if a>0 then
            SetWindowLong(a,GWL_STYLE,GetWindowLong(Self.Handle,GWL_STYLE) and (not WS_CAPTION))
        else ShowMessage('not find');
    end;
      

  2.   

    上面写错了一个小地方:procedure TForm1.Button1Click(Sender: TObject);
    var a:hwnd;
    begin
        a:=FindWindow(nil,'~');//此处写你要修改的窗体标题
        if a>0 then
            SetWindowLong(a,GWL_STYLE,GetWindowLong(a,GWL_STYLE) and (not WS_CAPTION))
        else ShowMessage('not find');
    end;
      

  3.   

    不过好像把后面的那个GetWindowLong(a,GWL_STYLE) and (not WS_CAPTION) 换成 (not WS_BORDER) and GetWindowLong(a,GWL_STYLE) 实现的要好一些