🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.delphi.misc
4 messages
4 total messages Started by Chow Hoi Ka, Eric Thu, 17 Jun 1999 00:00
How to make the FORM transparent !!!!
#556
Author: Chow Hoi Ka, Eric
Date: Thu, 17 Jun 1999 00:00
6 lines
902 bytes
Hello,

Is is possible to make the FORM transparent ?

Best regards,
Eric
Re: How to make the FORM transparent !!!!
#553
Author: SnipeZ
Date: Thu, 17 Jun 1999 00:00
30 lines
1761 bytes
Chow Hoi Ka, Eric wrote:

> Hello,
>
> Is is possible to make the FORM transparent ?
>
> Best regards,
> Eric

Yes it's possible ! :)
If you would only ommit the background erase of a form it won't be
transparent anymore when you move it. So you have to find a way to not
obscure the parts of the window between its controls. Doing this is
actually quite easy...
In win32 a window can have a window region. Pixels outside this region
are not part of the window and will therefore not obscure the
background. A region is really a set of standard geometric figures, so
it can hold rectangles, polygons and circles.
By only including the rectangles of the controls on your form, the form
itself will not be part of your window, thus leaving the window (or
desktop) behind it alone.
Look up the SetWindowRegion function in the win32api help file for
details.

This way you can create fun windows that are round or have holes in them
:)

have fun,

SnipeZ
Re: How to make the FORM transparent !!!!
#554
Author: Eberhard K�mmel
Date: Thu, 17 Jun 1999 00:00
23 lines
1257 bytes
Chow Hoi Ka, Eric schrieb in Nachricht <37687007.E03C9970@sftw.umac.mo>...
>Hello,
>
>Is is possible to make the FORM transparent ?
>

No problem, check for WM_ERASEBKGND message in the WIN-API help.

You can do so,

procedure TMyWinControl.WndProc(var Message: TMessage);
begin
  if (Message.Msg = WM_ERASEBKGND) then
  begin
    Message.Result:=1;
  end;
...

(should also work for Forms) or go for the hbrBackground member of the
WNDCLASS structure.


Eberhard
Re: How to make the FORM transparent !!!!
#555
Author: SnipeZ
Date: Thu, 17 Jun 1999 00:00
26 lines
1418 bytes
Eberhard K�mmel wrote:

> Chow Hoi Ka, Eric schrieb in Nachricht <37687007.E03C9970@sftw.umac.mo>...
> >Hello,
> >
> >Is is possible to make the FORM transparent ?
> >
>
> No problem, check for WM_ERASEBKGND message in the WIN-API help.
>
> You can do so,
>
> procedure TMyWinControl.WndProc(var Message: TMessage);
> begin
>   if (Message.Msg = WM_ERASEBKGND) then
>   begin
>     Message.Result:=1;
>   end;
> ...
>
> (should also work for Forms) or go for the hbrBackground member of the
> WNDCLASS structure.
>
> Eberhard

That doesn't work ! Move your form around and you'll see
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads