whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1548)

Database (90)
Files (137)
Forms (107)
Graphic (116)
IDE (21)
Indy (5)
Internet / LAN (131)
IntraWeb (0)
Math (76)
Misc (127)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (268)
VCL (243)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

38 Visitors Online


 
...make rounded windows?
Autor: Simon Grossenbacher
Homepage: http://www.swissdelphicenter.ch
[ Print tip ]  

Tip Rating (20):  
     




// The CreateEllipticRgn function creates an elliptical region.

function CreateEllipticRgn(
    nLeftRect: Integer,  // x-coordinate of the upper-left corner
    
nTopRect: Integer,   // y-coordinate of the upper-left corner
    
nRightRect: Integer, // x-coordinate of the lower-right
    
nBottomRect: Integer // y-coordinate of the lower-right corner
   
): HRGN;

// The SetWindowRgn function sets the window region of a window.

function SetWindowRgn(

    hWnd: HWND, // handle to window whose window region is to be set
    
hRgn: HRGN, // handle to region
    
bRedraw: Boolean // window redraw flag
   
);
   
// Example:

procedure TForm1.FormCreate(Sender: TObject);
var
  
hRegion: HRGN;
begin
  
BorderStyle := bsNone;
  hRegion := CreateEllipticRgn(1, 1, 200, 200);
  SetWindowRgn(Handle, hRegion, True);
end;

 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners