接楼上代码如下 Var FullRgn, ClientRgn, CtlRgn : THandle; procedure TFormMain.DoInvisible; var AControl : TControl; A, Margin, X, Y, CtlX, CtlY : Integer; begin Margin := ( Width - ClientWidth ) div 2; //First, get form region FullRgn := CreateRectRgn(0, 0, Width, Height); //Find client area region X := Margin; Y := Height - ClientHeight - Margin; ClientRgn := CreateRectRgn( X, Y, X + ClientWidth, Y + ClientHeight ); //'Mask' out all but non-client areas CombineRgn( FullRgn, FullRgn, ClientRgn, RGN_DIFF ); //Now, walk through all the controls on the form and 'OR' them // into the existing Full region. for A := 0 to ControlCount - 1 do begin AControl := Controls[A]; if ( AControl is TWinControl ) or ( AControl is TGraphicControl ) then with AControl do begin if Visible then begin CtlX := X + Left; CtlY := Y + Top; CtlRgn := CreateRectRgn( CtlX, CtlY, CtlX + Width, CtlY + Height ); CombineRgn( FullRgn, FullRgn, CtlRgn, RGN_OR ); end; end; end; //When the region is all ready, put it into effect: SetWindowRgn(Handle, FullRgn, TRUE); deleteobject(fullrgn); end;procedure TFormMain.FormCreate(Sender: TObject); begin doinvisible; end;
//////////////
这些问题,一般是一些消息没有处理,导致重画,所以看到标题栏....
Var FullRgn, ClientRgn, CtlRgn : THandle;
procedure TFormMain.DoInvisible;
var
AControl : TControl;
A, Margin, X, Y, CtlX, CtlY : Integer;
begin
Margin := ( Width - ClientWidth ) div 2;
//First, get form region
FullRgn := CreateRectRgn(0, 0, Width, Height);
//Find client area region
X := Margin;
Y := Height - ClientHeight - Margin;
ClientRgn := CreateRectRgn( X, Y, X + ClientWidth, Y + ClientHeight );
//'Mask' out all but non-client areas
CombineRgn( FullRgn, FullRgn, ClientRgn, RGN_DIFF ); //Now, walk through all the controls on the form and 'OR' them
// into the existing Full region.
for A := 0 to ControlCount - 1 do begin
AControl := Controls[A];
if ( AControl is TWinControl ) or ( AControl is TGraphicControl )
then with AControl do begin
if Visible then begin
CtlX := X + Left;
CtlY := Y + Top;
CtlRgn := CreateRectRgn( CtlX, CtlY, CtlX + Width, CtlY + Height );
CombineRgn( FullRgn, FullRgn, CtlRgn, RGN_OR );
end;
end;
end;
//When the region is all ready, put it into effect:
SetWindowRgn(Handle, FullRgn, TRUE);
deleteobject(fullrgn);
end;procedure TFormMain.FormCreate(Sender: TObject);
begin
doinvisible;
end;
http://linux.ccidnet.com/art/1081/20060207/423291_1.html
不过在Delphi下面比较简单,直接导入ActivX控件就行了。
这么 好的问题 竟然没人回答~~分数少的问题?
有Delphi版本的,不过是商业版本