Board index » delphi » Win95 Region-Windows

Win95 Region-Windows

Hi,

does anybody know how to use the Win95 region-windows ?

For example to get a round-clock-window.

Thanks

Tom

 

Re:Win95 Region-Windows


Try this page, it has an example and good explaination on how to do this.

http://www.informant.com/undu/dn961001/00000007.htm

Jeff Overcash

In article <32AD4C11.7...@titan.uni-duisburg.de>, t...@titan.uni-duisburg.de
wrote:

Quote
>Hi,

>does anybody know how to use the Win95 region-windows ?

>For example to get a round-clock-window.

>Thanks

>Tom

Re:Win95 Region-Windows


In article <32AD4C11.7...@titan.uni-duisburg.de>,
  Thomas Rauen <t...@titan.uni-duisburg.de> wrote:

Quote

> Hi,

> does anybody know how to use the Win95 region-windows ?

> For example to get a round-clock-window.

     SetWindowRgn.

David Ullrich
-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet

Re:Win95 Region-Windows


Quote
Thomas Rauen wrote:

> Hi,

> does anybody know how to use the Win95 region-windows ?

> For example to get a round-clock-window.

> Thanks

> Tom

Try something like

procedure TForm1.FormCreate(Sender: TObject);
var
  hreg: HRGN;
begin
  hreg := CreateEllipticRgn(0, 0, Width, Height);
  SetWindowRgn(Handle, hreg, TRUE);
end;

Good luck,

Chris

Re:Win95 Region-Windows


Quote
Chris Jobson wrote:

> Thomas Rauen wrote:

> > Hi,

> > does anybody know how to use the Win95 region-windows ?

> > For example to get a round-clock-window.

> > Thanks

> > Tom

> Try something like

> procedure TForm1.FormCreate(Sender: TObject);
> var
>   hreg: HRGN;
> begin
>   hreg := CreateEllipticRgn(0, 0, Width, Height);
>   SetWindowRgn(Handle, hreg, TRUE);
> end;

> Good luck,

> Chris

It works, thanks !

Tom

Re:Win95 Region-Windows


Quote
Thomas Rauen wrote:

> Hi,

> does anybody know how to use the Win95 region-windows ?

> For example to get a round-clock-window.

        Short version: SetWindowRgn.

        Long version: This came up a little while ago on
Compuserve - the guy had an "amazing" example, but he had a
little trouble getting the region he wanted. The following
is an incredibly amazing example.
        NOTE the following requires that the form's font be
True Type font - that has nothing to do with the SetWindowRgn
part, rather the tricks I use to define the amazing region won't
work with a False Type font. (A fairly LARGE font is advised
or you may not be able to see the form.) If you just want a
clock face you simply use CreateEllipticalRegion or whatever
it is and you're set. Anyway:

procedure TForm1.FormCreate(Sender: TObject);
var R:HRGN;
begin
with Canvas do
begin
  SetBkMode(Handle,TRANSPARENT);
  BeginPath(Handle);
  TextOut(20,20,'Amazing!');
  EndPath(Handle);
  R:=PathToRegion(Handle);
end;
  setWindowRgn(Handle,R,True);
end;

--
David Ullrich

?his ?s ?avid ?llrich's ?ig ?ile
(Someone undeleted it for me...)

Re:Win95 Region-Windows


Quote
David Ullrich <ullr...@math.okstate.edu> wrote:
>procedure TForm1.FormCreate(Sender: TObject);
>var R:HRGN;
>begin
>with Canvas do
>begin
>  SetBkMode(Handle,TRANSPARENT);
>  BeginPath(Handle);
>  TextOut(20,20,'Amazing!');
>  EndPath(Handle);
>  R:=PathToRegion(Handle);
>end;
>  setWindowRgn(Handle,R,True);
>end;

This code worked fine when using TextOut to draw the region mask.
But I couldn't create a region mask using RectFill, or
Rectangle....they had no effect on the region I was trying to
create....why is that ?
Is there a way to draw a region mask using graphic routines ?
Life is Weird,

Leslie Godwin
I'm at: The 3rd Rock from the shiney thing.
or E-mail: l...@pop.onwe.co.za

Other Threads