From: Claude Subject: Re: [D3] How to create non-rectangle forms? Date: 16 Jul 1998 00:00:00 GMT Message-ID: <35AE2D42.BCDE80D4@t-online.de> Content-Transfer-Encoding: 8bit References: <35ADE1BC.D8AB8160@EUnet.yu> To: "Dudás József" Content-Type: text/plain; charset=iso-8859-1 Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.delphi.winapi Hi there ! This proc makes your form look like a triangle, remember to call it on FormResize and FormShow. Regards, Claude. procedure SetTriangleWin( w: HWND ); var rgn: HRGN; points: array [ 0..4 ] of TPoint; wrect: TRect; { +0----------------------------+4 +1----------------------------+3 \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / +2 } begin if not ( SetWindowRgn( w, 0, false ) ) then begin ShowMessage( 'SetWindowRgn failed!' ); exit; end; if not ( GetWindowRect( w, wrect ) ) then begin ShowMessage( 'GetWindowRect failed!' ); exit; end; // Build the region point by point points[ 0 ].x := 0; points[ 0 ].y := 0; points[ 1 ].x := 0; points[ 1 ].y := GetSystemMetrics( SM_CYMENU ) + GetSystemMetrics( SM_CYCAPTION ); points[ 2 ].x := ( wrect.right - wrect.left ) div 2; points[ 2 ].y := wrect.bottom - wrect.top; points[ 3 ].x := wrect.right - wrect.left; points[ 3 ].y := GetSystemMetrics( SM_CYMENU ) + GetSystemMetrics( SM_CYCAPTION ); points[ 4 ].x := wrect.right - wrect.left; points[ 4 ].y := 0; // Create a region based on the array of points rgn := CreatePolygonRgn( points, 5, WINDING ); if ( rgn = 0 ) then ShowMessage( 'CreatePolygonRgn failed!' ) else begin // BOOM! Set the window to clip to the region. // You can even use elliptical regions or any // region you can think of. Make a region based // on some text or something. Sounds crazy, but // it is possible. if not ( SetWindowRgn( w, rgn, true ) ) then begin ShowMessage( 'SetWindowRgn failed!' ); end; end; end; Dudás József wrote: > How to create non-rectangle forms? > (Regions.....????????(how?)) > > Plz send an example! > Have a nice day! > > Dudás József > formater@EUnet.yu > > P.S: Example Norton CrashGuard (cgmain.exe)